aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-11 21:22:31 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-13 06:30:29 +0100
commit8bb20d4d61d72528ff858962b505e11ca19179da (patch)
tree1d424ec4c617326318bce8a2a3adeb25ef1ed6dc /src
parentb9002fd5406696c5c7410ae5389ebbe50a51ab9b (diff)
downloadghdl-8bb20d4d61d72528ff858962b505e11ca19179da.tar.gz
ghdl-8bb20d4d61d72528ff858962b505e11ca19179da.tar.bz2
ghdl-8bb20d4d61d72528ff858962b505e11ca19179da.zip
synth-expr: handle reverse_range attribute.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-expr.adb22
1 files changed, 22 insertions, 0 deletions
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
@@ -731,6 +731,28 @@ package body Synth.Expr is
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),
+ Right => Int64 (B.Right));
+ end;
when others =>
Error_Kind ("synth_discrete_range", Bound);
end case;