From 47def2be73f1a5f27f2c46db8cbc5a350f0f549e Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 16 Jan 2023 18:54:48 +0100 Subject: synth: emit an error message on foreign subprogram calls --- src/synth/synth-vhdl_stmts.adb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/synth') 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, -- cgit v1.2.3