From 2e7f15755f0c4b8956ab3f102fce2f0afb6277e5 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 16 Sep 2022 04:25:57 +0200 Subject: synth: handle val attribute for static bit/logic values --- src/synth/synth-vhdl_expr.adb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb index 3f3a62760..98dd16f7b 100644 --- a/src/synth/synth-vhdl_expr.adb +++ b/src/synth/synth-vhdl_expr.adb @@ -2256,6 +2256,9 @@ package body Synth.Vhdl_Expr is Dtype := Get_Subtype_Object (Syn_Inst, Get_Type (Expr)); -- FIXME: to be generalized. Not always as simple as a -- subtype conversion. + if Is_Static (V.Val) then + V := Create_Value_Discrete (Read_Discrete (V), Dtype); + end if; return Synth_Subtype_Conversion (Syn_Inst, V, Dtype, False, Expr); end; -- cgit v1.2.3