aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-06-20 07:54:46 +0200
committerTristan Gingold <tgingold@free.fr>2021-06-21 08:02:33 +0200
commitca26a87dc5a0d405c6d777a4899ea617811cf402 (patch)
treecbdcedb929ffe70fe623936c9437ed2b884094b8 /src
parent512457352b96a5ac272269aebf283cecc0b8500f (diff)
downloadghdl-ca26a87dc5a0d405c6d777a4899ea617811cf402.tar.gz
ghdl-ca26a87dc5a0d405c6d777a4899ea617811cf402.tar.bz2
ghdl-ca26a87dc5a0d405c6d777a4899ea617811cf402.zip
synth-vhdl_stmts: merge static extract before dyn_extract.
No reasons to use an extra gate.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-vhdl_stmts.adb6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/synth/synth-vhdl_stmts.adb b/src/synth/synth-vhdl_stmts.adb
index 0f2694e06..dbb6b10a9 100644
--- a/src/synth/synth-vhdl_stmts.adb
+++ b/src/synth/synth-vhdl_stmts.adb
@@ -571,12 +571,10 @@ package body Synth.Vhdl_Stmts is
N := Get_Net (Ctxt, Obj);
if Dyn.Voff /= No_Net then
Synth.Source.Set_Location_Maybe (N, Loc);
- if Dyn.Pfx_Off.Net_Off /= 0 then
- N := Build2_Extract (Ctxt, N, Dyn.Pfx_Off.Net_Off, Dyn.Pfx_Typ.W);
- end if;
if Res_Typ.W /= 0 then
-- Do not try to extract if the net is null.
- N := Build_Dyn_Extract (Ctxt, N, Dyn.Voff, Off, Res_Typ.W);
+ N := Build_Dyn_Extract (Ctxt, N, Dyn.Voff,
+ Off + Dyn.Pfx_Off.Net_Off, Res_Typ.W);
end if;
else
pragma Assert (not Is_Static (Obj.Val));