aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-01-21 07:45:23 +0100
committerTristan Gingold <tgingold@free.fr>2020-01-21 07:46:04 +0100
commit2849ade7fc1ab10f73cf0be83a992b6e798ba087 (patch)
tree6d33cb3a20388827b0dcc26e1ace935cd72e43d7 /src
parentcaed711f6b933eb8ca3e2d8e458824b2b20f6b3b (diff)
downloadghdl-2849ade7fc1ab10f73cf0be83a992b6e798ba087.tar.gz
ghdl-2849ade7fc1ab10f73cf0be83a992b6e798ba087.tar.bz2
ghdl-2849ade7fc1ab10f73cf0be83a992b6e798ba087.zip
synth-static_oper: handle array-element concatenation.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-static_oper.adb20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/synth/synth-static_oper.adb b/src/synth/synth-static_oper.adb
index c756bd3b0..15a41a9dc 100644
--- a/src/synth/synth-static_oper.adb
+++ b/src/synth/synth-static_oper.adb
@@ -402,6 +402,26 @@ package body Synth.Static_Oper is
end loop;
return Create_Value_Const_Array (Res_Typ, Arr);
end;
+ when Iir_Predefined_Array_Element_Concat =>
+ declare
+ Ret_Typ : constant Type_Acc :=
+ Get_Value_Type (Syn_Inst, Get_Return_Type (Imp));
+ Bnd : Bound_Type;
+ Res_Typ : Type_Acc;
+ Arr : Value_Array_Acc;
+ begin
+ Bnd := Oper.Create_Bounds_From_Length
+ (Syn_Inst, Get_Index_Type (Get_Type (Expr), 0),
+ Left.Arr.Len + 1);
+ Res_Typ := Create_Onedimensional_Array_Subtype
+ (Ret_Typ, Bnd);
+ Arr := Create_Value_Array (Left.Arr.Len + 1);
+ for I in Left.Arr.V'Range loop
+ Arr.V (I) := Left.Arr.V (I);
+ end loop;
+ Arr.V (Left.Arr.Len + 1) := Right;
+ return Create_Value_Const_Array (Res_Typ, Arr);
+ end;
when Iir_Predefined_Array_Equality
| Iir_Predefined_Record_Equality =>