aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/elab-vhdl_insts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-08-19 07:20:25 +0200
committerTristan Gingold <tgingold@free.fr>2022-08-19 07:46:47 +0200
commitc28f780bc65b54989cccf83b0637113be3964b51 (patch)
tree2952b30cef115df0aaf6efa4c4122324043e8c12 /src/synth/elab-vhdl_insts.adb
parent8445d2e9d7af348c86d6e28eff74407530719138 (diff)
downloadghdl-c28f780bc65b54989cccf83b0637113be3964b51.tar.gz
ghdl-c28f780bc65b54989cccf83b0637113be3964b51.tar.bz2
ghdl-c28f780bc65b54989cccf83b0637113be3964b51.zip
elab-vhdl_expr: factorize code
Diffstat (limited to 'src/synth/elab-vhdl_insts.adb')
-rw-r--r--src/synth/elab-vhdl_insts.adb10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/synth/elab-vhdl_insts.adb b/src/synth/elab-vhdl_insts.adb
index b5c4a7bc9..2a7babf27 100644
--- a/src/synth/elab-vhdl_insts.adb
+++ b/src/synth/elab-vhdl_insts.adb
@@ -34,6 +34,8 @@ with Elab.Vhdl_Files;
with Elab.Vhdl_Errors; use Elab.Vhdl_Errors;
with Elab.Vhdl_Expr; use Elab.Vhdl_Expr;
+with Synth.Vhdl_Expr; use Synth.Vhdl_Expr;
+
package body Elab.Vhdl_Insts is
procedure Elab_Instance_Body (Syn_Inst : Synth_Instance_Acc);
procedure Elab_Recurse_Instantiations
@@ -76,11 +78,11 @@ package body Elab.Vhdl_Insts is
case Get_Kind (Assoc) is
when Iir_Kind_Association_Element_Open =>
Actual := Get_Default_Value (Inter);
- Val := Exec_Expression_With_Type
+ Val := Synth_Expression_With_Type
(Sub_Inst, Actual, Inter_Type);
when Iir_Kind_Association_Element_By_Expression =>
Actual := Get_Actual (Assoc);
- Val := Exec_Expression_With_Type
+ Val := Synth_Expression_With_Type
(Syn_Inst, Actual, Inter_Type);
when others =>
raise Internal_Error;
@@ -344,7 +346,7 @@ package body Elab.Vhdl_Insts is
then
-- For expression: just compute the expression and associate.
Inter_Typ := Elab_Declaration_Type (Sub_Inst, Inter);
- Val := Exec_Expression_With_Type
+ Val := Synth_Expression_With_Type
(Syn_Inst, Get_Actual (Assoc), Inter_Typ);
return Val.Typ;
end if;
@@ -805,7 +807,7 @@ package body Elab.Vhdl_Insts is
Inter_Typ : Type_Acc;
begin
Inter_Typ := Elab_Declaration_Type (Top_Inst, Inter);
- Val := Exec_Expression_With_Type
+ Val := Synth_Expression_With_Type
(Top_Inst, Get_Default_Value (Inter), Inter_Typ);
pragma Assert (Is_Static (Val.Val));
Create_Object (Top_Inst, Inter, Val);