aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-08-20 21:11:09 +0200
committerTristan Gingold <tgingold@free.fr>2019-08-20 21:11:09 +0200
commit47a5c5eb9cc21a0f719bcc496731ec0e811e5240 (patch)
treeeca29d6770091f4dd10d20c9667fac9f621954e9
parent50b5866f2bfe11656c59ff87df002f29a5e50b43 (diff)
downloadghdl-47a5c5eb9cc21a0f719bcc496731ec0e811e5240.tar.gz
ghdl-47a5c5eb9cc21a0f719bcc496731ec0e811e5240.tar.bz2
ghdl-47a5c5eb9cc21a0f719bcc496731ec0e811e5240.zip
synth: add support for constant exponentiation.
-rw-r--r--src/synth/synth-expr.adb10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index 3c2504322..5c0abe189 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -1197,6 +1197,16 @@ package body Synth.Expr is
Error_Msg_Synth (+Expr, "non-constant mod not supported");
return null;
end if;
+ when Iir_Predefined_Integer_Exp =>
+ if Is_Const (Left) and then Is_Const (Right) then
+ return Create_Value_Discrete
+ (Left.Scal ** Natural (Right.Scal),
+ Get_Value_Type (Syn_Inst, Get_Type (Expr)));
+ else
+ Error_Msg_Synth
+ (+Expr, "non-constant exponentiation not supported");
+ return null;
+ end if;
when Iir_Predefined_Integer_Less_Equal =>
if Is_Const (Left) and then Is_Const (Right) then
return Create_Value_Discrete