From 47a5c5eb9cc21a0f719bcc496731ec0e811e5240 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 20 Aug 2019 21:11:09 +0200 Subject: synth: add support for constant exponentiation. --- src/synth/synth-expr.adb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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 -- cgit v1.2.3