diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-11 18:50:33 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-11 18:50:33 +0200 |
commit | e6073d5f34b92cb4b7542d0a740be2701e882acf (patch) | |
tree | 6fe6ba53e05f4363411bc0580d90fd12f0513f96 | |
parent | 05ac81a5ff23ba45b5af45b29227f7cf5ed033fe (diff) | |
download | ghdl-e6073d5f34b92cb4b7542d0a740be2701e882acf.tar.gz ghdl-e6073d5f34b92cb4b7542d0a740be2701e882acf.tar.bz2 ghdl-e6073d5f34b92cb4b7542d0a740be2701e882acf.zip |
synth: handle constant bit compare.
-rw-r--r-- | src/synth/synth-expr.adb | 6 |
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); |