diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-03-15 14:00:34 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-03-15 14:00:34 +0100 |
commit | 6e8e0f9d3ca375a29fafc81314d98e6df834e86d (patch) | |
tree | 62b0dc411acd4c50612e2ad58a8839562e825b0e /src | |
parent | aec70e17120c4ee3d949263621286dfd650d3df2 (diff) | |
download | ghdl-6e8e0f9d3ca375a29fafc81314d98e6df834e86d.tar.gz ghdl-6e8e0f9d3ca375a29fafc81314d98e6df834e86d.tar.bz2 ghdl-6e8e0f9d3ca375a29fafc81314d98e6df834e86d.zip |
vhdl: do not clear original node in canon for conditional signal assignment.
Fix #736
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/canon.adb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/vhdl/canon.adb b/src/vhdl/canon.adb index 921798a9a..128c9ef24 100644 --- a/src/vhdl/canon.adb +++ b/src/vhdl/canon.adb @@ -75,7 +75,7 @@ package body Canon is procedure Canon_Subtype_Indication_If_Anonymous (Def : Iir); function Canon_Conditional_Signal_Assignment - (Conc_Stmt : Iir; Proc : Iir; Parent : Iir) return Iir; + (Conc_Stmt : Iir; Proc : Iir; Parent : Iir; Clear : Boolean) return Iir; procedure Canon_Conditional_Signal_Assignment_Expression (Stmt : Iir); procedure Canon_Extract_Sensitivity_Aggregate @@ -1153,7 +1153,7 @@ package body Canon is return Iir is begin return Canon_Conditional_Signal_Assignment - (Stmt, Null_Iir, Get_Parent (Stmt)); + (Stmt, Null_Iir, Get_Parent (Stmt), False); end Canon_Conditional_Signal_Assignment_Statement; -- Inner loop if any; used to canonicalize exit/next statement. @@ -1560,7 +1560,7 @@ package body Canon is -- Create signal_transform for a concurrent conditional signal assignment. function Canon_Conditional_Signal_Assignment - (Conc_Stmt : Iir; Proc : Iir; Parent : Iir) return Iir + (Conc_Stmt : Iir; Proc : Iir; Parent : Iir; Clear : Boolean) return Iir is Expr : Iir; Stmt : Iir; @@ -1616,8 +1616,10 @@ package body Canon is Last_Res := Res1; end if; - Set_Condition (Cond_Wf, Null_Iir); - Set_Waveform_Chain (Cond_Wf, Null_Iir); + if Clear then + Set_Condition (Cond_Wf, Null_Iir); + Set_Waveform_Chain (Cond_Wf, Null_Iir); + end if; Cond_Wf := Get_Chain (Cond_Wf); end loop; @@ -1631,7 +1633,8 @@ package body Canon is is Stmt : Iir; begin - Stmt := Canon_Conditional_Signal_Assignment (Conc_Stmt, Proc, Parent); + Stmt := Canon_Conditional_Signal_Assignment + (Conc_Stmt, Proc, Parent, True); Set_Sequential_Statement_Chain (Parent, Stmt); end Canon_Concurrent_Conditional_Signal_Assignment; |