aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/synth/synth-vhdl_stmts.adb9
-rw-r--r--src/vhdl/vhdl-canon.adb35
2 files changed, 25 insertions, 19 deletions
diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb
index 4e7c6963f..687be6510 100644
--- a/src/synth/synth-vhdl_stmts.adb
+++ b/src/synth/synth-vhdl_stmts.adb
@@ -3570,9 +3570,7 @@ package body Synth.Vhdl_Stmts is
if Cond = No_Valtyp or else Read_Discrete (Cond) = 1 then
Bod := Get_Generate_Statement_Body (Gen);
Config := Get_Generate_Block_Configuration (Bod);
- if Config /= Null_Node then
- Apply_Block_Configuration (Config, Bod);
- end if;
+ Apply_Block_Configuration (Config, Bod);
Synth_Generate_Statement_Body (Syn_Inst, Bod, Name);
exit;
end if;
@@ -3620,10 +3618,7 @@ package body Synth.Vhdl_Stmts is
end case;
Config := Get_Prev_Block_Configuration (Config);
end loop;
- -- There is no block configuration in vunits (yet).
- if Config /= Null_Node then
- Apply_Block_Configuration (Config, Bod);
- end if;
+ Apply_Block_Configuration (Config, Bod);
end;
-- FIXME: get position ?
diff --git a/src/vhdl/vhdl-canon.adb b/src/vhdl/vhdl-canon.adb
index 9e3dea60e..1db61ad63 100644
--- a/src/vhdl/vhdl-canon.adb
+++ b/src/vhdl/vhdl-canon.adb
@@ -3269,6 +3269,27 @@ package body Vhdl.Canon is
end case;
end Canon_Block_Configuration_Statement;
+ -- Recursion for Canon_Block_Configuration: canonicalize each item of a
+ -- block configuration (starting with FIRST_ITEM).
+ procedure Canon_Block_Configuration_Recurse (Top : Iir_Design_Unit;
+ First_Item : Iir)
+ is
+ El : Iir;
+ begin
+ El := First_Item;
+ while El /= Null_Iir loop
+ case Get_Kind (El) is
+ when Iir_Kind_Block_Configuration =>
+ Canon_Block_Configuration (Top, El);
+ when Iir_Kind_Component_Configuration =>
+ Canon_Component_Configuration (Top, El);
+ when others =>
+ Error_Kind ("canon_block_configuration_recurse", El);
+ end case;
+ El := Get_Chain (El);
+ end loop;
+ end Canon_Block_Configuration_Recurse;
+
procedure Canon_Block_Configuration (Top : Iir_Design_Unit;
Conf : Iir_Block_Configuration)
is
@@ -3351,18 +3372,7 @@ package body Vhdl.Canon is
Set_Configuration_Item_Chain (Conf, First_Item);
-- 4) Canon component configuration and block configuration (recursion).
- El := First_Item;
- while El /= Null_Iir loop
- case Get_Kind (El) is
- when Iir_Kind_Block_Configuration =>
- Canon_Block_Configuration (Top, El);
- when Iir_Kind_Component_Configuration =>
- Canon_Component_Configuration (Top, El);
- when others =>
- Error_Kind ("canon_block_configuration", El);
- end case;
- El := Get_Chain (El);
- end loop;
+ Canon_Block_Configuration_Recurse (Top, First_Item);
end Canon_Block_Configuration;
procedure Canon_Interface_List (Chain : Iir)
@@ -3447,6 +3457,7 @@ package body Vhdl.Canon is
end loop;
Set_Configuration_Item_Chain (Blk_Cfg, First_Conf);
+ Canon_Block_Configuration_Recurse (Unit, First_Conf);
end Canon_Psl_Verification_Unit;
procedure Canonicalize (Unit: Iir_Design_Unit)