aboutsummaryrefslogtreecommitdiffstats
path: root/src/ghdldrv/ghdlrun.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-16 04:58:21 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-16 05:16:18 +0100
commite0da896fef32b75b10a4fe722f176d6651e81a6c (patch)
tree7050b3431e814df6b7ce3b1544718584e1d84aa1 /src/ghdldrv/ghdlrun.adb
parent7414046cc73ecc16bfa2ce3af3cb529195ce120f (diff)
downloadghdl-e0da896fef32b75b10a4fe722f176d6651e81a6c.tar.gz
ghdl-e0da896fef32b75b10a4fe722f176d6651e81a6c.tar.bz2
ghdl-e0da896fef32b75b10a4fe722f176d6651e81a6c.zip
Drivers: add --pre-elab (as a stub).
Diffstat (limited to 'src/ghdldrv/ghdlrun.adb')
-rw-r--r--src/ghdldrv/ghdlrun.adb29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/ghdldrv/ghdlrun.adb b/src/ghdldrv/ghdlrun.adb
index 3f0cd10c6..698879202 100644
--- a/src/ghdldrv/ghdlrun.adb
+++ b/src/ghdldrv/ghdlrun.adb
@@ -66,6 +66,17 @@ with Foreigns;
with Grtlink;
package body Ghdlrun is
+ -- Elaboration mode.
+ type Elab_Mode_Type is
+ (-- Static elaboration (or pre-elaboration).
+ Elab_Static,
+
+ -- Dynamic elaboration: design is elaborated just before being run.
+ Elab_Dynamic);
+
+ -- Default elaboration mode is dynamic.
+ Elab_Mode : constant Elab_Mode_Type := Elab_Dynamic;
+
procedure Foreign_Hook (Decl : Iir;
Info : Translation.Foreign_Info_Type;
Ortho : O_Dnode);
@@ -90,7 +101,16 @@ package body Ghdlrun is
Ortho_Jit.Init;
Translation.Initialize;
- Canon.Canon_Flag_Add_Labels := True;
+
+ case Elab_Mode is
+ when Elab_Static =>
+ Canon.Canon_Flag_Add_Labels := True;
+ Canon.Canon_Flag_Sequentials_Stmts := True;
+ Canon.Canon_Flag_Expressions := True;
+ Canon.Canon_Flag_All_Sensitivity := True;
+ when Elab_Dynamic =>
+ Canon.Canon_Flag_Add_Labels := True;
+ end case;
end Compile_Init;
procedure Compile_Elab
@@ -103,7 +123,12 @@ package body Ghdlrun is
end if;
Flags.Flag_Elaborate := True;
- Translation.Elaborate (Prim_Name.all, Sec_Name.all, "", True);
+ case Elab_Mode is
+ when Elab_Static =>
+ raise Program_Error;
+ when Elab_Dynamic =>
+ Translation.Elaborate (Prim_Name.all, Sec_Name.all, "", True);
+ end case;
if Errorout.Nbr_Errors > 0 then
-- This may happen (bad entity for example).