From e6073d5f34b92cb4b7542d0a740be2701e882acf Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 11 Sep 2019 18:50:33 +0200 Subject: synth: handle constant bit compare. --- src/synth/synth-expr.adb | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v1.2.3