aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-07 18:39:42 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-07 18:39:42 +0100
commit21ab5cfb88d182927e14789353e56fecd9960fd3 (patch)
tree564f7d11ecb3c107277d9bab7003d82f14100667 /src
parent15ad354882b2cda02cc32aa9826385508d743c55 (diff)
downloadghdl-21ab5cfb88d182927e14789353e56fecd9960fd3.tar.gz
ghdl-21ab5cfb88d182927e14789353e56fecd9960fd3.tar.bz2
ghdl-21ab5cfb88d182927e14789353e56fecd9960fd3.zip
synth-static_oper: handle const operands for enums.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-static_oper.adb9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/synth/synth-static_oper.adb b/src/synth/synth-static_oper.adb
index dbdb6c784..504110072 100644
--- a/src/synth/synth-static_oper.adb
+++ b/src/synth/synth-static_oper.adb
@@ -321,11 +321,14 @@ package body Synth.Static_Oper is
when Iir_Predefined_Enum_Equality =>
return Create_Value_Discrete
- (Boolean'Pos (Left.Scal = Right.Scal), Boolean_Type);
+ (Boolean'Pos
+ (Get_Static_Discrete (Left) = Get_Static_Discrete (Right)),
+ Boolean_Type);
when Iir_Predefined_Enum_Inequality =>
return Create_Value_Discrete
- (Boolean'Pos (Left.Scal /= Right.Scal), Boolean_Type);
-
+ (Boolean'Pos
+ (Get_Static_Discrete (Left) /= Get_Static_Discrete (Right)),
+ Boolean_Type);
when Iir_Predefined_Integer_Plus
| Iir_Predefined_Physical_Plus =>
return Create_Value_Discrete