aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/netlists-expands.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-18 07:26:36 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-18 07:26:36 +0200
commitc261402a951b58e9560a69b9d9822285e7197506 (patch)
tree3604320687870a9d2863587133ef2df7142cedcb /src/synth/netlists-expands.adb
parent1863bc905e09f84b954ccce6ac9f20ee02d107f2 (diff)
downloadghdl-c261402a951b58e9560a69b9d9822285e7197506.tar.gz
ghdl-c261402a951b58e9560a69b9d9822285e7197506.tar.bz2
ghdl-c261402a951b58e9560a69b9d9822285e7197506.zip
netlists-expands: fix handling of non-consective extractions. Fix #1241
Diffstat (limited to 'src/synth/netlists-expands.adb')
-rw-r--r--src/synth/netlists-expands.adb6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/synth/netlists-expands.adb b/src/synth/netlists-expands.adb
index 09ff5d9c4..571b17620 100644
--- a/src/synth/netlists-expands.adb
+++ b/src/synth/netlists-expands.adb
@@ -89,14 +89,16 @@ package body Netlists.Expands is
Els : Case_Element_Array_Acc;
Idx : in out Positive;
Addr : Net;
- Off : in out Uns32;
+ Init_Off : Uns32;
W : Width;
Sel : in out Uns64)
is
Inst : constant Instance := Memidx_Arr (Arr_Idx);
Step : constant Uns32 := Get_Param_Uns32 (Inst, 0);
Max : constant Uns32 := Get_Param_Uns32 (Inst, 1);
+ Off : Uns32;
begin
+ Off := Init_Off;
for I in 0 .. Max loop
if Arr_Idx < Memidx_Arr'Last then
-- Recurse.
@@ -107,8 +109,8 @@ package body Netlists.Expands is
Val => Build_Extract (Ctxt, Val, Off, W));
Idx := Idx + 1;
Sel := Sel + 1;
- Off := Off + Step;
end if;
+ Off := Off + Step;
end loop;
end Fill_Els;