diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-11 06:56:35 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-11 06:56:35 +0200 |
commit | f5ae29aeeb5deaede9d6acbf9ff7af34a42b8d3e (patch) | |
tree | fe333429a64f709f78a8288ee60ac3574c9646af /src | |
parent | bb882cc4d904f99656f7168041ed0f9137f7b14d (diff) | |
download | ghdl-f5ae29aeeb5deaede9d6acbf9ff7af34a42b8d3e.tar.gz ghdl-f5ae29aeeb5deaede9d6acbf9ff7af34a42b8d3e.tar.bz2 ghdl-f5ae29aeeb5deaede9d6acbf9ff7af34a42b8d3e.zip |
synth_top_entity: pass config + minor cleanup.
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/synth-insts.adb | 12 | ||||
-rw-r--r-- | src/synth/synth-insts.ads | 2 | ||||
-rw-r--r-- | src/synth/synthesis.adb | 6 |
3 files changed, 7 insertions, 13 deletions
diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb index c9d3a5b33..5abc8d89d 100644 --- a/src/synth/synth-insts.adb +++ b/src/synth/synth-insts.adb @@ -375,15 +375,11 @@ package body Synth.Insts is raise Internal_Error; end Synth_Component_Instantiation_Statement; - procedure Synth_Top_Entity (Arch : Node) + procedure Synth_Top_Entity (Arch : Node; Config : Node) is - Config : constant Node := Null_Node; -- FIXME Entity : constant Node := Get_Entity (Arch); Syn_Inst : Synth_Instance_Acc; Inter : Node; - Nbr_Inputs : Port_Nbr; - Nbr_Outputs : Port_Nbr; - Num : Uns32; Inst_Obj : Inst_Object; begin Syn_Inst := Make_Instance (Global_Instance, Get_Info (Arch)); @@ -408,8 +404,6 @@ package body Synth.Insts is -- FIXME: what about unconstrained ports ? Get the type from the -- association. Inter := Get_Port_Chain (Entity); - Nbr_Inputs := 0; - Nbr_Outputs := 0; while Is_Valid (Inter) loop if not Is_Fully_Constrained_Type (Get_Type (Inter)) then -- TODO @@ -419,13 +413,9 @@ package body Synth.Insts is case Mode_To_Port_Kind (Get_Mode (Inter)) is when Port_In => Make_Object (Syn_Inst, Wire_None, Inter); - Num := Get_Nbr_Wire (Get_Value (Syn_Inst, Inter)); - Nbr_Inputs := Nbr_Inputs + Port_Nbr (Num); when Port_Out | Port_Inout => Make_Object (Syn_Inst, Wire_None, Inter); - Num := Get_Nbr_Wire (Get_Value (Syn_Inst, Inter)); - Nbr_Outputs := Nbr_Outputs + Port_Nbr (Num); end case; Inter := Get_Chain (Inter); end loop; diff --git a/src/synth/synth-insts.ads b/src/synth/synth-insts.ads index 39235c0d2..10fff648c 100644 --- a/src/synth/synth-insts.ads +++ b/src/synth/synth-insts.ads @@ -26,7 +26,7 @@ package Synth.Insts is procedure Init; procedure Synth_All_Instances; - procedure Synth_Top_Entity (Arch : Node); + procedure Synth_Top_Entity (Arch : Node; Config : Node); procedure Synth_Design_Instantiation_Statement (Syn_Inst : Synth_Instance_Acc; Stmt : Node); diff --git a/src/synth/synthesis.adb b/src/synth/synthesis.adb index d3aba58fc..644342d7f 100644 --- a/src/synth/synthesis.adb +++ b/src/synth/synthesis.adb @@ -92,6 +92,7 @@ package body Synthesis is is Unit : constant Node := Get_Library_Unit (Design); Arch : Node; + Config : Node; Syn_Inst : Synth_Instance_Acc; begin @@ -99,7 +100,10 @@ package body Synthesis is case Get_Kind (Unit) is when Iir_Kind_Architecture_Body => Arch := Unit; + Config := Get_Library_Unit + (Get_Default_Configuration_Declaration (Arch)); when Iir_Kind_Configuration_Declaration => + Config := Unit; Arch := Get_Named_Entity (Get_Block_Specification (Get_Block_Configuration (Unit))); when others => @@ -119,7 +123,7 @@ package body Synthesis is Synth_Dependencies (Global_Instance, Get_Design_Unit (Arch)); - Synth_Top_Entity (Arch); + Synth_Top_Entity (Arch, Config); Synth_All_Instances; if Errorout.Nbr_Errors > 0 then raise Compilation_Error; |