diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-16 18:54:48 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-16 18:54:48 +0100 |
commit | 47def2be73f1a5f27f2c46db8cbc5a350f0f549e (patch) | |
tree | 43e916bd055dce62edc0ed3d076078e325563566 /src/synth | |
parent | 288021722ffbc7eb2a01549d08bbd04584da5c75 (diff) | |
download | ghdl-47def2be73f1a5f27f2c46db8cbc5a350f0f549e.tar.gz ghdl-47def2be73f1a5f27f2c46db8cbc5a350f0f549e.tar.bz2 ghdl-47def2be73f1a5f27f2c46db8cbc5a350f0f549e.zip |
synth: emit an error message on foreign subprogram calls
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-vhdl_stmts.adb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb index 70b342e41..cd93c3673 100644 --- a/src/synth/synth-vhdl_stmts.adb +++ b/src/synth/synth-vhdl_stmts.adb @@ -2656,6 +2656,12 @@ package body Synth.Vhdl_Stmts is Wire_Mark : Wire_Id; Subprg_Phi : Phi_Type; begin + if Get_Foreign_Flag (Imp) then + Error_Msg_Synth + (Syn_Inst, Call, "cannot synthesize FOREIGN %n", +Imp); + return No_Valtyp; + end if; + Mark (Wire_Mark); C := (Mode => Mode_Dynamic, Inst => Sub_Inst, @@ -2766,6 +2772,11 @@ package body Synth.Vhdl_Stmts is Res : Valtyp; C : Seq_Context (Mode_Static); begin + if Get_Foreign_Flag (Imp) then + Error_Msg_Synth (Syn_Inst, Loc, "cannot call FOREIGN %n", +Imp); + return No_Valtyp; + end if; + C := (Mode_Static, Inst => Sub_Inst, Cur_Loop => null, |