diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-22 21:17:48 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-23 18:41:52 +0200 |
commit | 9c0f109f935d7db6893df89c86bdbf56472c60b1 (patch) | |
tree | 67fa32459701b2640100f462b7eaa7f6e42e4847 /src | |
parent | 4e76c7da364ef4d493cbd111ff66178094bc5d64 (diff) | |
download | ghdl-9c0f109f935d7db6893df89c86bdbf56472c60b1.tar.gz ghdl-9c0f109f935d7db6893df89c86bdbf56472c60b1.tar.bz2 ghdl-9c0f109f935d7db6893df89c86bdbf56472c60b1.zip |
synth: add support for declarations in vunits.
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/synth-decls.ads | 3 | ||||
-rw-r--r-- | src/synth/synth-stmts.adb | 28 |
2 files changed, 27 insertions, 4 deletions
diff --git a/src/synth/synth-decls.ads b/src/synth/synth-decls.ads index ddcb43cf6..02bf5c865 100644 --- a/src/synth/synth-decls.ads +++ b/src/synth/synth-decls.ads @@ -37,6 +37,9 @@ package Synth.Decls is procedure Synth_Declaration_Type (Syn_Inst : Synth_Instance_Acc; Decl : Node); + procedure Synth_Declaration + (Syn_Inst : Synth_Instance_Acc; Decl : Node; Is_Subprg : Boolean); + procedure Synth_Declarations (Syn_Inst : Synth_Instance_Acc; Decls : Iir; Is_Subprg : Boolean := False); diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index 5977c978e..c8b0e1f2c 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -2608,25 +2608,45 @@ package body Synth.Stmts is procedure Synth_Verification_Unit (Syn_Inst : Synth_Instance_Acc; Unit : Node) is + use Areapools; + Prev_Instance_Pool : constant Areapool_Acc := Instance_Pool; + Unit_Inst : Synth_Instance_Acc; + Unit_Sname : Sname; + M : Areapools.Mark_Type; Item : Node; begin + Unit_Sname := New_Sname (Get_Sname (Syn_Inst), Get_Identifier (Unit)); + Unit_Inst := Make_Instance (Syn_Inst, Unit, Unit_Sname); + Mark (M, Proc_Pool); + Instance_Pool := Proc_Pool'Access; + Item := Get_Vunit_Item_Chain (Unit); while Item /= Null_Node loop case Get_Kind (Item) is when Iir_Kind_Psl_Default_Clock => null; when Iir_Kind_Psl_Assert_Directive => - Synth_Psl_Assert_Directive (Syn_Inst, Item); + Synth_Psl_Assert_Directive (Unit_Inst, Item); when Iir_Kind_Psl_Assume_Directive => - Synth_Psl_Assume_Directive (Syn_Inst, Item); + Synth_Psl_Assume_Directive (Unit_Inst, Item); when Iir_Kind_Psl_Restrict_Directive => - Synth_Psl_Restrict_Directive (Syn_Inst, Item); + Synth_Psl_Restrict_Directive (Unit_Inst, Item); when Iir_Kind_Psl_Cover_Directive => - Synth_Psl_Cover_Directive (Syn_Inst, Item); + Synth_Psl_Cover_Directive (Unit_Inst, Item); + when Iir_Kind_Signal_Declaration + | Iir_Kind_Function_Declaration + | Iir_Kind_Procedure_Declaration + | Iir_Kind_Function_Body + | Iir_Kind_Procedure_Body => + Synth_Declaration (Unit_Inst, Item, False); when others => Error_Kind ("synth_verification_unit", Item); end case; Item := Get_Chain (Item); end loop; + + Free_Instance (Unit_Inst); + Release (M, Proc_Pool); + Instance_Pool := Prev_Instance_Pool; end Synth_Verification_Unit; end Synth.Stmts; |