aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-oper.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth/synth-oper.adb')
-rw-r--r--src/synth/synth-oper.adb16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb
index b36511adf..dd36ef4aa 100644
--- a/src/synth/synth-oper.adb
+++ b/src/synth/synth-oper.adb
@@ -956,7 +956,21 @@ package body Synth.Oper is
when Iir_Predefined_Ieee_1164_Vector_Or_Reduce =>
return Synth_Vec_Reduce_Monadic(Id_Red_Or);
when Iir_Predefined_Ieee_1164_Condition_Operator =>
- return Operand;
+ if Operand.Typ.Kind = Type_Logic
+ and then Operand.Kind = Value_Discrete
+ then
+ -- Constant std_logic: need to convert.
+ declare
+ Val : Uns32;
+ Zx : Uns32;
+ begin
+ From_Std_Logic (Operand.Scal, Val, Zx);
+ return Create_Value_Discrete
+ (Boolean'Pos (Val = 1 and Zx = 0), Boolean_Type);
+ end;
+ else
+ return Operand;
+ end if;
when Iir_Predefined_Integer_Negation =>
if Is_Const (Operand) then
return Create_Value_Discrete (-Operand.Scal, Operand.Typ);