aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap5.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-06-30 06:15:30 +0200
committerTristan Gingold <tgingold@free.fr>2016-07-03 14:16:16 +0200
commitf100e7c33b3064d92a46ef09936aebd899203d8e (patch)
treec25d8afd083fadd7572efa246094c5901cf9e5e4 /src/vhdl/translate/trans-chap5.adb
parent906d23d23591b2040b3554e7aa39ecfe0c9a1e1b (diff)
downloadghdl-f100e7c33b3064d92a46ef09936aebd899203d8e.tar.gz
ghdl-f100e7c33b3064d92a46ef09936aebd899203d8e.tar.bz2
ghdl-f100e7c33b3064d92a46ef09936aebd899203d8e.zip
Enable vest recursive instantiation test.
Diffstat (limited to 'src/vhdl/translate/trans-chap5.adb')
-rw-r--r--src/vhdl/translate/trans-chap5.adb16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/vhdl/translate/trans-chap5.adb b/src/vhdl/translate/trans-chap5.adb
index c115b84b4..7bdb84385 100644
--- a/src/vhdl/translate/trans-chap5.adb
+++ b/src/vhdl/translate/trans-chap5.adb
@@ -36,7 +36,10 @@ package body Trans.Chap5 is
Scope => Scope_Ptr.all);
end Save_Map_Env;
- procedure Set_Map_Env (Env : Map_Env) is
+ procedure Set_Map_Env (Env : Map_Env)
+ is
+ -- Avoid potential compiler bug with discriminant check.
+ pragma Suppress (Discriminant_Check);
begin
Env.Scope_Ptr.all := Env.Scope;
end Set_Map_Env;
@@ -421,9 +424,10 @@ package body Trans.Chap5 is
end if;
else
- Set_Map_Env (Actual_Env);
- Actual_En := Chap7.Translate_Expression (Actual, Formal_Type);
+ -- Association by value. The formal cannot be referenced in the
+ -- actual.
Set_Map_Env (Formal_Env);
+ Actual_En := Chap7.Translate_Expression (Actual, Formal_Type);
Actual_Sig := E2M (Actual_En, Get_Info (Formal_Type), Mode_Value);
Chap6.Translate_Signal_Name (Formal, Formal_Sig, Formal_Val);
Mode := Connect_Value;
@@ -449,12 +453,12 @@ package body Trans.Chap5 is
Chap4.Elab_In_Conversion (Assoc, Actual_Sig);
Set_Map_Env (Formal_Env);
Formal_Sig := Chap6.Translate_Name (Formal, Mode_Signal);
- Set_Map_Env (Actual_Env);
Data := (Actual_Sig => Actual_Sig,
Actual_Type => Formal_Type,
Mode => Connect_Effective,
By_Copy => False);
Connect (Formal_Sig, Formal_Type, Data);
+ Set_Map_Env (Actual_Env);
end if;
if Get_Out_Conversion (Assoc) /= Null_Iir then
-- flow: FORMAL to ACTUAL
@@ -639,7 +643,9 @@ package body Trans.Chap5 is
begin
Set_Map_Env (Formal_Env);
-- Set bounds of unconstrained ports.
- if Fbt_Info.Type_Mode = Type_Mode_Fat_Array then
+ if Get_Whole_Association_Flag (Assoc)
+ and then Fbt_Info.Type_Mode = Type_Mode_Fat_Array
+ then
Open_Temp;
Elab_Unconstrained_Port_Bounds (Formal, Assoc);
Close_Temp;