Commit 64dde79
Marcos
fix(axi4_mem_model): address self-review findings on PR #8
Self-review by code-reviewer agent flagged 3 HIGH findings:
HIGH 1. Write-write conflict between loader and AXI4 FSM was
undefined behaviour per SV NBA semantics across separate
always blocks. Verilator happens to make the loader win
but other simulators may differ.
Fix: collapsed the standalone loader always block into the
AXI4 write FSM's always block, sequenced as the LAST NBA in
the procedural step. SV guarantees the last NBA in a single
procedural block wins on conflicts — deterministic loader-
wins-on-conflict semantics across all SV-compliant tools.
HIGH 2. Misaligned loader_addr silently corrupted adjacent 32-bit
slots (or wrote past bit 255 of the cache line at offsets
29-31).
Fix: added 'assert (loader_addr[1:0] == 2'b00) else $error'
inside the loader branch. Misaligned addresses now produce
a clear simulator error instead of silent corruption.
Synthesis ignores the assertion.
HIGH 3. Loader always block had no reset arm — inconsistent with
every other always block in the file.
Fix: subsumed by HIGH 1 fix. The merged always block
inherits the AXI4 FSM's '@(posedge clk or negedge rst_n)'
sensitivity list and reset semantics.
Also addressed LOW finding:
LOW. README.md in src/popsolutions/axi4/ did not document the
loader port contract, semantics, conflict resolution rule,
alignment requirement, or synthesis tie-off convention.
Fix: appended a 'Memory loader back-door' section covering
all of the above.
Test status (verified locally, all green):
axi4_mem_model: 6/6 pass (no regression)
axi4_master_simple: 5/5 pass (no regression)
core_axi4_adapter: 5/5 pass (no regression)
inner_jib_top (IJ7EA): 2/2 pass (no regression — full sum_ints
still runs end-to-end)
18/18 across both repos.
Deferred MEDIUM findings (not blocking):
- Test coverage gap for slots 3-7 within a cache line and explicit
misalignment negative test. Will land as a follow-up PR with
test_loader_all_slots and test_loader_misalign_errors.
- Bit-width arithmetic note already covered by the new alignment
assertion (the unsafe path now errors at runtime).
Signed-off-by: Marcos <m@pop.coop>1 parent c12a6a5 commit 64dde79
2 files changed
Lines changed: 61 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
195 | 214 | | |
196 | 215 | | |
197 | 216 | | |
| |||
0 commit comments