aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-insts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-02-18 18:48:00 +0100
committerTristan Gingold <tgingold@free.fr>2020-02-18 18:48:00 +0100
commitb3d54b7ac3187da2803b4b1ddc1b34170a92bf13 (patch)
treecbe5d18727a1ab92673ac9edc192214f01b19264 /src/synth/synth-insts.adb
parent393612fc52586d8eb8372f0ce3f05c162cfccfe2 (diff)
downloadghdl-b3d54b7ac3187da2803b4b1ddc1b34170a92bf13.tar.gz
ghdl-b3d54b7ac3187da2803b4b1ddc1b34170a92bf13.tar.bz2
ghdl-b3d54b7ac3187da2803b4b1ddc1b34170a92bf13.zip
synth-insts: handle slices in individual associations.
Diffstat (limited to 'src/synth/synth-insts.adb')
-rw-r--r--src/synth/synth-insts.adb21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb
index 953caf5ab..f700e0168 100644
--- a/src/synth/synth-insts.adb
+++ b/src/synth/synth-insts.adb
@@ -465,6 +465,27 @@ package body Synth.Insts is
Off := Off + Arr_Off;
Typ := Get_Array_Element (Typ);
end;
+ when Iir_Kind_Slice_Name =>
+ declare
+ Pfx_Bnd : Bound_Type;
+ El_Typ : Type_Acc;
+ Res_Bnd : Bound_Type;
+ Sl_Voff : Net;
+ Sl_Off : Uns32;
+ Wd : Uns32;
+ begin
+ Synth_Individual_Prefix
+ (Syn_Inst, Inter_Inst, Get_Prefix (Formal), Off, Typ);
+
+ Get_Onedimensional_Array_Bounds (Typ, Pfx_Bnd, El_Typ);
+ Synth_Slice_Suffix (Syn_Inst, Formal, Pfx_Bnd, El_Typ.W,
+ Res_Bnd, Sl_Voff, Sl_Off, Wd);
+ if Sl_Voff /= No_Net then
+ raise Internal_Error;
+ end if;
+ Off := Off + Sl_Off;
+ Typ := Create_Onedimensional_Array_Subtype (Typ, Res_Bnd);
+ end;
when others =>
Vhdl.Errors.Error_Kind ("synth_individual_prefix", Formal);
end case;