diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-09 20:25:17 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-09 20:25:17 +0200 |
commit | 1509254c6f982cb8a0a3c51bcc95c9fce843e12a (patch) | |
tree | 8886fab4992c79c947a5fac5128a846455caf0ad /src/synth | |
parent | de633f9ea2524d7a1e1339ea27bf09be6abdddec (diff) | |
download | ghdl-1509254c6f982cb8a0a3c51bcc95c9fce843e12a.tar.gz ghdl-1509254c6f982cb8a0a3c51bcc95c9fce843e12a.tar.bz2 ghdl-1509254c6f982cb8a0a3c51bcc95c9fce843e12a.zip |
synth: set name on generate statements.
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-insts.adb | 3 | ||||
-rw-r--r-- | src/synth/synth-stmts.adb | 19 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb index c0d40a2ea..f2d67b4d7 100644 --- a/src/synth/synth-insts.adb +++ b/src/synth/synth-insts.adb @@ -403,7 +403,8 @@ package body Synth.Insts is Inst := New_Instance (Get_Instance_Module (Syn_Inst), Inst_Obj.M, - New_Sname_User (Get_Identifier (Stmt))); + New_Sname (Get_Sname (Syn_Inst), + Get_Identifier (Stmt))); Set_Location (Inst, Stmt); Synth_Instantiate_Module diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb index e153a7cd4..05003e40e 100644 --- a/src/synth/synth-stmts.adb +++ b/src/synth/synth-stmts.adb @@ -2315,6 +2315,7 @@ package body Synth.Stmts is procedure Synth_Generate_Statement_Body (Syn_Inst : Synth_Instance_Acc; Bod : Node; + Name : Sname; Iterator : Node := Null_Node; Iterator_Val : Value_Acc := null) is @@ -2322,11 +2323,9 @@ package body Synth.Stmts is Decls_Chain : constant Node := Get_Declaration_Chain (Bod); Prev_Instance_Pool : constant Areapool_Acc := Instance_Pool; Bod_Inst : Synth_Instance_Acc; - Bod_Sname : Sname; M : Areapools.Mark_Type; begin - Bod_Sname := New_Sname (Get_Sname (Syn_Inst), Get_Identifier (Bod)); - Bod_Inst := Make_Instance (Syn_Inst, Bod, Bod_Sname); + Bod_Inst := Make_Instance (Syn_Inst, Bod, Name); Mark (M, Proc_Pool); Instance_Pool := Proc_Pool'Access; @@ -2355,6 +2354,8 @@ package body Synth.Stmts is Config : Node; It_Rng : Type_Acc; Val : Value_Acc; + Name : Sname; + Lname : Sname; begin if It_Type /= Null_Node then Synth_Subtype_Indication (Syn_Inst, It_Type); @@ -2364,6 +2365,8 @@ package body Synth.Stmts is It_Rng := Get_Value_Type (Syn_Inst, Get_Type (Iterator)); Val := Create_Value_Discrete (It_Rng.Drange.Left, It_Rng); + Name := New_Sname (Get_Sname (Syn_Inst), Get_Identifier (Stmt)); + while In_Range (It_Rng.Drange, Val.Scal) loop -- Find and apply the config block. declare @@ -2386,7 +2389,10 @@ package body Synth.Stmts is Apply_Block_Configuration (Config, Bod); end; - Synth_Generate_Statement_Body (Syn_Inst, Bod, Iterator, Val); + -- FIXME: get position ? + Lname := New_Sname_Version (Name, Uns32 (Val.Scal)); + + Synth_Generate_Statement_Body (Syn_Inst, Bod, Lname, Iterator, Val); Update_Index (It_Rng.Drange, Val.Scal); end loop; end Synth_For_Generate_Statement; @@ -2424,14 +2430,17 @@ package body Synth.Stmts is Gen : Node; Bod : Node; Cond : Value_Acc; + Name : Sname; begin Gen := Stmt; + Name := New_Sname (Get_Sname (Syn_Inst), + Get_Identifier (Stmt)); loop Cond := Synth_Expression (Syn_Inst, Get_Condition (Gen)); pragma Assert (Cond.Kind = Value_Discrete); if Cond.Scal = 1 then Bod := Get_Generate_Statement_Body (Gen); - Synth_Generate_Statement_Body (Syn_Inst, Bod); + Synth_Generate_Statement_Body (Syn_Inst, Bod, Name); exit; end if; Gen := Get_Generate_Else_Clause (Gen); |