aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-09-11 18:50:33 +0200
committerTristan Gingold <tgingold@free.fr>2019-09-11 18:50:33 +0200
commite6073d5f34b92cb4b7542d0a740be2701e882acf (patch)
tree6fe6ba53e05f4363411bc0580d90fd12f0513f96 /src/synth/synth-expr.adb
parent05ac81a5ff23ba45b5af45b29227f7cf5ed033fe (diff)
downloadghdl-e6073d5f34b92cb4b7542d0a740be2701e882acf.tar.gz
ghdl-e6073d5f34b92cb4b7542d0a740be2701e882acf.tar.bz2
ghdl-e6073d5f34b92cb4b7542d0a740be2701e882acf.zip
synth: handle constant bit compare.
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r--src/synth/synth-expr.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index d6651638f..ecb2bada1 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -783,8 +783,14 @@ package body Synth.Expr is
Zx : Uns32;
N : Net;
begin
+ if Is_Const (Expr) then
+ return Create_Value_Discrete (Boolean'Pos (Cst.Scal = Expr.Scal),
+ Boolean_Type);
+ end if;
+
To_Logic (Cst.Scal, Cst.Typ, Val, Zx);
if Zx /= 0 then
+ -- Equal unknown -> return X
N := Build_Const_UL32 (Build_Context, 0, 1, 1);
Set_Location (N, Loc);
return Create_Value_Net (N, Boolean_Type);