aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap5.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-06-30 06:14:11 +0200
committerTristan Gingold <tgingold@free.fr>2016-07-03 14:16:16 +0200
commit787d1d010ba53f2572aa11a78407e846ee4061dc (patch)
tree50ce71c99ba9187fde06b50173a2c487e8ef4afd /src/vhdl/translate/trans-chap5.ads
parent9ebac9a4cf1dce154a1fb7eecd75ccad189b3424 (diff)
downloadghdl-787d1d010ba53f2572aa11a78407e846ee4061dc.tar.gz
ghdl-787d1d010ba53f2572aa11a78407e846ee4061dc.tar.bz2
ghdl-787d1d010ba53f2572aa11a78407e846ee4061dc.zip
Initial support of direct recursive instantiation.
Fix issue #2.
Diffstat (limited to 'src/vhdl/translate/trans-chap5.ads')
-rw-r--r--src/vhdl/translate/trans-chap5.ads21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/vhdl/translate/trans-chap5.ads b/src/vhdl/translate/trans-chap5.ads
index 4912dc224..6902d3b3b 100644
--- a/src/vhdl/translate/trans-chap5.ads
+++ b/src/vhdl/translate/trans-chap5.ads
@@ -30,7 +30,22 @@ package Trans.Chap5 is
-- Elab an unconstrained port.
procedure Elab_Unconstrained_Port_Bounds (Port : Iir; Assoc : Iir);
- procedure Elab_Generic_Map_Aspect (Mapping : Iir);
+ -- Describe how to set the environment to access to formal in a map. This
+ -- is really useful only for recursive instantiation where the formal is
+ -- the same as the actual, but their environment differs.
+ type Map_Env is record
+ -- The scope that has to be modified.
+ Scope_Ptr : Var_Scope_Acc;
+
+ -- The value for the scope.
+ Scope : Var_Scope_Type;
+ end record;
+
+ -- Save and restore the map environment defined by ENV.
+ procedure Save_Map_Env (Env : out Map_Env; Scope_Ptr : Var_Scope_Acc);
+ procedure Set_Map_Env (Env : Map_Env);
+
+ procedure Elab_Generic_Map_Aspect (Mapping : Iir; Formal_Env : Map_Env);
-- There are 4 cases of generic/port map:
-- 1) component instantiation
@@ -40,5 +55,7 @@ package Trans.Chap5 is
-- 4) direct (entity + architecture or configuration) instantiation
--
-- MAPPING is the node containing the generic/port map aspects.
- procedure Elab_Map_Aspect (Mapping : Iir; Block_Parent : Iir);
+
+ procedure Elab_Map_Aspect
+ (Mapping : Iir; Block_Parent : Iir; Formal_Env : Map_Env);
end Trans.Chap5;