fix: apply backend timing and instr buffer patches#6
Open
filmil wants to merge 6 commits into
Open
Conversation
Extracted combinatorial assignments to `cache_d2h_o.req_ready` into a separate `always @(...)` block in `ip/core/rtl/muntjac_dcache.sv` to improve code organization, along with all corresponding conditional logic. This commit has been created by an automated coding assistant, with human supervision. Prompt: @ip/core/rtl/muntjac_dcache.sv extract combinatorial assignments to `cache_d2h_o.req_ready` into a separate always_comb section, copy all conditional logic too declare a sensitivity list for the new always_comb block create a PR
Fix a fatal zero-delay oscillation detected during simulation by removing the combinatorial dependency of `req_valid` on `req_ready`. The functional units' ready checks have been removed from the structural hazard detection, and a provisional issue signal is now used to assert requests independently of readiness. Stalling logic is maintained via a new `unit_ready` signal combined into pipeline ready checks. This commit has been created by an automated coding assistant, with human supervision. Please fix the bug described in this report: ### Describe the bug When simulating the Muntjac core using an event-driven simulator like Vivado XSIM, the simulation fails immediately at $t=0$ with a fatal iteration limit error: Fatal Error: Iteration limit reached. Possible zero delay oscillation detected where simulation time can not advance. This is caused by a circular combinatorial dependency violating standard valid/ready handshake rules: the backend's req_valid signal combinationally depends on the cache's req_ready signal, but the cache's req_ready signal combinationally depends on req_valid through its internal arbiter. ### Root Cause / Trace 1. muntjac_backend.sv: req_valid depends on mem_ready (req_ready). 2. muntjac_dcache.sv: req_ready depends on req_valid via arbiter. ### Proposed Fix In muntjac_backend.sv, the mem_ready check should be removed from the structural hazard detection for OP_MEM, allowing req_valid to assert independently of req_ready. Stalling the pipeline should be handled by the pipeline stage registers not advancing when req_valid && !req_ready. create PR
Several registers use async reset (always_ff @(posedge clk or negedge rst_ni)) but lack SystemVerilog variable initialization. Event-driven simulators like Vivado xsim evaluate always_comb blocks at time 0 before any clock/reset edge triggers the always_ff blocks, so these registers hold X. This creates a delta cycle oscillation that prevents simulation time from advancing. Adding variable initialization (e.g., `logic valid = 1'b0`) gives these registers defined values from delta 0, matching their async reset values. This has no effect on synthesis. Fixes: lowRISC#4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 applies the backend timing and instruction buffer patches from the a200t_examples repository. These changes have been verified with riscv-tests locally using act.