aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-oper.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-20 07:49:46 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-20 07:52:43 +0100
commit7b3afe306288b6486ae76452af7ddb34f81ffcd2 (patch)
tree07523b90cb56f6954a1b6891751d6c4e9844d6c2 /src/synth/synth-oper.adb
parent95d6df3db4ba09cddb4d12e7613b811d774c8ef6 (diff)
downloadghdl-7b3afe306288b6486ae76452af7ddb34f81ffcd2.tar.gz
ghdl-7b3afe306288b6486ae76452af7ddb34f81ffcd2.tar.bz2
ghdl-7b3afe306288b6486ae76452af7ddb34f81ffcd2.zip
synth: fix regression due to synth_bit_eq_const change.
Diffstat (limited to 'src/synth/synth-oper.adb')
-rw-r--r--src/synth/synth-oper.adb9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb
index 45eddb435..255df2e3f 100644
--- a/src/synth/synth-oper.adb
+++ b/src/synth/synth-oper.adb
@@ -107,8 +107,13 @@ package body Synth.Oper is
Set_Location (N, Loc);
return Create_Value_Net (N, Boolean_Type);
elsif Val = 1 then
- -- The result type is a boolean.
- return Create_Value_Discrete (1, Boolean_Type);
+ -- The result type is a boolean; convert if needed.
+ if Expr.Typ.Kind = Type_Logic then
+ return Create_Value_Net (Get_Net (Expr), Boolean_Type);
+ else
+ pragma Assert (Expr.Typ.Kind = Type_Bit);
+ return Expr;
+ end if;
else
pragma Assert (Val = 0);
N := Build_Monadic (Build_Context, Id_Not, Get_Net (Expr));