From 8bb20d4d61d72528ff858962b505e11ca19179da Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 11 Mar 2020 21:22:31 +0100 Subject: synth-expr: handle reverse_range attribute. --- src/synth/synth-expr.adb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index c447bef85..eb0357145 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -726,6 +726,28 @@ package body Synth.Expr is B : Bound_Type; begin B := Synth_Array_Attribute (Syn_Inst, Bound); + Rng := Discrete_Range_Type'(Dir => B.Dir, + Is_Signed => True, + Left => Int64 (B.Left), + Right => Int64 (B.Right)); + end; + when Iir_Kind_Reverse_Range_Array_Attribute => + declare + B : Bound_Type; + T : Int32; + begin + B := Synth_Array_Attribute (Syn_Inst, Bound); + -- Reverse + case B.Dir is + when Iir_To => + B.Dir := Iir_Downto; + when Iir_Downto => + B.Dir := Iir_To; + end case; + T := B.Right; + B.Right := B.Left; + B.Left := T; + Rng := Discrete_Range_Type'(Dir => B.Dir, Is_Signed => True, Left => Int64 (B.Left), -- cgit v1.2.3