diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-05-06 18:38:36 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-05-06 18:38:36 +0200 |
commit | 9ebdd46defd0c2ce54d0e04c293e9d5a5b111026 (patch) | |
tree | bc2efdc6d7ffa1f8fb1409c4ee37d7a1c15f7c69 /src/synth/synth-decls.adb | |
parent | 4e6760203fc2b88567ac37fd6054c5a684d099ca (diff) | |
download | ghdl-9ebdd46defd0c2ce54d0e04c293e9d5a5b111026.tar.gz ghdl-9ebdd46defd0c2ce54d0e04c293e9d5a5b111026.tar.bz2 ghdl-9ebdd46defd0c2ce54d0e04c293e9d5a5b111026.zip |
synth: revert a previous commit: remove the En parameter.
Diffstat (limited to 'src/synth/synth-decls.adb')
-rw-r--r-- | src/synth/synth-decls.adb | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index 9e0ce30c1..378921c45 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -21,6 +21,7 @@ with Types; use Types; with Mutils; use Mutils; +with Netlists; use Netlists; with Netlists.Builders; use Netlists.Builders; with Netlists.Folds; use Netlists.Folds; with Netlists.Utils; use Netlists.Utils; @@ -218,7 +219,7 @@ package body Synth.Decls is Synth_Record_Elements_Definition (Syn_Inst, Def); Typ := Synth_Record_Type_Definition (Syn_Inst, Def); when Iir_Kind_Protected_Type_Declaration => - Synth_Declarations (Syn_Inst, Get_Declaration_Chain (Def), No_Net); + Synth_Declarations (Syn_Inst, Get_Declaration_Chain (Def)); when others => Vhdl.Errors.Error_Kind ("synth_type_definition", Def); end case; @@ -465,7 +466,6 @@ package body Synth.Decls is procedure Synth_Constant_Declaration (Syn_Inst : Synth_Instance_Acc; Decl : Node; - En : Net; Is_Subprg : Boolean; Last_Type : in out Node) is @@ -512,7 +512,7 @@ package body Synth.Decls is end if; Obj_Type := Get_Subtype_Object (Syn_Inst, Decl_Type); Val := Synth_Expression_With_Type - (Syn_Inst, Get_Default_Value (Decl), Obj_Type, En); + (Syn_Inst, Get_Default_Value (Decl), Obj_Type); if Val = No_Valtyp then Set_Error (Syn_Inst); return; @@ -542,7 +542,7 @@ package body Synth.Decls is end Synth_Constant_Declaration; procedure Synth_Attribute_Specification - (Syn_Inst : Synth_Instance_Acc; Spec : Node; En : Net) + (Syn_Inst : Synth_Instance_Acc; Spec : Node) is Decl : constant Node := Get_Attribute_Designator (Spec); Value : Iir_Attribute_Value; @@ -562,7 +562,7 @@ package body Synth.Decls is -- unless the attribute's subtype indication denotes an -- unconstrained array type. Val := Synth_Expression_With_Type - (Syn_Inst, Get_Expression (Spec), Val_Type, En); + (Syn_Inst, Get_Expression (Spec), Val_Type); -- Check_Constraints (Instance, Val, Attr_Type, Decl); -- 3. A new instance of the designated attribute is created @@ -624,7 +624,7 @@ package body Synth.Decls is end Create_Package_Instance; procedure Synth_Package_Declaration - (Parent_Inst : Synth_Instance_Acc; Pkg : Node; En : Net) + (Parent_Inst : Synth_Instance_Acc; Pkg : Node) is Syn_Inst : Synth_Instance_Acc; begin @@ -635,14 +635,14 @@ package body Synth.Decls is Syn_Inst := Create_Package_Instance (Parent_Inst, Pkg); - Synth_Declarations (Syn_Inst, Get_Declaration_Chain (Pkg), En); + Synth_Declarations (Syn_Inst, Get_Declaration_Chain (Pkg)); if Pkg = Vhdl.Std_Package.Standard_Package then Synth_Convertible_Declarations (Syn_Inst); end if; end Synth_Package_Declaration; procedure Synth_Package_Body - (Parent_Inst : Synth_Instance_Acc; Pkg : Node; Bod : Node; En : Net) + (Parent_Inst : Synth_Instance_Acc; Pkg : Node; Bod : Node) is Pkg_Inst : Synth_Instance_Acc; begin @@ -653,14 +653,13 @@ package body Synth.Decls is Pkg_Inst := Get_Package_Object (Parent_Inst, Pkg); - Synth_Declarations (Pkg_Inst, Get_Declaration_Chain (Bod), En); + Synth_Declarations (Pkg_Inst, Get_Declaration_Chain (Bod)); end Synth_Package_Body; procedure Synth_Generics_Association (Sub_Inst : Synth_Instance_Acc; Syn_Inst : Synth_Instance_Acc; Inter_Chain : Node; - Assoc_Chain : Node; - En : Net) + Assoc_Chain : Node) is Ctxt : constant Context_Acc := Get_Build (Syn_Inst); Inter : Node; @@ -683,11 +682,11 @@ package body Synth.Decls is when Iir_Kind_Association_Element_Open => Actual := Get_Default_Value (Inter); Val := Synth_Expression_With_Type - (Sub_Inst, Actual, Inter_Type, En); + (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, En); + (Syn_Inst, Actual, Inter_Type); when others => raise Internal_Error; end case; @@ -703,7 +702,7 @@ package body Synth.Decls is end Synth_Generics_Association; procedure Synth_Package_Instantiation - (Parent_Inst : Synth_Instance_Acc; Pkg : Node; En : Net) + (Parent_Inst : Synth_Instance_Acc; Pkg : Node) is Bod : constant Node := Get_Instance_Package_Body (Pkg); Sub_Inst : Synth_Instance_Acc; @@ -712,9 +711,9 @@ package body Synth.Decls is Synth_Generics_Association (Sub_Inst, Parent_Inst, - Get_Generic_Chain (Pkg), Get_Generic_Map_Aspect_Chain (Pkg), En); + Get_Generic_Chain (Pkg), Get_Generic_Map_Aspect_Chain (Pkg)); - Synth_Declarations (Sub_Inst, Get_Declaration_Chain (Pkg), En); + Synth_Declarations (Sub_Inst, Get_Declaration_Chain (Pkg)); if Bod /= Null_Node then -- Macro expended package instantiation. @@ -729,7 +728,7 @@ package body Synth.Decls is -- Synth declarations of (optional) body. if Uninst_Bod /= Null_Node then Synth_Declarations - (Sub_Inst, Get_Declaration_Chain (Uninst_Bod), En); + (Sub_Inst, Get_Declaration_Chain (Uninst_Bod)); end if; end; end if; @@ -737,7 +736,6 @@ package body Synth.Decls is procedure Synth_Variable_Declaration (Syn_Inst : Synth_Instance_Acc; Decl : Node; - En : Net; Is_Subprg : Boolean) is Ctxt : constant Context_Acc := Get_Build (Syn_Inst); @@ -766,7 +764,7 @@ package body Synth.Decls is Create_Object (Syn_Inst, Decl, Create_Value_Default (Obj_Typ)); else if Is_Valid (Def) then - Init := Synth_Expression_With_Type (Syn_Inst, Def, Obj_Typ, En); + Init := Synth_Expression_With_Type (Syn_Inst, Def, Obj_Typ); Init := Synth_Subtype_Conversion (Ctxt, Init, Obj_Typ, False, Decl); if not Is_Subprg @@ -810,7 +808,7 @@ package body Synth.Decls is Create_Wire_Object (Syn_Inst, Wire_Signal, Decl); if Is_Valid (Def) then Obj_Typ := Get_Subtype_Object (Syn_Inst, Get_Type (Decl)); - Init := Synth_Expression_With_Type (Syn_Inst, Def, Obj_Typ, No_Net); + Init := Synth_Expression_With_Type (Syn_Inst, Def, Obj_Typ); Init := Synth_Subtype_Conversion (Ctxt, Init, Obj_Typ, False, Decl); if not Is_Static (Init.Val) then Error_Msg_Synth (+Decl, "signals cannot be used in default value " @@ -823,7 +821,7 @@ package body Synth.Decls is end Synth_Signal_Declaration; procedure Synth_Object_Alias_Declaration - (Syn_Inst : Synth_Instance_Acc; Decl : Node; En : Net) + (Syn_Inst : Synth_Instance_Acc; Decl : Node) is Ctxt : constant Context_Acc := Get_Build (Syn_Inst); Atype : constant Node := Get_Declaration_Type (Decl); @@ -842,7 +840,7 @@ package body Synth.Decls is Obj_Typ := null; end if; - Stmts.Synth_Assignment_Prefix (Syn_Inst, Get_Name (Decl), En, + Stmts.Synth_Assignment_Prefix (Syn_Inst, Get_Name (Decl), Base, Typ, Off, Dyn); pragma Assert (Dyn.Voff = No_Net); if Base.Val.Kind = Value_Net then @@ -862,26 +860,23 @@ package body Synth.Decls is procedure Synth_Declaration (Syn_Inst : Synth_Instance_Acc; Decl : Node; - En : Net; Is_Subprg : Boolean; Last_Type : in out Node) is begin case Get_Kind (Decl) is when Iir_Kind_Variable_Declaration => - Synth_Variable_Declaration (Syn_Inst, Decl, En, Is_Subprg); + Synth_Variable_Declaration (Syn_Inst, Decl, Is_Subprg); when Iir_Kind_Interface_Variable_Declaration => -- Ignore default value. Create_Wire_Object (Syn_Inst, Wire_Variable, Decl); Create_Var_Wire (Syn_Inst, Decl, No_Valtyp); when Iir_Kind_Constant_Declaration => - Synth_Constant_Declaration - (Syn_Inst, Decl, En, Is_Subprg, Last_Type); + Synth_Constant_Declaration (Syn_Inst, Decl, Is_Subprg, Last_Type); when Iir_Kind_Signal_Declaration => pragma Assert (not Is_Subprg); - pragma Assert (En = No_Net); Synth_Signal_Declaration (Syn_Inst, Decl); when Iir_Kind_Object_Alias_Declaration => - Synth_Object_Alias_Declaration (Syn_Inst, Decl, En); + Synth_Object_Alias_Declaration (Syn_Inst, Decl); when Iir_Kind_Anonymous_Signal_Declaration => -- Anonymous signals created by inertial associations are -- simply ignored. @@ -899,7 +894,7 @@ package body Synth.Decls is -- indication. null; when Iir_Kind_Attribute_Specification => - Synth_Attribute_Specification (Syn_Inst, Decl, En); + Synth_Attribute_Specification (Syn_Inst, Decl); when Iir_Kind_Type_Declaration => Synth_Type_Definition (Syn_Inst, Get_Type_Definition (Decl)); when Iir_Kind_Anonymous_Type_Declaration => @@ -941,7 +936,6 @@ package body Synth.Decls is procedure Synth_Declarations (Syn_Inst : Synth_Instance_Acc; Decls : Iir; - En : Net; Is_Subprg : Boolean := False) is Decl : Node; @@ -950,7 +944,7 @@ package body Synth.Decls is Last_Type := Null_Node; Decl := Decls; while Is_Valid (Decl) loop - Synth_Declaration (Syn_Inst, Decl, En, Is_Subprg, Last_Type); + Synth_Declaration (Syn_Inst, Decl, Is_Subprg, Last_Type); exit when Is_Error (Syn_Inst); |