aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-19 20:41:05 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-19 20:41:05 +0200
commitf47797b921b2b86189528a742e729675131d27e3 (patch)
tree3e515405d0773497bf148b17b53e9ff8de18821f
parentb800347e49af2337f6516ff9f34a839180df562a (diff)
downloadghdl-f47797b921b2b86189528a742e729675131d27e3.tar.gz
ghdl-f47797b921b2b86189528a742e729675131d27e3.tar.bz2
ghdl-f47797b921b2b86189528a742e729675131d27e3.zip
synth-stmts: add comments.
-rw-r--r--src/synth/synth-stmts.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index bfe9f64a1..234dbf922 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -2119,15 +2119,17 @@ package body Synth.Stmts is
return;
end if;
else
+ -- Create a branch for the True case.
Push_Phi;
end if;
end if;
- -- Execution is suspended.
+ -- Execution is suspended for the current loop.
Phi_Assign_Net (Get_Build (C.Inst), C.W_En, Get_Inst_Bit0 (C.Inst), 0);
Lc := C.Cur_Loop;
+ -- Compute the loop statement indicated by the exit/next statement.
Loop_Label := Get_Loop_Label (Stmt);
if Loop_Label = Null_Node then
Loop_Label := Lc.Loop_Stmt;
@@ -2135,8 +2137,11 @@ package body Synth.Stmts is
Loop_Label := Get_Named_Entity (Loop_Label);
end if;
+ -- Update the W_Exit and W_Quit flags for the loops. All the loops
+ -- until the label are canceled.
loop
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);
@@ -2151,8 +2156,11 @@ package body Synth.Stmts is
if Cond /= Null_Node and not Static_Cond then
Pop_Phi (Phi_True);
+
+ -- If the condition is false, do nothing.
Push_Phi;
Pop_Phi (Phi_False);
+
Merge_Phis (Build_Context,
Get_Net (Cond_Val), Phi_True, Phi_False, Stmt);
end if;