aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-15 04:06:25 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-15 04:06:25 +0200
commit57af979704aab10b57c524003fb53343ec99615f (patch)
treeb16e2fb1345072e0723cb9fc22a3f79c3bc4198f
parent9e7bfe81b0d48939d85b74d7c03eb7e9bd06274d (diff)
downloadghdl-57af979704aab10b57c524003fb53343ec99615f.tar.gz
ghdl-57af979704aab10b57c524003fb53343ec99615f.tar.bz2
ghdl-57af979704aab10b57c524003fb53343ec99615f.zip
synth: use correct instance to synth default expressions of assocs.
-rw-r--r--src/synth/synth-stmts.adb23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index bbbc2fa84..056b4a354 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -783,19 +783,22 @@ package body Synth.Stmts is
while Is_Valid (Assoc) loop
Inter := Get_Association_Interface (Assoc, Assoc_Inter);
- case Get_Kind (Assoc) is
- when Iir_Kind_Association_Element_Open =>
- Actual := Get_Default_Value (Inter);
- when Iir_Kind_Association_Element_By_Expression =>
- Actual := Get_Actual (Assoc);
- when others =>
- raise Internal_Error;
- end case;
+ Synth_Declaration_Type (Subprg_Inst, Inter);
case Iir_Parameter_Modes (Get_Mode (Inter)) is
when Iir_In_Mode =>
- Val := Synth_Expression_With_Type
- (Caller_Inst, Actual, Get_Type (Inter));
+ case Get_Kind (Assoc) is
+ when Iir_Kind_Association_Element_Open =>
+ Actual := Get_Default_Value (Inter);
+ Val := Synth_Expression_With_Type
+ (Subprg_Inst, Actual, Get_Type (Inter));
+ when Iir_Kind_Association_Element_By_Expression =>
+ Actual := Get_Actual (Assoc);
+ Val := Synth_Expression_With_Type
+ (Caller_Inst, Actual, Get_Type (Inter));
+ when others =>
+ raise Internal_Error;
+ end case;
when Iir_Out_Mode | Iir_Inout_Mode =>
-- FIXME: todo
raise Internal_Error;