Add PACE and several bug fixes into Gwaihir branch - #1
Open
DiyouS wants to merge 13 commits into
Open
Conversation
Currently some parameters are also given through defines, remember to also set them from your top-level module, rather than only the cfg. The define needed for doublebw mode is DOUBLE_BW. More define also need to be set to correctly configure the whole RTL at compile time, at least until the whole buildflow is moved to full json cfg, rather than mixed json-cfg+defines: BUF_FPU, VLEN, N_FPU, N_IPU, RVF. These defines have to match the same value of the cfg
- Disable ZeroRegZero in FP regfile (FP reg 0 does not need to be zeroed; zeroing creates issues which the compiler does not expect) - Add lsu_qmcast_i input to FP LSU: its absence was corruptin L/S transactions from Spatz - Fix amo assignment (purely cosmetic)
Backports two upstream pulp-platform/spatz double-bandwidth VLSU fixes that are missing from this fork: - pulp-platform/spatz#100 (pulp-platform/spatz#100) -- synchronize commits from both VLSU interfaces (commit-together, vrf_commit_waiting/vrf_commit_bypass, vlsu_buf_full_i), controller chaining refactor, and strided-load address generation. - pulp-platform/spatz#106 (pulp-platform/spatz#106) -- fix a combinatorial loop in the double-bw VLSU (write_request_vlsu uses VLSU_VD_WD0 only). Note: PR#100's "fix write pending check" commit is omitted as it targets a write_pending/store_count code path that does not exist in this fork.
| `else | ||
| localparam int unsigned PaceBufWidth = N_FU * ELEN; | ||
| `endif | ||
| localparam int unsigned PaceLdIdx = VLSU_VD_WD0; |
Collaborator
There was a problem hiding this comment.
I guess PaceLdIdx could be initialized within the above ifdef? and so only PaceLdIdx need to be used in later code.
Backports from pulp-platform/spatz: - 32d90b1a "fix a potential bug in VLSU that the index counter might be false triggered because of the late acceptance of an indexed store" - 502724e8 "add conservative switch from store to load instruction" These are required for the following fetch-logic fix to actually work: without retirement correctly gated on outstanding writes, the newer index-fetch-pending logic has nothing to prevent a premature retire/ re-run from racing ahead of it.
… #c919d7e3) Backports two upstream pulp-platform/spatz fixes for indexed vector memory ops (vsuxei/vluxei): - 700a810f "fix next index fetch logic" - c919d7e3 "fix index fetch logic from VRF" The index-fetch mechanism itself was fetching correct content every group, but the send path could pair a store with a stale one-group-behind snapshot of the index word even though the correct word had already been fetched (data/index pairing desync at send time, not a fetch-timing bug).
Root cause: vrf_re_o[intf][1] = mem_is_indexed was asserted unconditionally for the whole duration of an indexed instruction, regardless of whether that particular interface still had elements left to process. Once one interface finished, it kept re-requesting the shared index-VRF read port every cycle for no reason, permanently winning arbitration against the other interface's still-needed request and starving it of vrf_rvalid_i forever. Fix: gate the index-read request on |mem_operation_valid[intf] too, so a finished interface stops contending for the port. The data-read port (vrf_re_o[intf][0], used by stores) was already correctly gated on commit_operation_valid[intf].
For VFU/VSLDU write ports, done_result_d[intID] is latched sticky once vl_cnt crosses a completion threshold (spatz_controller.sv, the "VFU and VSLDU" branch). For VLSU write ports (SB_VLSU_VD_WD0/WD1), the mirrored "VLSU: intID is fixed per interface" branch sets wrote_result_d (a single-cycle pulse tied directly to the write) but never sets done_result_d at all. A chained consumer's read gate can then only ever pass by having its read evaluated on the exact same cycle the producer's wrote_result_q pulses; if that doesn't line up (as with a tiny vl=4 unit-stride load, which can complete in a single beat on one interface), the read either stalls forever or gets granted against unwritten/stale VRF read data, propagating X into the consumer. Fix: add a per-interface completion counter (vlsu_vl_cnt_q/d) tracking each VLSU interface's own write progress independently (interfaces write in parallel under double_bw, unlike VFU/VSLDU's single sequential vl_cnt), and latch done_result_d sticky once an interface's share is fully written. Written as (cnt + size >= max) rather than (cnt >= max - size) since vl_max can be smaller than a single VRFWordBWidth write for small vl, which would underflow the subtracted form.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR mainly
Two important notes:
-D define_namein your bender flow), rather than only the json cfg. The define needed for doublebw mode isDOUBLE_BW. More define also need to be set to correctly configure the whole RTL at compile time:BUF_FPU,VLEN,N_FPU,N_IPU,RVF. These defines have to match the same value of the cfg (or just be defined, for True/False values). I would still suggest, for the future, to move towards a json-only (or defines-only, through bender targets) flow, rather than a mixed one.