aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-10 20:33:49 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-10 20:33:57 +0100
commit2e50c44a48b74ecb7f5a14e4c4d0181cfa2d7402 (patch)
tree92828f1045ff2cc035cc755b825bb4bc9c1e6d58 /src
parentc7fc6185ae789e248c0752577ca44e6100616399 (diff)
downloadghdl-2e50c44a48b74ecb7f5a14e4c4d0181cfa2d7402.tar.gz
ghdl-2e50c44a48b74ecb7f5a14e4c4d0181cfa2d7402.tar.bz2
ghdl-2e50c44a48b74ecb7f5a14e4c4d0181cfa2d7402.zip
synth-stmts: handle conditional assignment without else
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-stmts.adb14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index 1f5230a35..935cc3b8b 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -566,6 +566,7 @@ package body Synth.Stmts is
Targ : Target_Info;
Cond : Node;
Cwf : Node;
+ Inp : Input;
Val, Cond_Val : Value_Acc;
First, Last : Net;
V : Net;
@@ -573,6 +574,7 @@ package body Synth.Stmts is
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);
@@ -587,13 +589,23 @@ package body Synth.Stmts is
end if;
if Last /= No_Net then
- Connect (Get_Input (Get_Net_Parent (Last), 1), V);
+ Inp := Get_Input (Get_Net_Parent (Last), 1);
+ Connect (Inp, V);
else
First := V;
end if;
Last := V;
Cwf := Get_Chain (Cwf);
end loop;
+ if Cond /= Null_Node then
+ pragma Assert (Last /= No_Net);
+ Inp := Get_Input (Get_Net_Parent (Last), 1);
+ if Get_Driver (Inp) = No_Net then
+ -- No else.
+ Val := Synth_Read (Syn_Inst, Targ, Stmt);
+ Connect (Inp, Get_Net (Val));
+ end if;
+ end if;
Val := Create_Value_Net (First, Targ.Targ_Type);
Synth_Assignment (Syn_Inst, Targ, Val, Stmt);
end Synth_Conditional_Signal_Assignment;