aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-06-04 07:06:25 +0200
committerTristan Gingold <tgingold@free.fr>2022-06-04 16:27:46 +0200
commitadfe96ecbe5795f65f8214ce30073385de37bbc6 (patch)
tree698a4de437429b20f98aea02ae578055b5c9bd32 /src
parentd6ff9d26397138dbfef4c15a5e4d4781c37d4267 (diff)
downloadghdl-adfe96ecbe5795f65f8214ce30073385de37bbc6.tar.gz
ghdl-adfe96ecbe5795f65f8214ce30073385de37bbc6.tar.bz2
ghdl-adfe96ecbe5795f65f8214ce30073385de37bbc6.zip
elab-vhdl_types: handle array attributes on function call
Diffstat (limited to 'src')
-rw-r--r--src/synth/elab-vhdl_expr.adb7
-rw-r--r--src/synth/elab-vhdl_types.adb2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/synth/elab-vhdl_expr.adb b/src/synth/elab-vhdl_expr.adb
index 76a9a59e8..72a0e2b8c 100644
--- a/src/synth/elab-vhdl_expr.adb
+++ b/src/synth/elab-vhdl_expr.adb
@@ -698,6 +698,13 @@ package body Elab.Vhdl_Expr is
Val := Elab.Vhdl_Heap.Synth_Dereference (Read_Access (Val));
return Val.Typ;
end;
+ when Iir_Kind_Function_Call =>
+ declare
+ Val : Valtyp;
+ begin
+ Val := Synth.Vhdl_Expr.Synth_Expression (Syn_Inst, Name);
+ return Val.Typ;
+ end;
when others =>
Error_Kind ("exec_name_subtype", Name);
end case;
diff --git a/src/synth/elab-vhdl_types.adb b/src/synth/elab-vhdl_types.adb
index ad43277fb..ffddd20ae 100644
--- a/src/synth/elab-vhdl_types.adb
+++ b/src/synth/elab-vhdl_types.adb
@@ -82,6 +82,8 @@ package body Elab.Vhdl_Types is
-- TODO: does this cover all the cases ?
Typ := Get_Subtype_Object (Syn_Inst, Get_Subtype_Indication (Prefix));
else
+ -- The expression cannot be fully executed as it can be a signal
+ -- (whose evaluation is not allowed during elaboration).
Typ := Exec_Name_Subtype (Syn_Inst, Prefix_Name);
end if;