# anisettisathvik/ddr4-controller-verification architecture

> Architecture diagram of the GitHub repository anisettisathvik/ddr4-controller-verification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anisettisathvik/ddr4-controller-verification
- Repository: https://github.com/anisettisathvik/ddr4-controller-verification

## Overview

This repository combines a DDR4-2400 controller with an extensive verification and coverage-closure system. Its central workflow is to generate traffic, execute seeded simulations, collect functional coverage and failures, then use regression or search/LLM agents to find uncovered state bins; sealed-set triage investigates seeded defects. The README documents the controller’s FR-FCFS scheduling, timing enforcement, refresh handling, reference model, assertions, and three coverage models. Several RTL and verification links below follow those explicit descriptions; their source implementations were not sampled.

Main entry points: [`rtl/scheduler.sv`](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/scheduler.sv) (FR-FCFS Scheduler), [`regress/simlib.py`](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/regress/simlib.py) (Simulation Runner), [`rtl/dram_ctrl_top.sv`](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/dram_ctrl_top.sv) (Controller Top), [`agent/llm_agent.py`](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/llm_agent.py) (LLM Agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controller["DDR4 Controller"]
  node_top["Controller Top<br/>[dram_ctrl_top.sv]"]
  node_scheduler["FR-FCFS Scheduler<br/>[scheduler.sv]"]
  node_buffer["Request Buffer<br/>[req_buffer.sv]"]
  node_bank["Bank Timing<br/>[bank_tracker.sv]"]
  node_group_timing["Group Timing<br/>[group_timing.sv]"]
  node_device["Device Timing<br/>[device_timing.sv]"]
  node_refresh["Refresh Control<br/>[refresh_ctrl.sv]"]
  node_package["DRAM Parameters<br/>[dram_pkg.sv]"]
end

subgraph group_verification["Verification Models"]
  node_reference["Reference Model<br/>[dram_ref_model.sv]"]
  node_assertions["Timing Assertions<br/>[dram_timing_sva.sv]"]
  node_unit_tests["Unit Testbenches"]
  node_uvm["UVM Tests"]
  node_coverage["Coverage Models<br/>[dram_coverage.svh]"]
end

subgraph group_simulation["Simulation Runs"]
  node_simlib["Simulation Runner<br/>[simlib.py]"]
  node_regression["Seeded Regression<br/>[run_regress.py]"]
  node_mutation["Mutation Harness<br/>[mutate.sh]"]
end

subgraph group_analysis["Coverage Analysis"]
  node_coverage_union["Coverage Union<br/>[merge_cov.py]"]
end

subgraph group_agents["Closure Agents"]
  node_search["Random Search<br/>[search_agent.py]"]
  node_llm_agent["LLM Agent<br/>[llm_agent.py]"]
  node_loop["Shared Agent Loop<br/>[loop.py]"]
  node_llm_api["LLM Provider API<br/>[llm_api.py]"]
  node_claude["Claude Backend<br/>[claude_api.py]"]
  node_gemini["Gemini Backend<br/>[gemini_api.py]"]
  node_triage["Defect Triage<br/>[triage.py]"]
end

node_user(("Engineer"))
node_llm_service(("LLM Service"))

node_user -->|"starts runs"| node_regression
node_user -->|"starts search"| node_search
node_user -->|"starts agent"| node_llm_agent
node_top -.->|"dispatches scheduling"| node_scheduler
node_scheduler -.->|"selects requests"| node_buffer
node_scheduler -.->|"checks bank timing"| node_bank
node_scheduler -.->|"checks group timing"| node_group_timing
node_scheduler -.->|"checks device timing"| node_device
node_scheduler -.->|"drains refresh"| node_refresh
node_top -->|"binds assertions"| node_assertions
node_reference -.->|"checks behavior"| node_unit_tests
node_unit_tests -.->|"exercises controller"| node_top
node_uvm -.->|"exercises controller"| node_top
node_uvm -.->|"emits coverage"| node_coverage
node_regression -->|"runs simulations"| node_simlib
node_simlib -.->|"runs tests"| node_uvm
node_simlib -.->|"collects coverage"| node_coverage
node_mutation -.->|"uses simulation"| node_simlib
node_coverage_union -->|"unions bins"| node_coverage
node_search -->|"proposes knobs"| node_loop
node_llm_agent -->|"proposes knobs"| node_loop
node_loop -->|"runs experiments"| node_simlib
node_llm_agent -->|"requests proposals"| node_llm_api
node_triage -->|"collects failures"| node_simlib
node_llm_api -->|"selects backend"| node_claude
node_llm_api -->|"selects backend"| node_gemini
node_claude -->|"calls API"| node_llm_service
node_gemini -->|"calls API"| node_llm_service

click node_top "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/dram_ctrl_top.sv"
click node_scheduler "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/scheduler.sv"
click node_buffer "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/req_buffer.sv"
click node_bank "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/bank_tracker.sv"
click node_group_timing "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/group_timing.sv"
click node_device "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/device_timing.sv"
click node_refresh "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/refresh_ctrl.sv"
click node_package "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/dram_pkg.sv"
click node_reference "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/ref/dram_ref_model.sv"
click node_assertions "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/sva/dram_timing_sva.sv"
click node_unit_tests "https://github.com/anisettisathvik/ddr4-controller-verification/tree/master/tb"
click node_uvm "https://github.com/anisettisathvik/ddr4-controller-verification/tree/master/tb/uvm"
click node_coverage "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/tb/uvm/dram_coverage.svh"
click node_simlib "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/regress/simlib.py"
click node_regression "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/regress/run_regress.py"
click node_mutation "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/mutate.sh"
click node_coverage_union "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/merge_cov.py"
click node_search "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/search_agent.py"
click node_llm_agent "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/llm_agent.py"
click node_loop "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/loop.py"
click node_llm_api "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/llm_api.py"
click node_claude "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/claude_api.py"
click node_gemini "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/gemini_api.py"
click node_triage "https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/triage.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_top,node_scheduler,node_buffer,node_bank,node_group_timing,node_device,node_refresh,node_package toneBlue
class node_reference,node_assertions,node_unit_tests,node_uvm,node_coverage toneAmber
class node_simlib,node_regression,node_mutation toneMint
class node_coverage_union toneRose
class node_search,node_llm_agent,node_loop,node_llm_api,node_claude,node_gemini,node_triage,node_user,node_llm_service toneIndigo
```

## Components

### DDR4 Controller

- [Controller Top](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/dram_ctrl_top.sv): `rtl/dram_ctrl_top.sv`
- [FR-FCFS Scheduler](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/scheduler.sv): `rtl/scheduler.sv`
- [Request Buffer](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/req_buffer.sv): `rtl/req_buffer.sv`
- [Bank Timing](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/bank_tracker.sv): `rtl/bank_tracker.sv`
- [Group Timing](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/group_timing.sv): `rtl/group_timing.sv`
- [Device Timing](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/device_timing.sv): `rtl/device_timing.sv`
- [Refresh Control](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/refresh_ctrl.sv): `rtl/refresh_ctrl.sv`
- [DRAM Parameters](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/rtl/dram_pkg.sv): `rtl/dram_pkg.sv`

### Verification Models

- [Reference Model](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/ref/dram_ref_model.sv): `ref/dram_ref_model.sv`
- [Timing Assertions](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/sva/dram_timing_sva.sv): `sva/dram_timing_sva.sv`
- [Unit Testbenches](https://github.com/anisettisathvik/ddr4-controller-verification/tree/master/tb): `tb`
- [UVM Tests](https://github.com/anisettisathvik/ddr4-controller-verification/tree/master/tb/uvm): `tb/uvm`
- [Coverage Models](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/tb/uvm/dram_coverage.svh): `tb/uvm/dram_coverage.svh`

### Simulation Runs

- [Simulation Runner](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/regress/simlib.py): `regress/simlib.py`
- [Seeded Regression](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/regress/run_regress.py): `regress/run_regress.py`
- [Mutation Harness](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/mutate.sh): `mutate.sh`

### Coverage Analysis

- [Coverage Union](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/merge_cov.py): `merge_cov.py`

### Closure Agents

- [Random Search](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/search_agent.py): `agent/search_agent.py`
- [LLM Agent](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/llm_agent.py): `agent/llm_agent.py`
- [Shared Agent Loop](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/loop.py): `agent/loop.py`
- [LLM Provider API](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/llm_api.py): `agent/llm_api.py`
- [Claude Backend](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/claude_api.py): `agent/claude_api.py`
- [Gemini Backend](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/gemini_api.py): `agent/gemini_api.py`
- [Defect Triage](https://github.com/anisettisathvik/ddr4-controller-verification/blob/master/agent/triage.py): `agent/triage.py`

### Other components

- **Engineer**
- **LLM Service**

## Connections

- Engineer → Seeded Regression: starts runs (evidence: `README.md`)
- Engineer → Random Search: starts search (evidence: `README.md`)
- Engineer → LLM Agent: starts agent (evidence: `README.md`)
- Controller Top → FR-FCFS Scheduler: dispatches scheduling
- FR-FCFS Scheduler → Request Buffer: selects requests
- FR-FCFS Scheduler → Bank Timing: checks bank timing
- FR-FCFS Scheduler → Group Timing: checks group timing
- FR-FCFS Scheduler → Device Timing: checks device timing
- FR-FCFS Scheduler → Refresh Control: drains refresh
- Controller Top → Timing Assertions: binds assertions (evidence: `README.md`)
- Reference Model → Unit Testbenches: checks behavior (evidence: `README.md`)
- Unit Testbenches → Controller Top: exercises controller (evidence: `README.md`)
- UVM Tests → Controller Top: exercises controller (evidence: `README.md`)
- UVM Tests → Coverage Models: emits coverage (evidence: `README.md`)
- Seeded Regression → Simulation Runner: runs simulations (evidence: `regress/run_regress.py`)
- Simulation Runner → UVM Tests: runs tests (evidence: `README.md`)
- Simulation Runner → Coverage Models: collects coverage (evidence: `README.md`)
- Mutation Harness → Simulation Runner: uses simulation (evidence: `README.md`)
- Coverage Union → Coverage Models: unions bins (evidence: `merge_cov.py`)
- Random Search → Shared Agent Loop: proposes knobs (evidence: `agent/search_agent.py`)
- LLM Agent → Shared Agent Loop: proposes knobs (evidence: `agent/llm_agent.py`)
- Shared Agent Loop → Simulation Runner: runs experiments (evidence: `agent/loop.py`)
- LLM Agent → LLM Provider API: requests proposals (evidence: `agent/llm_agent.py`)
- Defect Triage → Simulation Runner: collects failures (evidence: `agent/triage.py`)
- LLM Provider API → Claude Backend: selects backend (evidence: `agent/llm_api.py`)
- LLM Provider API → Gemini Backend: selects backend (evidence: `agent/llm_api.py`)
- Claude Backend → LLM Service: calls API (evidence: `agent/claude_api.py`)
- Gemini Backend → LLM Service: calls API (evidence: `agent/gemini_api.py`)
