aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-stmts.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth/synth-stmts.adb')
-rw-r--r--src/synth/synth-stmts.adb226
1 files changed, 99 insertions, 127 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index 10261bfa6..cfb632f53 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -68,8 +68,7 @@ package body Synth.Stmts is
function Synth_Waveform (Syn_Inst : Synth_Instance_Acc;
Wf : Node;
- Targ_Type : Type_Acc;
- En : Net) return Valtyp is
+ Targ_Type : Type_Acc) return Valtyp is
begin
if Get_Kind (Wf) = Iir_Kind_Unaffected_Waveform then
-- TODO
@@ -84,16 +83,15 @@ package body Synth.Stmts is
null;
end if;
if Targ_Type = null then
- return Synth_Expression (Syn_Inst, Get_We_Value (Wf), En);
+ return Synth_Expression (Syn_Inst, Get_We_Value (Wf));
else
return Synth_Expression_With_Type
- (Syn_Inst, Get_We_Value (Wf), Targ_Type, En);
+ (Syn_Inst, Get_We_Value (Wf), Targ_Type);
end if;
end Synth_Waveform;
procedure Synth_Assignment_Prefix (Syn_Inst : Synth_Instance_Acc;
Pfx : Node;
- En : Net;
Dest_Base : out Valtyp;
Dest_Typ : out Type_Acc;
Dest_Off : out Value_Offsets;
@@ -101,7 +99,7 @@ package body Synth.Stmts is
begin
case Get_Kind (Pfx) is
when Iir_Kind_Simple_Name =>
- Synth_Assignment_Prefix (Syn_Inst, Get_Named_Entity (Pfx), En,
+ Synth_Assignment_Prefix (Syn_Inst, Get_Named_Entity (Pfx),
Dest_Base, Dest_Typ, Dest_Off, Dest_Dyn);
when Iir_Kind_Interface_Signal_Declaration
| Iir_Kind_Variable_Declaration
@@ -129,7 +127,7 @@ package body Synth.Stmts is
end if;
end;
when Iir_Kind_Function_Call =>
- Dest_Base := Synth_Expression (Syn_Inst, Pfx, En);
+ Dest_Base := Synth_Expression (Syn_Inst, Pfx);
Dest_Typ := Dest_Base.Typ;
Dest_Off := (0, 0);
Dest_Dyn := No_Dyn_Name;
@@ -140,10 +138,10 @@ package body Synth.Stmts is
Off : Value_Offsets;
begin
Synth_Assignment_Prefix
- (Syn_Inst, Get_Prefix (Pfx), En,
+ (Syn_Inst, Get_Prefix (Pfx),
Dest_Base, Dest_Typ, Dest_Off, Dest_Dyn);
Strip_Const (Dest_Base);
- Synth_Indexed_Name (Syn_Inst, Pfx, En, Dest_Typ, Voff, Off);
+ Synth_Indexed_Name (Syn_Inst, Pfx, Dest_Typ, Voff, Off);
if Voff = No_Net then
-- Static index.
@@ -178,7 +176,7 @@ package body Synth.Stmts is
Get_Element_Position (Get_Named_Entity (Pfx));
begin
Synth_Assignment_Prefix
- (Syn_Inst, Get_Prefix (Pfx), En,
+ (Syn_Inst, Get_Prefix (Pfx),
Dest_Base, Dest_Typ, Dest_Off, Dest_Dyn);
Dest_Off.Net_Off :=
Dest_Off.Net_Off + Dest_Typ.Rec.E (Idx + 1).Boff;
@@ -197,12 +195,12 @@ package body Synth.Stmts is
Sl_Off : Value_Offsets;
begin
Synth_Assignment_Prefix
- (Syn_Inst, Get_Prefix (Pfx), En,
+ (Syn_Inst, Get_Prefix (Pfx),
Dest_Base, Dest_Typ, Dest_Off, Dest_Dyn);
Strip_Const (Dest_Base);
Get_Onedimensional_Array_Bounds (Dest_Typ, Pfx_Bnd, El_Typ);
- Synth_Slice_Suffix (Syn_Inst, Pfx, En, Pfx_Bnd, El_Typ,
+ Synth_Slice_Suffix (Syn_Inst, Pfx, Pfx_Bnd, El_Typ,
Res_Bnd, Sl_Voff, Sl_Off);
@@ -236,7 +234,7 @@ package body Synth.Stmts is
when Iir_Kind_Implicit_Dereference
| Iir_Kind_Dereference =>
Synth_Assignment_Prefix
- (Syn_Inst, Get_Prefix (Pfx), En,
+ (Syn_Inst, Get_Prefix (Pfx),
Dest_Base, Dest_Typ, Dest_Off, Dest_Dyn);
if Dest_Off /= (0, 0) and then Dest_Dyn.Voff /= No_Net then
raise Internal_Error;
@@ -354,8 +352,7 @@ package body Synth.Stmts is
end Synth_Aggregate_Target_Type;
function Synth_Target (Syn_Inst : Synth_Instance_Acc;
- Target : Node;
- En : Net) return Target_Info is
+ Target : Node) return Target_Info is
begin
case Get_Kind (Target) is
when Iir_Kind_Aggregate =>
@@ -379,8 +376,7 @@ package body Synth.Stmts is
Dyn : Dyn_Name;
begin
- Synth_Assignment_Prefix
- (Syn_Inst, Target, En, Base, Typ, Off, Dyn);
+ Synth_Assignment_Prefix (Syn_Inst, Target, Base, Typ, Off, Dyn);
if Dyn.Voff = No_Net then
-- FIXME: check index.
return Target_Info'(Kind => Target_Simple,
@@ -403,8 +399,7 @@ package body Synth.Stmts is
procedure Synth_Assignment (Syn_Inst : Synth_Instance_Acc;
Target : Target_Info;
Val : Valtyp;
- Loc : Node;
- En : Net);
+ Loc : Node);
-- Extract a part of VAL from a target aggregate at offset OFF (offset
-- in the array).
@@ -448,8 +443,7 @@ package body Synth.Stmts is
Target : Node;
Target_Typ : Type_Acc;
Val : Valtyp;
- Loc : Node;
- En : Net)
+ Loc : Node)
is
Ctxt : constant Context_Acc := Get_Build (Syn_Inst);
Targ_Bnd : constant Bound_Type := Get_Array_Bound (Target_Typ, 1);
@@ -464,7 +458,7 @@ package body Synth.Stmts is
Assoc := Get_Associated_Expr (Choice);
case Get_Kind (Choice) is
when Iir_Kind_Choice_By_None =>
- Targ_Info := Synth_Target (Syn_Inst, Assoc, En);
+ Targ_Info := Synth_Target (Syn_Inst, Assoc);
if Get_Element_Type_Flag (Choice) then
Pos := Pos - 1;
else
@@ -474,7 +468,7 @@ package body Synth.Stmts is
(Syn_Inst, Targ_Info,
Aggregate_Extract (Ctxt, Val, Pos,
Targ_Info.Targ_Type, Assoc),
- Loc, En);
+ Loc);
when others =>
Error_Kind ("synth_assignment_aggregate", Choice);
end case;
@@ -485,8 +479,7 @@ package body Synth.Stmts is
procedure Synth_Assignment (Syn_Inst : Synth_Instance_Acc;
Target : Target_Info;
Val : Valtyp;
- Loc : Node;
- En : Net)
+ Loc : Node)
is
Ctxt : constant Context_Acc := Get_Build (Syn_Inst);
V : Valtyp;
@@ -501,7 +494,7 @@ package body Synth.Stmts is
case Target.Kind is
when Target_Aggregate =>
Synth_Assignment_Aggregate
- (Syn_Inst, Target.Aggr, Target.Targ_Type, V, Loc, En);
+ (Syn_Inst, Target.Aggr, Target.Targ_Type, V, Loc);
when Target_Simple =>
if V.Typ.Sz = 0 then
-- If there is nothing to assign (like a null slice),
@@ -555,13 +548,12 @@ package body Synth.Stmts is
procedure Synth_Assignment (Syn_Inst : Synth_Instance_Acc;
Target : Node;
Val : Valtyp;
- Loc : Node;
- En : Net)
+ Loc : Node)
is
Info : Target_Info;
begin
- Info := Synth_Target (Syn_Inst, Target, En);
- Synth_Assignment (Syn_Inst, Info, Val, Loc, En);
+ Info := Synth_Target (Syn_Inst, Target);
+ Synth_Assignment (Syn_Inst, Info, Val, Loc);
end Synth_Assignment;
function Synth_Read_Memory (Syn_Inst : Synth_Instance_Acc;
@@ -610,19 +602,19 @@ package body Synth.Stmts is
-- Concurrent or sequential simple signal assignment
procedure Synth_Simple_Signal_Assignment
- (Syn_Inst : Synth_Instance_Acc; Stmt : Node; En : Net)
+ (Syn_Inst : Synth_Instance_Acc; Stmt : Node)
is
Targ : Target_Info;
Val : Valtyp;
begin
- Targ := Synth_Target (Syn_Inst, Get_Target (Stmt), En);
+ Targ := Synth_Target (Syn_Inst, Get_Target (Stmt));
Val := Synth_Waveform
- (Syn_Inst, Get_Waveform_Chain (Stmt), Targ.Targ_Type, En);
- Synth_Assignment (Syn_Inst, Targ, Val, Stmt, En);
+ (Syn_Inst, Get_Waveform_Chain (Stmt), Targ.Targ_Type);
+ Synth_Assignment (Syn_Inst, Targ, Val, Stmt);
end Synth_Simple_Signal_Assignment;
procedure Synth_Conditional_Signal_Assignment
- (Syn_Inst : Synth_Instance_Acc; Stmt : Node; En : Net)
+ (Syn_Inst : Synth_Instance_Acc; Stmt : Node)
is
Ctxt : constant Context_Acc := Get_Build (Syn_Inst);
Targ : Target_Info;
@@ -634,13 +626,13 @@ package body Synth.Stmts is
First, Last : Net;
V : Net;
begin
- Targ := Synth_Target (Syn_Inst, Get_Target (Stmt), En);
+ Targ := Synth_Target (Syn_Inst, Get_Target (Stmt));
Last := No_Net;
Cwf := Get_Conditional_Waveform_Chain (Stmt);
Cond := Null_Node;
while Cwf /= Null_Node loop
Val := Synth_Waveform
- (Syn_Inst, Get_Waveform_Chain (Cwf), Targ.Targ_Type, En);
+ (Syn_Inst, Get_Waveform_Chain (Cwf), Targ.Targ_Type);
if Val = No_Valtyp then
-- Mark the error, but try to continue.
Set_Error (Syn_Inst);
@@ -648,7 +640,7 @@ package body Synth.Stmts is
V := Get_Net (Ctxt, Val);
Cond := Get_Condition (Cwf);
if Cond /= Null_Node then
- Cond_Val := Synth_Expression (Syn_Inst, Cond, En);
+ Cond_Val := Synth_Expression (Syn_Inst, Cond);
if Cond_Val = No_Valtyp then
Cond_Net := Build_Const_UB32 (Ctxt, 0, 1);
else
@@ -679,23 +671,22 @@ package body Synth.Stmts is
end if;
end if;
Val := Create_Value_Net (First, Targ.Targ_Type);
- Synth_Assignment (Syn_Inst, Targ, Val, Stmt, En);
+ Synth_Assignment (Syn_Inst, Targ, Val, Stmt);
end Synth_Conditional_Signal_Assignment;
procedure Synth_Variable_Assignment (C : Seq_Context; Stmt : Node)
is
- En : constant Net := No_Net;
Targ : Target_Info;
Val : Valtyp;
begin
- Targ := Synth_Target (C.Inst, Get_Target (Stmt), En);
+ Targ := Synth_Target (C.Inst, Get_Target (Stmt));
Val := Synth_Expression_With_Type
- (C.Inst, Get_Expression (Stmt), Targ.Targ_Type, En);
+ (C.Inst, Get_Expression (Stmt), Targ.Targ_Type);
if Val = No_Valtyp then
Set_Error (C.Inst);
return;
end if;
- Synth_Assignment (C.Inst, Targ, Val, Stmt, En);
+ Synth_Assignment (C.Inst, Targ, Val, Stmt);
end Synth_Variable_Assignment;
procedure Synth_Conditional_Variable_Assignment
@@ -703,7 +694,6 @@ package body Synth.Stmts is
is
Ctxt : constant Context_Acc := Get_Build (C.Inst);
Target : constant Node := Get_Target (Stmt);
- En : constant Net := No_Net;
Targ_Type : Type_Acc;
Cond : Node;
Ce : Node;
@@ -716,11 +706,11 @@ package body Synth.Stmts is
Ce := Get_Conditional_Expression_Chain (Stmt);
while Ce /= Null_Node loop
Val := Synth_Expression_With_Type
- (C.Inst, Get_Expression (Ce), Targ_Type, En);
+ (C.Inst, Get_Expression (Ce), Targ_Type);
V := Get_Net (Ctxt, Val);
Cond := Get_Condition (Ce);
if Cond /= Null_Node then
- Cond_Val := Synth_Expression (C.Inst, Cond, En);
+ Cond_Val := Synth_Expression (C.Inst, Cond);
V := Build_Mux2 (Ctxt, Get_Net (Ctxt, Cond_Val), No_Net, V);
Set_Location (V, Ce);
end if;
@@ -734,7 +724,7 @@ package body Synth.Stmts is
Ce := Get_Chain (Ce);
end loop;
Val := Create_Value_Net (First, Targ_Type);
- Synth_Assignment (C.Inst, Target, Val, Stmt, En);
+ Synth_Assignment (C.Inst, Target, Val, Stmt);
end Synth_Conditional_Variable_Assignment;
procedure Synth_If_Statement (C : in out Seq_Context; Stmt : Node)
@@ -747,7 +737,7 @@ package body Synth.Stmts is
Phi_True : Phi_Type;
Phi_False : Phi_Type;
begin
- Cond_Val := Synth_Expression (C.Inst, Cond, No_Net);
+ Cond_Val := Synth_Expression (C.Inst, Cond);
if Cond_Val = No_Valtyp then
Set_Error (C.Inst);
return;
@@ -800,15 +790,15 @@ package body Synth.Stmts is
end Synth_If_Statement;
-- EXPR is a choice, so a locally static literal.
- function Convert_To_Uns64
- (Syn_Inst : Synth_Instance_Acc; Expr : Node; En : Net) return Uns64
+ function Convert_To_Uns64 (Syn_Inst : Synth_Instance_Acc; Expr : Node)
+ return Uns64
is
Expr_Val : Valtyp;
Vec : Logvec_Array (0 .. 1);
Off : Uns32;
Has_Zx : Boolean;
begin
- Expr_Val := Synth_Expression_With_Basetype (Syn_Inst, Expr, En);
+ Expr_Val := Synth_Expression_With_Basetype (Syn_Inst, Expr);
Off := 0;
Has_Zx := False;
Vec := (others => (0, 0));
@@ -1008,8 +998,7 @@ package body Synth.Stmts is
Annex_Arr (Choice_Idx) := Int32 (Choice_Idx);
Choice_Data (Choice_Idx) :=
(Val => Convert_To_Uns64 (C.Inst,
- Get_Choice_Expression (Choice),
- No_Net),
+ Get_Choice_Expression (Choice)),
Alt => Alt_Idx);
when Iir_Kind_Choice_By_Others =>
Others_Alt_Idx := Alt_Idx;
@@ -1163,8 +1152,7 @@ package body Synth.Stmts is
case Get_Kind (Choice) is
when Iir_Kind_Choice_By_Expression =>
Sel_Expr := Get_Choice_Expression (Choice);
- Sel_Val := Synth_Expression_With_Basetype
- (C.Inst, Sel_Expr, No_Net);
+ Sel_Val := Synth_Expression_With_Basetype (C.Inst, Sel_Expr);
if Is_Equal (Sel_Val, Sel) then
Synth_Sequential_Statements (C, Stmts);
exit;
@@ -1236,7 +1224,7 @@ package body Synth.Stmts is
Expr : constant Node := Get_Expression (Stmt);
Sel : Valtyp;
begin
- Sel := Synth_Expression_With_Basetype (C.Inst, Expr, No_Net);
+ Sel := Synth_Expression_With_Basetype (C.Inst, Expr);
Strip_Const (Sel);
if Is_Static (Sel.Val) then
case Sel.Typ.Kind is
@@ -1257,7 +1245,7 @@ package body Synth.Stmts is
end Synth_Case_Statement;
procedure Synth_Selected_Signal_Assignment
- (Syn_Inst : Synth_Instance_Acc; Stmt : Node; En : Net)
+ (Syn_Inst : Synth_Instance_Acc; Stmt : Node)
is
use Vhdl.Sem_Expr;
Ctxt : constant Context_Acc := Get_Build (Syn_Inst);
@@ -1286,11 +1274,11 @@ package body Synth.Stmts is
Sel : Valtyp;
Sel_Net : Net;
begin
- Targ := Synth_Target (Syn_Inst, Get_Target (Stmt), En);
+ Targ := Synth_Target (Syn_Inst, Get_Target (Stmt));
Targ_Type := Targ.Targ_Type;
-- Create a net for the expression.
- Sel := Synth_Expression_With_Basetype (Syn_Inst, Expr, En);
+ Sel := Synth_Expression_With_Basetype (Syn_Inst, Expr);
-- Count choices and alternatives.
Count_Choices (Case_Info, Choices);
@@ -1316,7 +1304,7 @@ package body Synth.Stmts is
Alts (Alt_Idx).Val := Get_Net
(Ctxt, Synth_Waveform
- (Syn_Inst, Get_Associated_Chain (Choice), Targ_Type, En));
+ (Syn_Inst, Get_Associated_Chain (Choice), Targ_Type));
end if;
case Get_Kind (Choice) is
@@ -1325,8 +1313,7 @@ package body Synth.Stmts is
Annex_Arr (Choice_Idx) := Int32 (Choice_Idx);
Choice_Data (Choice_Idx) :=
(Val => Convert_To_Uns64 (Syn_Inst,
- Get_Choice_Expression (Choice),
- No_Net),
+ Get_Choice_Expression (Choice)),
Alt => Alt_Idx);
when Iir_Kind_Choice_By_Others =>
Others_Alt_Idx := Alt_Idx;
@@ -1375,7 +1362,7 @@ package body Synth.Stmts is
Sel_Net, Case_El.all, Default, Res,
Get_Location (Expr));
Synth_Assignment
- (Syn_Inst, Targ, Create_Value_Net (Res, Targ_Type), Stmt, En);
+ (Syn_Inst, Targ, Create_Value_Net (Res, Targ_Type), Stmt);
end;
-- free.
@@ -1570,7 +1557,6 @@ package body Synth.Stmts is
procedure Synth_Subprogram_Association (Subprg_Inst : Synth_Instance_Acc;
Caller_Inst : Synth_Instance_Acc;
- En : Net;
Init : Association_Iterator_Init;
Infos : out Target_Info_Array)
is
@@ -1604,7 +1590,7 @@ package body Synth.Stmts is
then
Actual := Get_Default_Value (Inter);
Val := Synth_Expression_With_Type
- (Subprg_Inst, Actual, Inter_Type, En);
+ (Subprg_Inst, Actual, Inter_Type);
else
if Get_Kind (Assoc) =
Iir_Kind_Association_Element_By_Expression
@@ -1614,11 +1600,11 @@ package body Synth.Stmts is
Actual := Assoc;
end if;
Val := Synth_Expression_With_Type
- (Caller_Inst, Actual, Inter_Type, En);
+ (Caller_Inst, Actual, Inter_Type);
end if;
when Iir_Out_Mode | Iir_Inout_Mode =>
Actual := Get_Actual (Assoc);
- Info := Synth_Target (Caller_Inst, Actual, En);
+ Info := Synth_Target (Caller_Inst, Actual);
case Iir_Kinds_Interface_Object_Declaration (Get_Kind (Inter))
is
@@ -1692,15 +1678,14 @@ package body Synth.Stmts is
procedure Synth_Subprogram_Association (Subprg_Inst : Synth_Instance_Acc;
Caller_Inst : Synth_Instance_Acc;
Inter_Chain : Node;
- Assoc_Chain : Node;
- En : Net)
+ Assoc_Chain : Node)
is
Infos : Target_Info_Array (1 .. 0);
pragma Unreferenced (Infos);
Init : Association_Iterator_Init;
begin
Init := Association_Iterator_Build (Inter_Chain, Assoc_Chain);
- Synth_Subprogram_Association (Subprg_Inst, Caller_Inst, En, Init, Infos);
+ Synth_Subprogram_Association (Subprg_Inst, Caller_Inst, Init, Infos);
end Synth_Subprogram_Association;
-- Create wires for out and inout interface variables.
@@ -1738,7 +1723,6 @@ package body Synth.Stmts is
procedure Synth_Subprogram_Back_Association
(Subprg_Inst : Synth_Instance_Acc;
Caller_Inst : Synth_Instance_Acc;
- En : Net;
Init : Association_Iterator_Init;
Infos : Target_Info_Array)
is
@@ -1762,7 +1746,7 @@ package body Synth.Stmts is
end if;
Nbr_Inout := Nbr_Inout + 1;
Val := Get_Value (Subprg_Inst, Inter);
- Synth_Assignment (Caller_Inst, Infos (Nbr_Inout), Val, Assoc, En);
+ Synth_Assignment (Caller_Inst, Infos (Nbr_Inout), Val, Assoc);
-- Free wire used for out/inout interface variables.
if Val.Val.Kind = Value_Wire then
@@ -1791,7 +1775,6 @@ package body Synth.Stmts is
function Synth_Dynamic_Subprogram_Call (Syn_Inst : Synth_Instance_Acc;
Sub_Inst : Synth_Instance_Acc;
Call : Node;
- En : Net;
Init : Association_Iterator_Init;
Infos : Target_Info_Array)
return Valtyp
@@ -1847,7 +1830,7 @@ package body Synth.Stmts is
(C.W_Ret, Build_Control_Signal (Sub_Inst, 1, Imp));
Phi_Assign_Static (C.W_Ret, Bit1);
- Decls.Synth_Declarations (C.Inst, Get_Declaration_Chain (Bod), En, True);
+ Decls.Synth_Declarations (C.Inst, Get_Declaration_Chain (Bod), True);
if not Is_Error (C.Inst) then
Synth_Sequential_Statements (C, Get_Sequential_Statement_Chain (Bod));
end if;
@@ -1866,8 +1849,7 @@ package body Synth.Stmts is
end if;
else
Res := No_Valtyp;
- Synth_Subprogram_Back_Association
- (C.Inst, Syn_Inst, En, Init, Infos);
+ Synth_Subprogram_Back_Association (C.Inst, Syn_Inst, Init, Infos);
end if;
end if;
@@ -1923,7 +1905,7 @@ package body Synth.Stmts is
C.Ret_Typ := Get_Subtype_Object (Syn_Inst, Get_Return_Type (Imp));
end if;
- Synth_Declarations (C.Inst, Get_Declaration_Chain (Bod), No_Net, True);
+ Synth_Declarations (C.Inst, Get_Declaration_Chain (Bod), True);
if not Is_Error (C.Inst) then
Synth_Sequential_Statements (C, Get_Sequential_Statement_Chain (Bod));
@@ -1944,8 +1926,7 @@ package body Synth.Stmts is
end if;
else
Res := No_Valtyp;
- Synth_Subprogram_Back_Association
- (C.Inst, Syn_Inst, No_Net, Init, Infos);
+ Synth_Subprogram_Back_Association (C.Inst, Syn_Inst, Init, Infos);
end if;
end if;
@@ -1957,7 +1938,6 @@ package body Synth.Stmts is
function Synth_Subprogram_Call (Syn_Inst : Synth_Instance_Acc;
Call : Node;
- En : Net;
Init : Association_Iterator_Init)
return Valtyp
is
@@ -1978,7 +1958,7 @@ package body Synth.Stmts is
Sub_Inst := Make_Instance (Up_Inst, Bod, New_Internal_Name (Ctxt));
Set_Instance_Base (Sub_Inst, Syn_Inst);
- Synth_Subprogram_Association (Sub_Inst, Syn_Inst, En, Init, Infos);
+ Synth_Subprogram_Association (Sub_Inst, Syn_Inst, Init, Infos);
if Is_Error (Sub_Inst) then
Res := No_Valtyp;
@@ -1994,7 +1974,7 @@ package body Synth.Stmts is
(Syn_Inst, Sub_Inst, Call, Init, Infos);
else
Res := Synth_Dynamic_Subprogram_Call
- (Syn_Inst, Sub_Inst, Call, En, Init, Infos);
+ (Syn_Inst, Sub_Inst, Call, Init, Infos);
end if;
end if;
@@ -2014,7 +1994,7 @@ package body Synth.Stmts is
end Synth_Subprogram_Call;
function Synth_Subprogram_Call
- (Syn_Inst : Synth_Instance_Acc; Call : Node; En : Net) return Valtyp
+ (Syn_Inst : Synth_Instance_Acc; Call : Node) return Valtyp
is
Imp : constant Node := Get_Implementation (Call);
Assoc_Chain : constant Node := Get_Parameter_Association_Chain (Call);
@@ -2022,21 +2002,20 @@ package body Synth.Stmts is
Init : Association_Iterator_Init;
begin
Init := Association_Iterator_Build (Inter_Chain, Assoc_Chain);
- return Synth_Subprogram_Call (Syn_Inst, Call, En, Init);
+ return Synth_Subprogram_Call (Syn_Inst, Call, Init);
end Synth_Subprogram_Call;
function Synth_User_Operator (Syn_Inst : Synth_Instance_Acc;
Left_Expr : Node;
Right_Expr : Node;
- Expr : Node;
- En : Net) return Valtyp
+ Expr : Node) return Valtyp
is
Imp : constant Node := Get_Implementation (Expr);
Inter_Chain : constant Node := Get_Interface_Declaration_Chain (Imp);
Init : Association_Iterator_Init;
begin
Init := Association_Iterator_Build (Inter_Chain, Left_Expr, Right_Expr);
- return Synth_Subprogram_Call (Syn_Inst, Expr, En, Init);
+ return Synth_Subprogram_Call (Syn_Inst, Expr, Init);
end Synth_User_Operator;
procedure Synth_Implicit_Procedure_Call
@@ -2056,19 +2035,18 @@ package body Synth.Stmts is
Areapools.Mark (Area_Mark, Instance_Pool.all);
Sub_Inst := Make_Instance (Syn_Inst, Imp, New_Internal_Name (Ctxt));
- Synth_Subprogram_Association (Sub_Inst, Syn_Inst, No_Net, Init, Infos);
+ Synth_Subprogram_Association (Sub_Inst, Syn_Inst, Init, Infos);
Synth.Static_Proc.Synth_Static_Procedure (Sub_Inst, Imp, Call);
- Synth_Subprogram_Back_Association
- (Sub_Inst, Syn_Inst, No_Net, Init, Infos);
+ Synth_Subprogram_Back_Association (Sub_Inst, Syn_Inst, Init, Infos);
Free_Instance (Sub_Inst);
Areapools.Release (Area_Mark, Instance_Pool.all);
end Synth_Implicit_Procedure_Call;
procedure Synth_Procedure_Call
- (Syn_Inst : Synth_Instance_Acc; Stmt : Node; En : Net)
+ (Syn_Inst : Synth_Instance_Acc; Stmt : Node)
is
Call : constant Node := Get_Procedure_Call (Stmt);
Imp : constant Node := Get_Implementation (Call);
@@ -2080,7 +2058,7 @@ package body Synth.Stmts is
Error_Msg_Synth
(+Stmt, "call to foreign %n is not supported", +Imp);
else
- Res := Synth_Subprogram_Call (Syn_Inst, Call, En);
+ Res := Synth_Subprogram_Call (Syn_Inst, Call);
pragma Assert (Res = No_Valtyp);
end if;
when others =>
@@ -2274,7 +2252,7 @@ package body Synth.Stmts is
Phi_False : Phi_Type;
begin
if Cond /= Null_Node then
- Cond_Val := Synth_Expression (C.Inst, Cond, No_Net);
+ Cond_Val := Synth_Expression (C.Inst, Cond);
Static_Cond := Is_Static_Val (Cond_Val.Val);
if Static_Cond then
if Get_Static_Discrete (Cond_Val) = 0 then
@@ -2337,7 +2315,7 @@ package body Synth.Stmts is
Cond_Val : Valtyp;
begin
if Cond /= Null_Node then
- Cond_Val := Synth_Expression (C.Inst, Cond, No_Net);
+ Cond_Val := Synth_Expression (C.Inst, Cond);
if Cond_Val = No_Valtyp then
Set_Error (C.Inst);
return;
@@ -2498,8 +2476,7 @@ package body Synth.Stmts is
loop
if Cond /= Null_Node then
- Val := Synth_Expression_With_Type
- (C.Inst, Cond, Boolean_Type, No_Net);
+ Val := Synth_Expression_With_Type (C.Inst, Cond, Boolean_Type);
if not Is_Static (Val.Val) then
Error_Msg_Synth (+Cond, "loop condition must be static");
exit;
@@ -2546,8 +2523,7 @@ package body Synth.Stmts is
loop
if Cond /= Null_Node then
- Val := Synth_Expression_With_Type
- (C.Inst, Cond, Boolean_Type, No_Net);
+ Val := Synth_Expression_With_Type (C.Inst, Cond, Boolean_Type);
pragma Assert (Is_Static (Val.Val));
exit when Read_Discrete (Val) = 0;
end if;
@@ -2571,8 +2547,7 @@ package body Synth.Stmts is
begin
if Expr /= Null_Node then
-- Return in function.
- Val := Synth_Expression_With_Type
- (C.Inst, Expr, C.Ret_Typ, No_Net);
+ Val := Synth_Expression_With_Type (C.Inst, Expr, C.Ret_Typ);
if Val = No_Valtyp then
Set_Error (C.Inst);
return;
@@ -2624,7 +2599,7 @@ package body Synth.Stmts is
Sev_V : Natural;
begin
if Rep_Expr /= Null_Node then
- Rep := Synth_Expression_With_Basetype (C.Inst, Rep_Expr, No_Net);
+ Rep := Synth_Expression_With_Basetype (C.Inst, Rep_Expr);
if Rep = No_Valtyp then
Set_Error (C.Inst);
return;
@@ -2632,7 +2607,7 @@ package body Synth.Stmts is
Strip_Const (Rep);
end if;
if Sev_Expr /= Null_Node then
- Sev := Synth_Expression (C.Inst, Sev_Expr, No_Net);
+ Sev := Synth_Expression (C.Inst, Sev_Expr);
if Sev = No_Valtyp then
Set_Error (C.Inst);
return;
@@ -2683,8 +2658,7 @@ package body Synth.Stmts is
is
Cond : Valtyp;
begin
- Cond := Synth_Expression
- (C.Inst, Get_Assertion_Condition (Stmt), No_Net);
+ Cond := Synth_Expression (C.Inst, Get_Assertion_Condition (Stmt));
if Cond = No_Valtyp then
Set_Error (C.Inst);
return;
@@ -2706,8 +2680,7 @@ package body Synth.Stmts is
En : Net;
Inst : Instance;
begin
- Cond := Synth_Expression
- (C.Inst, Get_Assertion_Condition (Stmt), No_Net);
+ Cond := Synth_Expression (C.Inst, Get_Assertion_Condition (Stmt));
if Cond = No_Valtyp then
Set_Error (C.Inst);
return;
@@ -2762,9 +2735,9 @@ package body Synth.Stmts is
when Iir_Kind_If_Statement =>
Synth_If_Statement (C, Stmt);
when Iir_Kind_Simple_Signal_Assignment_Statement =>
- Synth_Simple_Signal_Assignment (C.Inst, Stmt, No_Net);
+ Synth_Simple_Signal_Assignment (C.Inst, Stmt);
when Iir_Kind_Conditional_Signal_Assignment_Statement =>
- Synth_Conditional_Signal_Assignment (C.Inst, Stmt, No_Net);
+ Synth_Conditional_Signal_Assignment (C.Inst, Stmt);
when Iir_Kind_Variable_Assignment_Statement =>
Synth_Variable_Assignment (C, Stmt);
when Iir_Kind_Conditional_Variable_Assignment_Statement =>
@@ -2789,7 +2762,7 @@ package body Synth.Stmts is
when Iir_Kind_Return_Statement =>
Synth_Return_Statement (C, Stmt);
when Iir_Kind_Procedure_Call_Statement =>
- Synth_Procedure_Call (C.Inst, Stmt, No_Net);
+ Synth_Procedure_Call (C.Inst, Stmt);
when Iir_Kind_Report_Statement =>
if not Is_Dyn then
Synth_Static_Report_Statement (C, Stmt);
@@ -2858,7 +2831,7 @@ package body Synth.Stmts is
Error_Msg_Synth (+Stmt, "expect wait condition");
return;
end if;
- Cond_Val := Synth_Expression (C.Inst, Cond, No_Net);
+ Cond_Val := Synth_Expression (C.Inst, Cond);
Push_Phi;
Synth_Sequential_Statements (C, Get_Chain (Stmt));
@@ -2897,12 +2870,11 @@ package body Synth.Stmts is
Ret_Typ => null,
Nbr_Ret => 0);
-
Mark (M, Proc_Pool);
Instance_Pool := Proc_Pool'Access;
if Is_Valid (Decls_Chain) then
- Synth_Declarations (C.Inst, Decls_Chain, No_Net);
+ Synth_Declarations (C.Inst, Decls_Chain);
end if;
Set_Wire_Gate (C.W_En, Build_Control_Signal (Syn_Inst, 1, Proc));
@@ -2925,7 +2897,7 @@ package body Synth.Stmts is
end Synth_Process_Statement;
function Synth_User_Function_Call
- (Syn_Inst : Synth_Instance_Acc; Expr : Node; En : Net) return Valtyp is
+ (Syn_Inst : Synth_Instance_Acc; Expr : Node) return Valtyp is
begin
-- Is it a call to an ieee function ?
declare
@@ -2950,7 +2922,7 @@ package body Synth.Stmts is
end if;
end;
- return Synth_Subprogram_Call (Syn_Inst, Expr, En);
+ return Synth_Subprogram_Call (Syn_Inst, Expr);
end Synth_User_Function_Call;
-- Report an assertion failure (that is known to failed).
@@ -2961,7 +2933,7 @@ package body Synth.Stmts is
Str : Valtyp;
begin
if Msg /= Null_Node then
- Str := Synth_Expression_With_Basetype (Syn_Inst, Msg, No_Net);
+ Str := Synth_Expression_With_Basetype (Syn_Inst, Msg);
else
Str := No_Valtyp;
end if;
@@ -2981,7 +2953,7 @@ package body Synth.Stmts is
Val : Valtyp;
Inst : Instance;
begin
- Val := Synth_Expression (Syn_Inst, Cond, No_Net);
+ Val := Synth_Expression (Syn_Inst, Cond);
if Val = No_Valtyp then
Set_Error (Syn_Inst);
return;
@@ -3019,7 +2991,7 @@ package body Synth.Stmts is
Mark (M, Proc_Pool);
Instance_Pool := Proc_Pool'Access;
- Synth_Declarations (Blk_Inst, Get_Declaration_Chain (Blk), No_Net);
+ Synth_Declarations (Blk_Inst, Get_Declaration_Chain (Blk));
Synth_Concurrent_Statements
(Blk_Inst, Get_Concurrent_Statement_Chain (Blk));
@@ -3043,7 +3015,7 @@ package body Synth.Stmts is
declare
E : constant Vhdl.Types.Vhdl_Node := Get_HDL_Node (Expr);
begin
- return Get_Net (Ctxt, Synth_Expression (Syn_Inst, E, No_Net));
+ return Get_Net (Ctxt, Synth_Expression (Syn_Inst, E));
end;
when N_Not_Bool =>
pragma Assert (Loc /= No_Location);
@@ -3335,7 +3307,7 @@ package body Synth.Stmts is
Create_Object (Bod_Inst, Iterator, Iterator_Val);
end if;
- Synth_Declarations (Bod_Inst, Decls_Chain, No_Net);
+ Synth_Declarations (Bod_Inst, Decls_Chain);
Synth_Concurrent_Statements
(Bod_Inst, Get_Concurrent_Statement_Chain (Bod));
@@ -3359,7 +3331,7 @@ package body Synth.Stmts is
loop
Icond := Get_Condition (Gen);
if Icond /= Null_Node then
- Cond := Synth_Expression (Syn_Inst, Icond, No_Net);
+ Cond := Synth_Expression (Syn_Inst, Icond);
Strip_Const (Cond);
else
-- It is the else generate.
@@ -3438,19 +3410,19 @@ package body Synth.Stmts is
case Get_Kind (Stmt) is
when Iir_Kind_Concurrent_Simple_Signal_Assignment =>
Push_Phi;
- Synth_Simple_Signal_Assignment (Syn_Inst, Stmt, No_Net);
+ Synth_Simple_Signal_Assignment (Syn_Inst, Stmt);
Pop_And_Merge_Phi (Ctxt, Stmt);
when Iir_Kind_Concurrent_Conditional_Signal_Assignment =>
Push_Phi;
- Synth_Conditional_Signal_Assignment (Syn_Inst, Stmt, No_Net);
+ Synth_Conditional_Signal_Assignment (Syn_Inst, Stmt);
Pop_And_Merge_Phi (Ctxt, Stmt);
when Iir_Kind_Concurrent_Selected_Signal_Assignment =>
Push_Phi;
- Synth_Selected_Signal_Assignment (Syn_Inst, Stmt, No_Net);
+ Synth_Selected_Signal_Assignment (Syn_Inst, Stmt);
Pop_And_Merge_Phi (Ctxt, Stmt);
when Iir_Kind_Concurrent_Procedure_Call_Statement =>
Push_Phi;
- Synth_Procedure_Call (Syn_Inst, Stmt, No_Net);
+ Synth_Procedure_Call (Syn_Inst, Stmt);
Pop_And_Merge_Phi (Ctxt, Stmt);
when Iir_Kinds_Process_Statement =>
Push_Phi;
@@ -3539,7 +3511,7 @@ package body Synth.Stmts is
-- The value must be true
V := Synth_Expression_With_Type
- (Syn_Inst, Get_Expression (Spec), Boolean_Type, No_Net);
+ (Syn_Inst, Get_Expression (Spec), Boolean_Type);
if Read_Discrete (V) /= 1 then
return;
end if;
@@ -3551,7 +3523,7 @@ package body Synth.Stmts is
Base : Valtyp;
Typ : Type_Acc;
begin
- Synth_Assignment_Prefix (Syn_Inst, Sig, No_Net, Base, Typ, Off, Dyn);
+ Synth_Assignment_Prefix (Syn_Inst, Sig, Base, Typ, Off, Dyn);
pragma Assert (Off = (0, 0));
pragma Assert (Dyn.Voff = No_Net);
pragma Assert (Base.Val.Kind = Value_Wire);
@@ -3629,7 +3601,7 @@ package body Synth.Stmts is
| Iir_Kind_Procedure_Body
| Iir_Kind_Attribute_Declaration
| Iir_Kind_Attribute_Specification =>
- Synth_Declaration (Unit_Inst, Item, No_Net, False, Last_Type);
+ Synth_Declaration (Unit_Inst, Item, False, Last_Type);
when Iir_Kind_Concurrent_Simple_Signal_Assignment =>
Synth_Concurrent_Statement (Unit_Inst, Item);
when others =>