aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-insts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-23 07:48:19 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-23 08:44:08 +0100
commit24cbc598dd3200eb6842b68713eeec9369d186ab (patch)
tree5dd7ae58c105f314d05d1300dee9e46bbb4f0f0c /src/synth/synth-insts.adb
parent7e6fc375fcd573489204fbda6cddb863d6a132cc (diff)
downloadghdl-24cbc598dd3200eb6842b68713eeec9369d186ab.tar.gz
ghdl-24cbc598dd3200eb6842b68713eeec9369d186ab.tar.bz2
ghdl-24cbc598dd3200eb6842b68713eeec9369d186ab.zip
synth: preliminary work for package instantiation. For #1159
Diffstat (limited to 'src/synth/synth-insts.adb')
-rw-r--r--src/synth/synth-insts.adb46
1 files changed, 1 insertions, 45 deletions
diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb
index fae1a5a65..18c23b8bb 100644
--- a/src/synth/synth-insts.adb
+++ b/src/synth/synth-insts.adb
@@ -751,50 +751,6 @@ package body Synth.Insts is
end loop;
end Synth_Instantiate_Module;
- procedure Synth_Generics_Association (Sub_Inst : Synth_Instance_Acc;
- Syn_Inst : Synth_Instance_Acc;
- Inter_Chain : Node;
- Assoc_Chain : Node)
- is
- Inter : Node;
- Inter_Type : Type_Acc;
- Assoc : Node;
- Assoc_Inter : Node;
- Actual : Node;
- Val : Value_Acc;
- begin
- Assoc := Assoc_Chain;
- Assoc_Inter := Inter_Chain;
- while Is_Valid (Assoc) loop
- Inter := Get_Association_Interface (Assoc, Assoc_Inter);
-
- Synth_Declaration_Type (Sub_Inst, Inter);
- Inter_Type := Get_Value_Type (Sub_Inst, Get_Type (Inter));
-
- pragma Assert (Iir_Parameter_Modes (Get_Mode (Inter)) = Iir_In_Mode);
- case Get_Kind (Assoc) is
- when Iir_Kind_Association_Element_Open =>
- Actual := Get_Default_Value (Inter);
- Val := Synth_Expression_With_Type
- (Sub_Inst, Actual, Inter_Type);
- when Iir_Kind_Association_Element_By_Expression =>
- Actual := Get_Actual (Assoc);
- Val := Synth_Expression_With_Type
- (Syn_Inst, Actual, Inter_Type);
- when others =>
- raise Internal_Error;
- end case;
-
- Val := Synth_Subtype_Conversion (Val, Inter_Type, True, Assoc);
-
- pragma Assert (Is_Static (Val));
-
- Create_Object (Sub_Inst, Inter, Val);
-
- Next_Association_Interface (Assoc, Assoc_Inter);
- end loop;
- end Synth_Generics_Association;
-
-- Return the type of EXPR without evaluating it.
-- FIXME: how dubious is it ?
function Synth_Type_Of_Object (Syn_Inst : Synth_Instance_Acc; Expr : Node)
@@ -1199,7 +1155,7 @@ package body Synth.Insts is
end if;
end;
when Iir_Kind_Package_Instantiation_Declaration =>
- null;
+ Synth_Package_Instantiation (Parent_Inst, Dep_Unit);
when Iir_Kind_Package_Body =>
null;
when Iir_Kind_Architecture_Body =>