# angelojacobo/uberddr3 architecture

> Architecture diagram of the GitHub repository angelojacobo/uberddr3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/angelojacobo/uberddr3
- Repository: https://github.com/angelojacobo/uberddr3

## Overview

##### Main Components
- DDR3 Controller Core:
– The central module (rtl/ddr3_top.v) instantiates the DDR3 controller.
– Within it, include sub-modules showing the high-level control path (command issuing, timing/delay tracking, reset and refresh logic).
– Highlight calibration components: PHY calibration (bitslip training, read/write alignment), command sequencing, and built-in self-test.
– Include the ECC/SECDEC unit as an optional processing block for error correction.
- Interface Blocks:
– Primary Wishbone Interface that links to the controller.
– Optional second-wishbone/debug interface.
– AXI4 interface (discussed in the README/blog posts) which may later be integrated.
- External Memory & I/O:
– Show the connection to the physical DDR3 memory via the DDR3 I/O ports (data lines, clocks, command signals, and associated constraint files).
– Include clock generation blocks (PLL/oscillator) that provide i_controller_clk, i_ddr3_clk, i_ref_clk, and optionally i_ddr3_clk_90.
- Simulation & Verification Environment:
– A simulation testbench block that instantiates the DDR3 memory controller with the Micron DDR3 model (as seen in testbench/).
– A formal verification block that refers to the SBY scripts in the formal folder.
- Demo Projects:
– A collection of board-specific demo projects (example_demo folders for various boards such as Arty-S7, Nexys Video, QMTech, etc.) that illustrate how the DDR3 controller is integrated and used.

##### Component Relationships and Data Flow
- Feedback loops such as calibration feedback from the PHY calibration block and error correction signals.
- Connection of clock generation blocks to both the controller and DDR3 interface.

##### Important Architectural Patterns and Principles
- Modularity: separate modules for interfaces (Wishbone, optional second-wishbone) and processing (controller logic, PHY calibration, ECC).
- Configurable nature of the design – note that many parameters (clock periods, address widths, lane configurations, etc.) are defined at the top level.

##### Relevant Technologies and Tools
- Under “RTL”, list key Verilog modules and IP cores (e.g., ddr3_controller.v, ECC modules, AXI bus wrappers).
- Under “Testbench/Simulation”, include the Micron DDR3 simulation model, Icarus Verilog/Yosys lint flows, and the run_compile.sh script.
- Under “Formal Verification”, indicate that SBY (Symbiyosys) scripts are used.
- If needed, mention that Vivado and OpenXC7 are used for synthesis on real FPGA boards.

##### Summary
– At the center: the generic memory controller IP.
– At the input side: interfaces (Wishbone/AXI) along with clock/reset logic.
– At the output side: an abstraction of the DDR3 physical interface.
– Additionally, show parallel branches for simulation/testbench and formal verification flows.
– Finally, reference how demo projects tie the abstract design into concrete board implementations with specific constraints files and vendor tools.

## Diagram (Mermaid)

```mermaid
graph TD
    A["Host/FPGA Logic"]:::interface

    subgraph "Interface Blocks"
        B1["Wishbone Interface"]:::interface
        B2["AXI4 Interface"]:::interface
    end

    A --> B1
    A --> B2
    B1 --> C["DDR3 Controller Core"]:::core
    B2 --> C

    C --> D["PHY Calibration & Self-Test"]:::core
    C --> E["ECC/SECDEC Module"]:::core
    D -- "calibration_feedback" --> C

    C --> F["Clock Generation & DDR3 I/O"]:::clock
    F --> G["External DDR3 Memory"]:::memory

    H["Simulation Testbench Environment"]:::sim
    I["Formal Verification Environment"]:::verification

    H --- C
    I --- C

    J["Demo Projects / Board-Level Integration"]:::demo
    J --> C

    K["Vivado Custom IP Package"]:::vivado
    K --> C

    %% Click Events for DDR3 Controller Core
    click C "https://github.com/angelojacobo/uberddr3/blob/main/rtl/ddr3_top.v"
    click C "https://github.com/angelojacobo/uberddr3/blob/main/rtl/ddr3_controller.v"
    click C "https://github.com/angelojacobo/uberddr3/blob/main/rtl/ddr3_phy.v"
    %% Click event for ECC/SECDEC Module
    click E "https://github.com/angelojacobo/uberddr3/tree/main/rtl/ecc/"
    %% Click Event for PHY Calibration & Self-Test
    click D "https://github.com/angelojacobo/uberddr3/blob/main/rtl/ddr3_phy.v"
    %% Click Event for AXI4 Interface
    click B2 "https://github.com/angelojacobo/uberddr3/tree/main/rtl/axi/"
    %% Click Events for Clock Generation & DDR3 I/O
    click F "https://github.com/angelojacobo/uberddr3/blob/main/example_demo/*/clk_wiz.v"
    click F "https://github.com/angelojacobo/uberddr3/blob/main/rtl/spd/spd_clk_wiz.v"
    %% Click Event for Simulation Testbench Environment
    click H "https://github.com/angelojacobo/uberddr3/tree/main/testbench/"
    %% Click Event for Formal Verification Environment
    click I "https://github.com/angelojacobo/uberddr3/tree/main/formal/"
    %% Click Event for Demo Projects
    click J "https://github.com/angelojacobo/uberddr3/tree/main/example_demo/"
    %% Click Event for Vivado Custom IP Package
    click K "https://github.com/angelojacobo/uberddr3/tree/main/vivado_custom_ip/"

    %% Style Definitions
    classDef core fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef interface fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef clock fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef memory fill:#d0f0c0,stroke:#333,stroke-width:2px;
    classDef sim fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef verification fill:#f5d6ba,stroke:#333,stroke-width:2px;
    classDef demo fill:#d1ecf1,stroke:#333,stroke-width:2px;
    classDef vivado fill:#e2e3e5,stroke:#333,stroke-width:2px;
```
