diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-04 08:56:38 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-04 08:56:38 +0100 |
commit | ad571771adbb27b43a9470f96dcb42db8a51c79a (patch) | |
tree | d1f0389cfb14cd2e66fd3a060824e5fc13df690d /src/ghdldrv | |
parent | afbffcb6f8e2ebc9786c6fc0c237ed32b900a310 (diff) | |
download | ghdl-ad571771adbb27b43a9470f96dcb42db8a51c79a.tar.gz ghdl-ad571771adbb27b43a9470f96dcb42db8a51c79a.tar.bz2 ghdl-ad571771adbb27b43a9470f96dcb42db8a51c79a.zip |
ghdlsimul: do late semantic checks
Diffstat (limited to 'src/ghdldrv')
-rw-r--r-- | src/ghdldrv/ghdlsimul.adb | 20 |
1 files changed, 19 insertions, 1 deletions
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; |