← Back to Pull requests

feat: give fetch and data a request response memory interface #37

Merged
spr4bhu merged 10 files (912 lines) on Sep 27, 2026 18:52 UTC
View on GitHub
spr4bhu spr4bhu commented on Sep 21, 2026 10:38 UTC
Author

Changed:

fetch and data now go through mem_adapter, a two-phase request/response interface (req/gnt/rvalid), instead of answering combinationally; added a MEM_LATENCY parameter (default 0, unchanged timing) so a slower backing store can be modeled in simulation; an AMO now issues a read then a write instead of one combined access, costing one extra cycle.

Diff: 912 lines (+849 / -63) across 10 files Reviewer: 5iri Review duration: 9134m
All Vouch review confidence checks passed
Residual risk 0.05 = Change Risk (0.56) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.56 · 912 lines diff across 10 files
0.56
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 4 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
90%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.400
Real PR Conversation Timeline
5 items
5iri 5iri commented on code on Sep 26, 2026 15:18 UTC
Code Review
rtl/top.v:1
@@ -111,6 +128,47 @@ module top (
     assign pc_debug = cpu_pc_out;
     assign instr_debug = instr_to_cpu;
     
+    // Memory adapters: the core presents a physical address and waits for the response.
+    assign cpu_data_req = cpu_mem_read_en || cpu_mem_write_en;

Block faulting stores before adapter acceptance; with latency >=2, they can commit after the trap clears the fault.

5iri 5iri commented on code on Sep 26, 2026 15:18 UTC
Code Review
rtl/top.v:1
@@ -237,9 +301,9 @@ module top (
     uart uart_inst (
         .clk(clk),
         .rst(rst),
-        .addr(phys_data_addr),
-        .write_data(cpu_mem_write_data),
-        .write_enable(cpu_mem_write_en && uart_access),
+        .addr(data_store_addr),
+        .write_data(data_store_wdata),
+        .write_enable(data_write_fire && uart_access),
         .read_enable(cpu_mem_read_en && uart_access),

Add a read_fire pulse at sampling and use it for UART/PLIC reads; held read_enable pops bytes or claims interrupts repeatedly.

spr4bhu spr4bhu commented on code on Sep 26, 2026 18:30 UTC
Code Review
rtl/top.v:1
@@ -111,6 +128,47 @@ module top (
     assign pc_debug = cpu_pc_out;
     assign instr_debug = instr_to_cpu;
     
+    // Memory adapters: the core presents a physical address and waits for the response.
+    assign cpu_data_req = cpu_mem_read_en || cpu_mem_write_en;

Fixed, faulting accesses are now blocked before the adapter.

spr4bhu spr4bhu commented on code on Sep 26, 2026 18:30 UTC
Code Review
rtl/top.v:1
@@ -237,9 +301,9 @@ module top (
     uart uart_inst (
         .clk(clk),
         .rst(rst),
-        .addr(phys_data_addr),
-        .write_data(cpu_mem_write_data),
-        .write_enable(cpu_mem_write_en && uart_access),
+        .addr(data_store_addr),
+        .write_data(data_store_wdata),
+        .write_enable(data_write_fire && uart_access),
         .read_enable(cpu_mem_read_en && uart_access),

Fixed, added a read_fire pulse like write_fire and used it for timer/UART/PLIC reads.

Reviewers
Assignees
spr4bhu spr4bhu
Labels
risk: low confidence: 90.6% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 56.2% (MEDIUM) · Higher = larger blast radius
56.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 90.6% · Lower = rushed or shallow review
90.6%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 5.3% · Safe to merge
5.3%