From ad571771adbb27b43a9470f96dcb42db8a51c79a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 4 Jan 2023 08:56:38 +0100 Subject: ghdlsimul: do late semantic checks --- src/ghdldrv/ghdlsimul.adb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/ghdldrv/ghdlsimul.adb b/src/ghdldrv/ghdlsimul.adb index 1e5c0f557..42873d0e0 100644 --- a/src/ghdldrv/ghdlsimul.adb +++ b/src/ghdldrv/ghdlsimul.adb @@ -30,8 +30,9 @@ with Simple_IO; with Vhdl.Nodes; use Vhdl.Nodes; with Vhdl.Std_Package; +with Vhdl.Sem; with Vhdl.Canon; - +with Vhdl.Configuration; with Grt.Options; with Grt.Types; @@ -81,6 +82,23 @@ package body Ghdlsimul is begin Common_Compile_Elab (Cmd_Name, Args, True, Opt_Arg, Config); + -- If all design units are loaded, late semantic checks can be + -- performed. + declare + use Vhdl.Configuration; + Unit : Node; + begin + if Flag_Load_All_Design_Units then + for I in Design_Units.First .. Design_Units.Last loop + Unit := Design_Units.Table (I); + Vhdl.Sem.Sem_Analysis_Checks_List (Unit, False); + -- There cannot be remaining checks to do. + pragma Assert + (Get_Analysis_Checks_List (Unit) = Null_Iir_List); + end loop; + end if; + end; + for I in Opt_Arg .. Args'Last loop if Args (I).all = "--expect-failure" then Flag_Expect_Failure := True; -- cgit v1.2.3