aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-stmts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-01 09:01:46 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-01 09:01:46 +0200
commite98cc23b32e85d7f31ca6427d40c33df70749238 (patch)
treed8b3e8c28c7d63881008f037a0fa27b72e8111cb /src/synth/synth-stmts.adb
parent6125f32b1f89408d1dd016e3cd6bb79d4e1f8b7e (diff)
downloadghdl-e98cc23b32e85d7f31ca6427d40c33df70749238.tar.gz
ghdl-e98cc23b32e85d7f31ca6427d40c33df70749238.tar.bz2
ghdl-e98cc23b32e85d7f31ca6427d40c33df70749238.zip
synth-stmts: reduce use of global context.
Diffstat (limited to 'src/synth/synth-stmts.adb')
-rw-r--r--src/synth/synth-stmts.adb21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index 2cfaf8dcf..c2e923c65 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -2155,6 +2155,7 @@ package body Synth.Stmts is
procedure Synth_Dynamic_Exit_Next_Statement
(C : in out Seq_Context; Stmt : Node)
is
+ Ctxt : constant Context_Acc := Get_Build (C.Inst);
Cond : constant Node := Get_Condition (Stmt);
Is_Exit : constant Boolean := Get_Kind (Stmt) = Iir_Kind_Exit_Statement;
Static_Cond : Boolean;
@@ -2179,7 +2180,7 @@ package body Synth.Stmts is
end if;
-- Execution is suspended for the current loop.
- Phi_Assign_Net (Get_Build (C.Inst), C.W_En, Get_Inst_Bit0 (C.Inst), 0);
+ Phi_Assign_Net (Ctxt, C.W_En, Get_Inst_Bit0 (C.Inst), 0);
Lc := C.Cur_Loop;
@@ -2197,13 +2198,11 @@ package body Synth.Stmts is
if Lc.Loop_Stmt = Loop_Label then
-- Final loop.
if Is_Exit then
- Phi_Assign_Net (Get_Build (C.Inst),
- Lc.W_Exit, Get_Inst_Bit0 (C.Inst), 0);
+ Phi_Assign_Net (Ctxt, Lc.W_Exit, Get_Inst_Bit0 (C.Inst), 0);
end if;
exit;
else
- Phi_Assign_Net (Get_Build (C.Inst),
- Lc.W_Quit, Get_Inst_Bit0 (C.Inst), 0);
+ Phi_Assign_Net (Ctxt, Lc.W_Quit, Get_Inst_Bit0 (C.Inst), 0);
end if;
Lc := Lc.Prev_Loop;
end loop;
@@ -2215,8 +2214,7 @@ package body Synth.Stmts is
Push_Phi;
Pop_Phi (Phi_False);
- Merge_Phis (Build_Context,
- Get_Net (Cond_Val), Phi_True, Phi_False, Stmt);
+ Merge_Phis (Ctxt, Get_Net (Cond_Val), Phi_True, Phi_False, Stmt);
end if;
end Synth_Dynamic_Exit_Next_Statement;
@@ -2518,8 +2516,7 @@ package body Synth.Stmts is
C.Nbr_Ret := C.Nbr_Ret + 1;
end Synth_Return_Statement;
- procedure Synth_Static_Report
- (C : in out Seq_Context; Stmt : Node)
+ procedure Synth_Static_Report (C : Seq_Context; Stmt : Node)
is
use Simple_IO;
@@ -2582,14 +2579,12 @@ package body Synth.Stmts is
Put_Line_Err (Value_To_String (Rep));
end Synth_Static_Report;
- procedure Synth_Static_Report_Statement
- (C : in out Seq_Context; Stmt : Node) is
+ procedure Synth_Static_Report_Statement (C : Seq_Context; Stmt : Node) is
begin
Synth_Static_Report (C, Stmt);
end Synth_Static_Report_Statement;
- procedure Synth_Static_Assertion_Statement
- (C : in out Seq_Context; Stmt : Node)
+ procedure Synth_Static_Assertion_Statement (C : Seq_Context; Stmt : Node)
is
Cond : Valtyp;
begin