From dbd8dc2d6daa658e149195889226816922c7602d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 21 May 2020 21:32:27 +0200 Subject: synth: add support for ascending attribute. Fix #1333 --- src/synth/synth-expr.adb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index a4dd36ea7..ccdbecd97 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -2054,6 +2054,21 @@ package body Synth.Expr is B := Synth_Array_Attribute (Syn_Inst, Expr); return Create_Value_Discrete (Int64 (B.Len), Expr_Type); end; + when Iir_Kind_Ascending_Array_Attribute => + declare + B : Bound_Type; + V : Int64; + begin + B := Synth_Array_Attribute (Syn_Inst, Expr); + case B.Dir is + when Dir_To => + V := 1; + when Dir_Downto => + V := 0; + end case; + return Create_Value_Discrete (V, Expr_Type); + end; + when Iir_Kind_Pos_Attribute | Iir_Kind_Val_Attribute => declare -- cgit v1.2.3