aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-04 18:54:41 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-04 18:54:41 +0100
commitace84c069558b315e140c8712669cdc3b0806f68 (patch)
tree4eba2098d2a2eb0c25ece6e37b6d1337bc8835f2 /src/synth
parent6a76011ecd33a45c4ba8b7dd24d0618b9fc85fb1 (diff)
downloadghdl-ace84c069558b315e140c8712669cdc3b0806f68.tar.gz
ghdl-ace84c069558b315e140c8712669cdc3b0806f68.tar.bz2
ghdl-ace84c069558b315e140c8712669cdc3b0806f68.zip
synth-oper: handle constant not.
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/synth-oper.adb11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb
index 6634a2b2b..c394df158 100644
--- a/src/synth/synth-oper.adb
+++ b/src/synth/synth-oper.adb
@@ -929,10 +929,15 @@ package body Synth.Oper is
case Def is
when Iir_Predefined_Error =>
return null;
- when Iir_Predefined_Ieee_1164_Scalar_Not
- | Iir_Predefined_Boolean_Not
- | Iir_Predefined_Bit_Not =>
+ when Iir_Predefined_Ieee_1164_Scalar_Not =>
return Synth_Bit_Monadic (Id_Not);
+ when Iir_Predefined_Boolean_Not
+ | Iir_Predefined_Bit_Not =>
+ if Is_Const (Operand) then
+ return Create_Value_Discrete (1 - Operand.Scal, Oper_Typ);
+ else
+ return Synth_Bit_Monadic (Id_Not);
+ end if;
when Iir_Predefined_Ieee_1164_Vector_Not
| Iir_Predefined_Ieee_Numeric_Std_Not_Uns
| Iir_Predefined_Ieee_Numeric_Std_Not_Sgn =>