From 3d9f5292dbe20c3b9d5453356e3f0827075e90be Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 12 Nov 2019 18:52:50 +0100 Subject: synth-oper: handle constant values for to_unsigned. --- src/synth/synth-oper.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb index 6a31efdc5..d98e925a4 100644 --- a/src/synth/synth-oper.adb +++ b/src/synth/synth-oper.adb @@ -1127,13 +1127,15 @@ package body Synth.Oper is | Iir_Predefined_Ieee_Std_Logic_Arith_Conv_Unsigned_Int => declare Arg : constant Value_Acc := Get_Value (Subprg_Inst, Param1); - Size : constant Value_Acc := Get_Value (Subprg_Inst, Param2); + Size : Value_Acc; Arg_Net : Net; begin + Size := Get_Value (Subprg_Inst, Param2); if not Is_Const (Size) then Error_Msg_Synth (+Expr, "to_unsigned size must be constant"); return Arg; else + Strip_Const (Size); -- FIXME: what if the arg is constant too ? if Is_Const (Arg) then return Eval_To_Unsigned -- cgit v1.2.3