aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/elab-vhdl_stmts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-09-06 20:42:55 +0200
committerTristan Gingold <tgingold@free.fr>2022-09-06 20:42:55 +0200
commit5954723f26a0600e2f3f69de482c30e585e75ba2 (patch)
tree53ff984f436022b09994b74abf67c5907aaaaf75 /src/synth/elab-vhdl_stmts.adb
parent0061426b03bd806424e813fc7065478a8791d1e7 (diff)
downloadghdl-5954723f26a0600e2f3f69de482c30e585e75ba2.tar.gz
ghdl-5954723f26a0600e2f3f69de482c30e585e75ba2.tar.bz2
ghdl-5954723f26a0600e2f3f69de482c30e585e75ba2.zip
synth: handle generics in blocks
Diffstat (limited to 'src/synth/elab-vhdl_stmts.adb')
-rw-r--r--src/synth/elab-vhdl_stmts.adb29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/synth/elab-vhdl_stmts.adb b/src/synth/elab-vhdl_stmts.adb
index 8a0312200..c2bbe06f1 100644
--- a/src/synth/elab-vhdl_stmts.adb
+++ b/src/synth/elab-vhdl_stmts.adb
@@ -194,21 +194,36 @@ package body Elab.Vhdl_Stmts is
procedure Elab_Block_Statement (Syn_Inst : Synth_Instance_Acc; Blk : Node)
is
+ Hdr : constant Node := Get_Block_Header (Blk);
Blk_Inst : Synth_Instance_Acc;
+ Assoc : Node;
+ Inter : Node;
begin
- -- No support for guard or header.
- if Get_Block_Header (Blk) /= Null_Node
- or else Get_Guard_Decl (Blk) /= Null_Node
- then
- raise Internal_Error;
- end if;
-
Apply_Block_Configuration
(Get_Block_Block_Configuration (Blk), Blk);
Blk_Inst := Make_Elab_Instance (Syn_Inst, Blk, Null_Iir);
Create_Sub_Instance (Syn_Inst, Blk, Blk_Inst);
+ -- No support for guard.
+ if Get_Guard_Decl (Blk) /= Null_Node then
+ raise Internal_Error;
+ end if;
+
+ if Hdr /= Null_Node then
+ Inter := Get_Generic_Chain (Hdr);
+ if Inter /= Null_Node then
+ Assoc := Get_Generic_Map_Aspect_Chain (Hdr);
+ Elab_Generics_Association (Blk_Inst, Syn_Inst, Inter, Assoc);
+ end if;
+
+ Inter := Get_Port_Chain (Hdr);
+ if Inter /= Null_Node then
+ Assoc := Get_Port_Map_Aspect_Chain (Hdr);
+ Elab_Ports_Association_Type (Blk_Inst, Syn_Inst, Inter, Assoc);
+ end if;
+ end if;
+
Elab_Declarations (Blk_Inst, Get_Declaration_Chain (Blk));
Elab_Concurrent_Statements
(Blk_Inst, Get_Concurrent_Statement_Chain (Blk));