aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-07 08:19:12 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-07 08:27:32 +0200
commit3a9f459038346ac395281bbae18332b3d5861d02 (patch)
treec0550d8353243e2af82bbf92f4c8be7ea63bc6e2 /src
parentb722b0f53ec0abceeda88bb65a0eaf7d0ba743b2 (diff)
downloadghdl-3a9f459038346ac395281bbae18332b3d5861d02.tar.gz
ghdl-3a9f459038346ac395281bbae18332b3d5861d02.tar.bz2
ghdl-3a9f459038346ac395281bbae18332b3d5861d02.zip
synth-stmts: improve support of nested memories.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-stmts.adb9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index cfb632f53..f9fe69cdf 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -569,12 +569,13 @@ package body Synth.Stmts is
N := Get_Net (Ctxt, Obj);
if Dyn.Voff /= No_Net then
Synth.Source.Set_Location_Maybe (N, Loc);
- pragma Assert (Off = 0 or Dyn.Pfx_Off.Net_Off = 0);
- N := Build_Dyn_Extract (Get_Build (Syn_Inst), N, Dyn.Voff,
- Dyn.Pfx_Off.Net_Off + Off, Res_Typ.W);
+ if Dyn.Pfx_Off.Net_Off /= 0 then
+ N := Build2_Extract (Ctxt, N, Dyn.Pfx_Off.Net_Off, Dyn.Pfx_Typ.W);
+ end if;
+ N := Build_Dyn_Extract (Ctxt, N, Dyn.Voff, Off, Res_Typ.W);
else
pragma Assert (not Is_Static (Obj.Val));
- N := Build2_Extract (Get_Build (Syn_Inst), N, Off, Res_Typ.W);
+ N := Build2_Extract (Ctxt, N, Off, Res_Typ.W);
end if;
Set_Location (N, Loc);
return Create_Value_Net (N, Res_Typ);