aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-12-11 18:44:10 +0100
committerTristan Gingold <tgingold@free.fr>2017-12-11 18:44:10 +0100
commit09b5eacda6a6f27625679519f9d3843c0ad4c82e (patch)
tree2ee4ea1e6c5185119611d23ef9d7e3a0e2b46b54 /src
parenteef83a5f38709f860ffab53641e7dc181f2379ab (diff)
downloadghdl-09b5eacda6a6f27625679519f9d3843c0ad4c82e.tar.gz
ghdl-09b5eacda6a6f27625679519f9d3843c0ad4c82e.tar.bz2
ghdl-09b5eacda6a6f27625679519f9d3843c0ad4c82e.zip
simul: handle open association in implicit procedure
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/simulate/simul-execution.adb17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/vhdl/simulate/simul-execution.adb b/src/vhdl/simulate/simul-execution.adb
index 0020bb2d3..a3babf0d9 100644
--- a/src/vhdl/simulate/simul-execution.adb
+++ b/src/vhdl/simulate/simul-execution.adb
@@ -1516,19 +1516,30 @@ package body Simul.Execution is
is
Imp : constant Iir := Get_Implementation (Stmt);
Assoc_Chain : constant Iir := Get_Parameter_Association_Chain (Stmt);
+ Inter_Chain : constant Iir := Get_Interface_Declaration_Chain (Imp);
Assoc: Iir;
+ Formal : Iir;
+ Val : Iir;
Args: Iir_Value_Literal_Array (0 .. 3);
- Inter_Chain : Iir;
Expr_Mark : Mark_Type;
begin
Mark (Expr_Mark, Expr_Pool);
Assoc := Assoc_Chain;
+ Formal := Inter_Chain;
for I in Iir_Index32 loop
exit when Assoc = Null_Iir;
- Args (I) := Execute_Expression (Block, Get_Actual (Assoc));
+ case Get_Kind (Assoc) is
+ when Iir_Kind_Association_Element_By_Expression =>
+ Val := Get_Actual (Assoc);
+ when Iir_Kind_Association_Element_Open =>
+ Val := Get_Default_Value (Formal);
+ when others =>
+ raise Internal_Error;
+ end case;
+ Args (I) := Execute_Expression (Block, Val);
Assoc := Get_Chain (Assoc);
+ Formal := Get_Chain (Formal);
end loop;
- Inter_Chain := Get_Interface_Declaration_Chain (Imp);
case Get_Implicit_Definition (Imp) is
when Iir_Predefined_Deallocate =>
if Args (0).Val_Access /= null then