aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-12 18:52:50 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-12 20:36:02 +0100
commit3d9f5292dbe20c3b9d5453356e3f0827075e90be (patch)
tree3ec403cdcda057b237abb106ccc0e38d1582d364
parentb713e55b79881b7d4ac815230af01c02751cb10d (diff)
downloadghdl-3d9f5292dbe20c3b9d5453356e3f0827075e90be.tar.gz
ghdl-3d9f5292dbe20c3b9d5453356e3f0827075e90be.tar.bz2
ghdl-3d9f5292dbe20c3b9d5453356e3f0827075e90be.zip
synth-oper: handle constant values for to_unsigned.
-rw-r--r--src/synth/synth-oper.adb4
1 files changed, 3 insertions, 1 deletions
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