# abdelrhman-oun/ddr5_phy_writeoperation architecture

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

- Interactive diagram: https://gitdiagram.com/abdelrhman-oun/ddr5_phy_writeoperation
- Repository: https://github.com/abdelrhman-oun/ddr5_phy_writeoperation

## Overview

This repository implements a digital DDR5 PHY write datapath: it accepts controller-side commands and write data, converts frequency-ratio phases, emits command/address signals, and transmits write data with CRC protection. The README identifies frequency ratio, command/address, write data, CRC, and register file as major PHY blocks, and describes their integration. It documents key signal handoffs, but source excerpts are unavailable, so internal RTL call details and the register file’s connections are not shown.

Main entry points: [`RTL/ddr5_phy_write_manager.sv`](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_manager.sv) (Write manager), [`RTL/ddr5_phy_top.sv`](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_top.sv) (DDR5 PHY), [`RTL/ddr5_phy_frequency_ratio.sv`](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_frequency_ratio.sv) (Frequency ratio), [`RTL/ddr5_phy_command_address.sv`](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_command_address.sv) (Command address)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["PHY integration"]
  node_phy["DDR5 PHY<br/>[ddr5_phy_top.sv]"]
  node_frequency["Frequency ratio"]
end

subgraph group_command["Command path"]
  node_command_address["Command address"]
end

subgraph group_write["Write datapath"]
  node_write_manager["Write manager"]
  node_write_fsm["Write FSM"]
  node_write_shift["Write shift"]
  node_write_counter["Write counters"]
end

subgraph group_crc["CRC protection"]
  node_crc["CRC generator<br/>[ddr5_phy_crc.sv]"]
  node_crc_x4["CRC x4 variant<br/>[ddr5_phy_crc_x4.sv]"]
end

subgraph group_config["PHY configuration"]
  node_register_file[("Register file")]
end

node_controller(("Memory controller"))
node_dram(("DDR5 DRAM"))

node_controller -->|"sends signals"| node_phy
node_phy -->|"integrates"| node_frequency
node_phy -->|"integrates"| node_command_address
node_phy -->|"integrates"| node_write_manager
node_phy -->|"integrates"| node_crc
node_phy -->|"integrates"| node_register_file
node_frequency -->|"provides commands"| node_command_address
node_frequency -->|"provides data"| node_write_manager
node_write_manager -->|"sends data"| node_crc
node_write_manager -->|"contains"| node_write_fsm
node_write_manager -->|"contains"| node_write_shift
node_write_manager -->|"contains"| node_write_counter
node_command_address -->|"drives CA and CS"| node_dram
node_write_manager -->|"drives DQ and DM"| node_dram

click node_phy "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_top.sv"
click node_frequency "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_frequency_ratio.sv"
click node_command_address "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_command_address.sv"
click node_write_manager "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_manager.sv"
click node_write_fsm "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_fsm.sv"
click node_write_shift "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_shift.sv"
click node_write_counter "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_counter.sv"
click node_crc "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_crc.sv"
click node_crc_x4 "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_crc_x4.sv"
click node_register_file "https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_register_file.sv"

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_phy,node_frequency toneBlue
class node_command_address toneAmber
class node_write_manager,node_write_fsm,node_write_shift,node_write_counter toneMint
class node_crc,node_crc_x4 toneRose
class node_register_file,node_controller,node_dram toneIndigo
```

## Components

### PHY integration

- [DDR5 PHY](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_top.sv): `RTL/ddr5_phy_top.sv`
- [Frequency ratio](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_frequency_ratio.sv): `RTL/ddr5_phy_frequency_ratio.sv`

### Command path

- [Command address](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_command_address.sv): `RTL/ddr5_phy_command_address.sv`

### Write datapath

- [Write manager](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_manager.sv): `RTL/ddr5_phy_write_manager.sv`
- [Write FSM](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_fsm.sv): `RTL/ddr5_phy_write_fsm.sv`
- [Write shift](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_shift.sv): `RTL/ddr5_phy_write_shift.sv`
- [Write counters](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_write_counter.sv): `RTL/ddr5_phy_write_counter.sv`

### CRC protection

- [CRC generator](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_crc.sv): `RTL/ddr5_phy_crc.sv`
- [CRC x4 variant](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_crc_x4.sv): `RTL/ddr5_phy_crc_x4.sv`

### PHY configuration

- [Register file](https://github.com/abdelrhman-oun/ddr5_phy_writeoperation/blob/main/RTL/ddr5_phy_register_file.sv): `RTL/ddr5_phy_register_file.sv`

### Other components

- **Memory controller**
- **DDR5 DRAM**

## Connections

- Memory controller → DDR5 PHY: sends signals (evidence: `README.md`)
- DDR5 PHY → Frequency ratio: integrates (evidence: `README.md`)
- DDR5 PHY → Command address: integrates (evidence: `README.md`)
- DDR5 PHY → Write manager: integrates (evidence: `README.md`)
- DDR5 PHY → CRC generator: integrates (evidence: `README.md`)
- DDR5 PHY → Register file: integrates (evidence: `README.md`)
- Frequency ratio → Command address: provides commands (evidence: `README.md`)
- Frequency ratio → Write manager: provides data (evidence: `README.md`)
- Write manager → CRC generator: sends data (evidence: `README.md`)
- Write manager → Write FSM: contains (evidence: `README.md`)
- Write manager → Write shift: contains (evidence: `README.md`)
- Write manager → Write counters: contains (evidence: `README.md`)
- Command address → DDR5 DRAM: drives CA and CS (evidence: `README.md`)
- Write manager → DDR5 DRAM: drives DQ and DM (evidence: `README.md`)
