diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-11-09 21:51:43 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-11-11 20:28:19 +0100 |
commit | 81254216c4e8ba25ff98b3c77f7beb0f834d1a27 (patch) | |
tree | c78677a0bc518c81cd145e3f93ae6e5453fbd32b /src | |
parent | bad1f59fe02347828cb2d15a74d356320937d952 (diff) | |
download | ghdl-81254216c4e8ba25ff98b3c77f7beb0f834d1a27.tar.gz ghdl-81254216c4e8ba25ff98b3c77f7beb0f834d1a27.tar.bz2 ghdl-81254216c4e8ba25ff98b3c77f7beb0f834d1a27.zip |
netlists-expands: handle gaps.
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/netlists-expands.adb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/synth/netlists-expands.adb b/src/synth/netlists-expands.adb index 37b00d64e..c6f2196e2 100644 --- a/src/synth/netlists-expands.adb +++ b/src/synth/netlists-expands.adb @@ -323,24 +323,24 @@ package body Netlists.Expands is (Ctxt, Build_Extract (Ctxt, Mem, Next_Off, Step), Build_Extract (Ctxt, Prev_Net, Step, Dat_W - Step)); - V := Build_Mux2 (Ctxt, Net_Arr (Sel), V, Dat); - Prev_Net := V; - Next_Off := Off + Dat_W; - elsif Next_Off = Off then - -- No overlap, no gap + else + -- No overlap. if Prev_Net /= No_Net then Append (Concat, Prev_Net); end if; + + if Next_Off < Off then + -- But there is a gap. + Append (Concat, Build_Extract (Ctxt, Mem, Next_Off, + Off - Next_Off)); + end if; V := Build_Extract (Ctxt, Mem, Off, Dat_W); - V := Build_Mux2 (Ctxt, Net_Arr (Sel), V, Dat); - Prev_Net := V; - Next_Off := Off + Dat_W; - else - pragma Assert (Next_Off < Off); - -- Gap. - raise Internal_Error; end if; + V := Build_Mux2 (Ctxt, Net_Arr (Sel), V, Dat); + Prev_Net := V; + Next_Off := Off + Dat_W; + Sel := Sel + 1; -- Increase Off. |