aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-21 21:32:27 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-21 21:32:27 +0200
commitdbd8dc2d6daa658e149195889226816922c7602d (patch)
treea5df7358714ee59576a44d94ad3d9f56b45e51c2
parent30409623356d54731993beb04a884d8828ace204 (diff)
downloadghdl-dbd8dc2d6daa658e149195889226816922c7602d.tar.gz
ghdl-dbd8dc2d6daa658e149195889226816922c7602d.tar.bz2
ghdl-dbd8dc2d6daa658e149195889226816922c7602d.zip
synth: add support for ascending attribute. Fix #1333
-rw-r--r--src/synth/synth-expr.adb15
1 files changed, 15 insertions, 0 deletions
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