Rtl p3 uarch policy

From babyworm/rtl-agent-team · View interactive version

Rtl p3 uarch policy is an AI agent skill from the GitHub repository babyworm/rtl-agent-team. Internal reference: rtl p3 uarch policy (agent-loaded; do not invoke).

How to use this skill

Skill file

Phase 3 μArch Design Policy

Document Requirements (per-module docs/phase-3-uarch/*.md)

Each module document MUST contain:

  1. Module decomposition: sub-modules with rationale (or single-module rationale)
  2. Clock domain assignment: per sub-block, with synchronizer specs for cross-domain
  3. Protocol assignment: per interface with justification (data rate, latency, backpressure)
  4. Design partitioning: pipeline stages, resource sharing, parallelism degree
  5. Register/SRAM/FSM allocation: pipeline regs, config regs, SRAM capacity+banking, FSM state count
  6. Inter/intra-module pipeline: data flow, handshake, backpressure, hazard analysis
  7. Signal naming: compliant with conventions below

REQ→uArch Reverse Traceability

Every P3 run MUST produce docs/phase-3-uarch/req-uarch-traceability.md mapping each requirement

from docs/phase-1-research/iron-requirements.json (REQ-F-, REQ-P-) and

docs/phase-2-architecture/iron-requirements.json (REQ-A-*) to the uArch module(s) and section(s) implementing it.

Format:

| REQ ID   | uArch Module(s)         | Section(s)                  | Status   |
|----------|-------------------------|-----------------------------|----------|
| REQ-001  | intra_pred              | 3.2 Mode Decision FSM       | MAPPED   |
| REQ-002  | deblock_filter, sao     | 2.1 Pipeline, 4.3 SAO Ctrl  | MAPPED   |
| REQ-003  | —                       | —                           | UNMAPPED |

Clock Domain Assignment Rules

Protocol Assignment Rules

Storage Selection Criteria (Register vs SRAM Wrapper)

Generic selection table (bit/port thresholds), register-file exceptions, wrapper naming/parameters,

and SP port list are owned by the deployed .claude/rules/rtl-coding-conventions.md (Storage Selection

section). P3-specific additions below.

Every storage element in the μArch spec MUST include a storage type decision with rationale.

Read latency as selection criterion:

Streaming buffer rule (write-once/read-multiple: line/frame buffers, init-written coefficient tables):

always SRAM wrapper regardless of size — combinational read on streaming buffers creates massive MUX trees.

If N readers share 1R port: document time-multiplex schedule (e.g., 4 readers × 1 cycle = 4-cycle access, must fit within pipeline initiation interval).

Multi-port large storage (>4096 bits, >2 R/W): prefer banked SRAM to reduce port count; register file only with PPA justification.

SpyGlass compatibility: set_option mthresh <bits> flags register arrays exceeding the threshold as SRAM candidates; teams typically set 4096–65536 bits by target technology. Align the >4096-bit mandatory SRAM rule with your project's mthresh setting in rat_config.json if different.

Per-SRAM-instance μArch spec (required for every SRAM instance):

Bus Width Parameterization Rule

Every internal bus, FIFO, and result packing width MUST be derived from design parameters —

hardcoded width constants are prohibited in parameterized designs.

(Why: widths hardcoded for one parameter set — e.g., BPC=12 — leave unused upper bits when parameters change: structurally unreachable toggle coverage, wasted area/power, hidden parameter dependencies.)

Enforcement

must derive from upper parameters (e.g., localparam L_FIFO_W = BLK_PIXELS * COMPONENTS * (BPC+1) + META)

a design parameter, not a magic number

BFM Validation Requirements (MANDATORY)

Three sub-gates in order — executable procedure owned by p3-uarch-orchestrator Step 4:

Conditional Expert Delegation (Phase 3)

parallel work groups that the orchestrator can apply to Step 3/5 sequencing.

reviews/phase-3-uarch/clock-architecture-review.md and concrete fixes to

docs/phase-3-uarch/clock-domain-map.md.

Signal Naming Conventions (MANDATORY — flow to RTL)

Review Protocol (dynamic convergence, 5 parallel reviewers)

Dynamic convergence rounds (min 2, max 5 — see Review Convergence Criteria), coordinated by rtl-architect:

1. rtl-architect: feature preservation, block boundary, interface, protocol consistency

2. timing-advisor: critical paths at target frequency, pipeline balance, clock domain feasibility

3. (conditional) domain architecture expert: algorithm/memory/interface optimization

— invoke when domain-packages/{domain}/ exists (e.g., vcodec-architecture-expert for video codec).

When no domain expert available, rtl-architect covers algorithm consistency in its scope.

4. ref-model-dev: model consistency (behavior, data widths, fixed-point, I/O log alignment)

5. bfm-dev: BFM simulation results, I/O logging correctness, protocol behavior

memory conflict analysis, model consistency matrix, BFM final pass, μArch code review

Feature Preservation Checklist Format

Save to reviews/phase-3-uarch/feature-preservation.md:

# Phase 3 Review: Feature Preservation
- Date: YYYY-MM-DD
- Reviewer: rtl-architect
- Upper Spec: architecture.md
- Verdict: PASS | FAIL

## Feature Coverage Checklist
| Feature | Architecture Block | μArch Doc | Status |

## Findings
### [severity] Finding-N: ...

## Verdict
PASS | FAIL: [reason]

Wonder Log (Required)

Each review round MUST produce a wonder-log entry:

Review Convergence Criteria

Review rounds use dynamic convergence instead of fixed 3 rounds:

| Parameter | Value | Rationale |

|-----------|-------|-----------|

| min_rounds | 2 | Minimum for meaningful review |

| max_rounds | 5 | Prevent infinite loops |

| finding_delta_threshold | 0.1 | < 10% new findings = stable |

| critical_resolution | ALL | All Critical/High must be resolved |

| wonder_stability | true | No new High-risk assumptions |

Early exit (round 2): When findings converge quickly (simple designs)

Extended review (rounds 4-5): For complex designs with emergent issues

Convergence signals: stability (finding_delta < threshold), stagnation (same findings repeated across rounds), oscillation (findings toggling resolved↔reopened).

Escalation & Stop Conditions

Final Checklist

Structure & throughput:

Section rules hold (name-only — the named sections are normative):

Checklist-only gate details:

Review:

Open Resolution Protocol

Phase 3 receives docs/phase-2-architecture/open-requirements.json containing OPEN-2-* research topics.

For each OPEN-2-* item, the μArch team must:

  1. Conduct μArch analysis using the item's candidates and evaluation_criteria
  2. Select a winner with quantitative justification
  3. Record the decision in docs/phase-3-uarch/iron-requirements.json (REQ-U-*) with:
  1. Verify: ALL OPEN-2-* items must be resolved before Phase 3 exit

iron-requirements.json Schema — acceptance_criteria

Each REQ-U-* entry SHOULD include structured acceptance_criteria:

"acceptance_criteria": [
  {
    "ac_id": "REQ-U-NNN.AC-M",
    "description": "measurable criterion text",
    "test_method": "assertion|cocotb|formal|inspection",
    "verifiable": true
  }
]

Rules:

documented in RTM as NOT_VERIFIABLE

iron-requirements.json Schema — traces_to

Each REQ-U-* entry SHOULD include a traces_to field linking to upstream requirements:

  "traces_to": ["REQ-F-NNN", "REQ-A-NNN"]   // Upstream requirements this REQ-U-* decomposes from

Rules:

Zero-Opens Invariant

Phase 3 MUST NOT produce an open-requirements.json. All research topics must be resolved here.

If unresolved items remain at Phase 3 exit → EXIT GATE FAIL.

P4 (Implementation) requires all requirements to be iron — no open items may remain.

Compliance Check Procedure

After docs/phase-3-uarch/iron-requirements.json (REQ-U-*) is finalized:

  1. Invoke compliance-checker agent with:
  1. Gate: compliance-report.json verdict must be PASS
  2. On VIOLATION: enter authority-differentiated escalation ladder

Upstream Challenge Protocol

Same as Phase 2, but challenges may target P1 or P2 iron requirements.

Challenge report must identify which upstream authority is being challenged.

PPA estimates required with mandatory fields: frequency_mhz, area_gate_count, pixel_rate_mpps, achievable_fps.

Ambiguity Gate (Phase 3)

Apply ambiguity scoring to all new REQ-U-* decisions:

Artifacts saved:

(Per-round review artifacts, Zero-Opens, Open Resolution, Compliance, and Ambiguity gate items: see Final Checklist.)

Mermaid Pipeline Diagram Format

Per diagram policy: use Mermaid for pipeline/flow diagrams (ASCII art prohibited).

flowchart LR
  S0[S0: Fetch] -->|"data[31:0]"| S1[S1: Decode]
  S1 -->|"op[7:0], operands"| S2[S2: Execute]
  S2 -->|"result[47:0]"| S3[S3: Writeback]

  S0 -.->|stall| S0
  S2 -.->|forward| S1

Each stage node: SN[SN: stage_name]. Edges: data width annotation.

Stall/forward paths: dashed arrows (-.->).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.