aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-07-26 19:43:42 +0200
committerTristan Gingold <tgingold@free.fr>2020-07-26 21:26:21 +0200
commit7842784e034aa5b8ad7cb4fa6b1fe3eb82ec9f8c (patch)
treecda344f3e98a60b6d8f73a44cbe098d954acb845 /src
parente7cabe5ece80dd278368216028cd11cf1ab61681 (diff)
downloadghdl-7842784e034aa5b8ad7cb4fa6b1fe3eb82ec9f8c.tar.gz
ghdl-7842784e034aa5b8ad7cb4fa6b1fe3eb82ec9f8c.tar.bz2
ghdl-7842784e034aa5b8ad7cb4fa6b1fe3eb82ec9f8c.zip
synth: generalize static condition for if statement. Fix #1407
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-stmts.adb8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index 16c70466c..8570225bd 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -741,14 +741,14 @@ package body Synth.Stmts is
Set_Error (C.Inst);
return;
end if;
- if Is_Static (Cond_Val.Val) then
+ if Is_Static_Val (Cond_Val.Val) then
Strip_Const (Cond_Val);
- if Read_Discrete (Cond_Val) = 1 then
+ if Read_Discrete (Get_Value_Memtyp (Cond_Val)) = 1 then
-- True.
Synth_Sequential_Statements
(C, Get_Sequential_Statement_Chain (Stmt));
else
- pragma Assert (Read_Discrete (Cond_Val) = 0);
+ pragma Assert (Read_Discrete (Get_Value_Memtyp (Cond_Val)) = 0);
if Is_Valid (Els) then
-- Else part
if Is_Null (Get_Condition (Els)) then
@@ -2213,7 +2213,7 @@ package body Synth.Stmts is
Write_Discrete (V, T);
end Update_Index;
- -- Return True iff WID is a static wire and its value is 0.
+ -- Return True iff WID is a static wire and its value is V.
function Is_Static_Bit (Wid : Wire_Id; V : Ghdl_U8) return Boolean
is
M : Memtyp;