aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-11-29 21:13:09 +0100
committerTristan Gingold <tgingold@free.fr>2021-11-29 21:13:09 +0100
commit49a142e5f5ae643ee55794b95e354172f288d90e (patch)
tree07520dc8406dd200f4b946a0b5da505f368b4987
parent0416c788cd9aecd1a2bc8e7a517606d181d99921 (diff)
downloadghdl-49a142e5f5ae643ee55794b95e354172f288d90e.tar.gz
ghdl-49a142e5f5ae643ee55794b95e354172f288d90e.tar.bz2
ghdl-49a142e5f5ae643ee55794b95e354172f288d90e.zip
synth/elab-vhdl_expr: handle slices and indexed names. Fix #1926
-rw-r--r--src/synth/elab-vhdl_expr.adb30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/synth/elab-vhdl_expr.adb b/src/synth/elab-vhdl_expr.adb
index ff2ef3c9d..b83247855 100644
--- a/src/synth/elab-vhdl_expr.adb
+++ b/src/synth/elab-vhdl_expr.adb
@@ -1201,25 +1201,17 @@ package body Elab.Vhdl_Expr is
(Syn_Inst, Get_Named_Entity (Expr), Expr_Type);
when Iir_Kind_Indexed_Name
| Iir_Kind_Slice_Name =>
- raise Internal_Error;
- -- declare
- -- Base : Valtyp;
- -- Typ : Type_Acc;
- -- Off : Value_Offsets;
- -- Res : Valtyp;
-
- -- Dyn : Dyn_Name;
- -- begin
- -- Synth_Assignment_Prefix (Syn_Inst, Expr, Base, Typ, Off, Dyn);
- -- if Dyn.Voff = No_Net and then Is_Static (Base.Val) then
- -- Res := Create_Value_Memory (Typ);
- -- Copy_Memory
- -- (Res.Val.Mem, Base.Val.Mem + Off.Mem_Off, Typ.Sz);
- -- return Res;
- -- end if;
- -- return Synth_Read_Memory
- -- (Syn_Inst, Base, Typ, Off.Net_Off, Dyn, Expr);
- -- end;
+ declare
+ Base : Valtyp;
+ Typ : Type_Acc;
+ Off : Value_Offsets;
+ Res : Valtyp;
+ begin
+ Exec_Assignment_Prefix (Syn_Inst, Expr, Base, Typ, Off);
+ Res := Create_Value_Memory (Typ);
+ Copy_Memory (Res.Val.Mem, Base.Val.Mem + Off.Mem_Off, Typ.Sz);
+ return Res;
+ end;
when Iir_Kind_Selected_Element =>
declare
Idx : constant Iir_Index32 :=