# sequencer/rocket architecture

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

- Interactive diagram: https://gitdiagram.com/sequencer/rocket
- Repository: https://github.com/sequencer/rocket

## Overview

Rocket is a RISC-V processor core being refactored from rocket-chip into a more independent Chisel project; this tree is the diplomatic integration side. Its main runtime path is instruction fetch, buffering and decode, execution and control, then memory access and retirement, hosted in a tile that connects the core to caches, translation, interrupts, and optional coprocessors. The README also describes planned decoupled bus interfaces and online cosimulation, but those implementations are not established by the sampled sources. Edges below are limited to explicit excerpts or SOURCE INDEX references.

Main entry points: [`diplomatic/src/rocket/RocketCore.scala`](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/RocketCore.scala) (Rocket core), [`diplomatic/src/tile/RocketTile.scala`](https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/RocketTile.scala) (Rocket tile), [`diplomatic/src/rocket/Frontend.scala`](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Frontend.scala) (Frontend), [`diplomatic/src/rocket/IDecode.scala`](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/IDecode.scala) (Instruction decode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tile["Tile Integration"]
  node_tile["Rocket tile<br/>[RocketTile.scala]"]
  node_bus["TileLink fabric<br/>[BaseTile.scala]"]
  node_interrupts["Interrupt handling<br/>[Interrupts.scala]"]
  node_buserror["Bus error unit<br/>[BusErrorUnit.scala]"]
  node_scratchpad["Scratchpad port"]
end

subgraph group_pipeline["Core Pipeline"]
  node_core["Rocket core<br/>[RocketCore.scala]"]
  node_frontend["Frontend<br/>[Frontend.scala]"]
  node_ibuf["Instruction buffer<br/>[IBuf.scala]"]
  node_decode["Instruction decode<br/>[IDecode.scala]"]
  node_instructions["Instruction encodings<br/>[Instructions.scala]"]
  node_instructions32["32-bit encodings"]
  node_csr["CSR and traps<br/>[CSR.scala]"]
  node_customcsr["Custom CSRs<br/>[CustomCSRs.scala]"]
end

subgraph group_memory["Memory System"]
  node_icache["Instruction cache<br/>[ICache.scala]"]
  node_dcache["Data cache<br/>[DCache.scala]"]
  node_hellacache["Cache interface<br/>[HellaCache.scala]"]
  node_tlb["Address translation<br/>[TLB.scala]"]
  node_ptw["Page-table walker<br/>[PTW.scala]"]
end

subgraph group_execution["Execution Units"]
  node_fpu["Floating point<br/>[FPU.scala]"]
  node_muldiv["Multiply and divide<br/>[Multiplier.scala]"]
  node_rocc["RoCC coprocessors<br/>[LazyRoCC.scala]"]
end

subgraph group_simulation["Simulation Interface"]
  node_emulator["Verilator emulator<br/>[emulator.cc]"]
  node_jtag["Remote bitbang<br/>[remote_bitbang.cc]"]
end

node_program(("RISC-V program"))
node_debugger(("OpenOCD / GDB"))

node_program -.->|"fetch instructions"| node_frontend
node_frontend -->|"requests fetches"| node_icache
node_frontend -.->|"feeds instructions"| node_ibuf
node_core -->|"consumes buffered instructions"| node_ibuf
node_core -.->|"decodes instructions"| node_decode
node_decode -->|"matches encodings"| node_instructions
node_decode -->|"uses encodings"| node_instructions32
node_core -.->|"controls privilege state"| node_csr
node_csr -->|"uses custom CSR definitions"| node_customcsr
node_core -->|"issues arithmetic requests"| node_muldiv
node_core -->|"connects floating point"| node_fpu
node_core -->|"routes coprocessor commands"| node_rocc
node_core -->|"connects fetch interface"| node_frontend
node_core -->|"sends data requests"| node_dcache
node_core -->|"connects translation walk"| node_ptw
node_dcache -->|"uses cache interface"| node_hellacache
node_icache -.->|"translates fetch addresses"| node_tlb
node_dcache -.->|"translates data addresses"| node_tlb
node_ptw -.->|"services page walks"| node_tlb
node_tile -->|"instantiates core"| node_core
node_tile -->|"extends tile fabric"| node_bus
node_tile -->|"connects scratchpad"| node_scratchpad
node_tile -->|"reports cache errors"| node_buserror
node_tile -.->|"integrates interrupts"| node_interrupts
node_emulator -->|"creates debug server"| node_jtag
node_debugger -->|"drives JTAG remotely"| node_jtag

click node_tile "https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/RocketTile.scala"
click node_core "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/RocketCore.scala"
click node_frontend "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Frontend.scala"
click node_ibuf "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/IBuf.scala"
click node_decode "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/IDecode.scala"
click node_instructions "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Instructions.scala"
click node_instructions32 "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Instructions32.scala"
click node_csr "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/CSR.scala"
click node_customcsr "https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/CustomCSRs.scala"
click node_icache "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/ICache.scala"
click node_dcache "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/DCache.scala"
click node_hellacache "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/HellaCache.scala"
click node_tlb "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/TLB.scala"
click node_ptw "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/PTW.scala"
click node_fpu "https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/FPU.scala"
click node_muldiv "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Multiplier.scala"
click node_rocc "https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/LazyRoCC.scala"
click node_bus "https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/BaseTile.scala"
click node_interrupts "https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/Interrupts.scala"
click node_buserror "https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/BusErrorUnit.scala"
click node_scratchpad "https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/ScratchpadSlavePort.scala"
click node_emulator "https://github.com/sequencer/rocket/blob/master/diplomatic/resources/csrc/emulator.cc"
click node_jtag "https://github.com/sequencer/rocket/blob/master/diplomatic/resources/csrc/remote_bitbang.cc"

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_tile,node_bus,node_interrupts,node_buserror,node_scratchpad toneBlue
class node_core,node_frontend,node_ibuf,node_decode,node_instructions,node_instructions32,node_csr,node_customcsr toneAmber
class node_icache,node_dcache,node_hellacache,node_tlb,node_ptw toneMint
class node_fpu,node_muldiv,node_rocc toneRose
class node_emulator,node_jtag,node_program,node_debugger toneIndigo
```

## Components

### Tile Integration

- [Rocket tile](https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/RocketTile.scala): `diplomatic/src/tile/RocketTile.scala`
- [TileLink fabric](https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/BaseTile.scala): `diplomatic/src/tile/BaseTile.scala`
- [Interrupt handling](https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/Interrupts.scala): `diplomatic/src/tile/Interrupts.scala`
- [Bus error unit](https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/BusErrorUnit.scala): `diplomatic/src/tile/BusErrorUnit.scala`
- [Scratchpad port](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/ScratchpadSlavePort.scala): `diplomatic/src/rocket/ScratchpadSlavePort.scala`

### Core Pipeline

- [Rocket core](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/RocketCore.scala): `diplomatic/src/rocket/RocketCore.scala`
- [Frontend](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Frontend.scala): `diplomatic/src/rocket/Frontend.scala`
- [Instruction buffer](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/IBuf.scala): `diplomatic/src/rocket/IBuf.scala`
- [Instruction decode](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/IDecode.scala): `diplomatic/src/rocket/IDecode.scala`
- [Instruction encodings](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Instructions.scala): `diplomatic/src/rocket/Instructions.scala`
- [32-bit encodings](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Instructions32.scala): `diplomatic/src/rocket/Instructions32.scala`
- [CSR and traps](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/CSR.scala): `diplomatic/src/rocket/CSR.scala`
- [Custom CSRs](https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/CustomCSRs.scala): `diplomatic/src/tile/CustomCSRs.scala`

### Memory System

- [Instruction cache](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/ICache.scala): `diplomatic/src/rocket/ICache.scala`
- [Data cache](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/DCache.scala): `diplomatic/src/rocket/DCache.scala`
- [Cache interface](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/HellaCache.scala): `diplomatic/src/rocket/HellaCache.scala`
- [Address translation](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/TLB.scala): `diplomatic/src/rocket/TLB.scala`
- [Page-table walker](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/PTW.scala): `diplomatic/src/rocket/PTW.scala`

### Execution Units

- [Floating point](https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/FPU.scala): `diplomatic/src/tile/FPU.scala`
- [Multiply and divide](https://github.com/sequencer/rocket/blob/master/diplomatic/src/rocket/Multiplier.scala): `diplomatic/src/rocket/Multiplier.scala`
- [RoCC coprocessors](https://github.com/sequencer/rocket/blob/master/diplomatic/src/tile/LazyRoCC.scala): `diplomatic/src/tile/LazyRoCC.scala`

### Simulation Interface

- [Verilator emulator](https://github.com/sequencer/rocket/blob/master/diplomatic/resources/csrc/emulator.cc): `diplomatic/resources/csrc/emulator.cc`
- [Remote bitbang](https://github.com/sequencer/rocket/blob/master/diplomatic/resources/csrc/remote_bitbang.cc): `diplomatic/resources/csrc/remote_bitbang.cc`

### Other components

- **RISC-V program**
- **OpenOCD / GDB**

## Connections

- RISC-V program → Frontend: fetch instructions
- Frontend → Instruction cache: requests fetches (evidence: `diplomatic/src/rocket/Frontend.scala`)
- Frontend → Instruction buffer: feeds instructions
- Rocket core → Instruction buffer: consumes buffered instructions (evidence: `diplomatic/src/rocket/RocketCore.scala`)
- Rocket core → Instruction decode: decodes instructions (evidence: `diplomatic/src/rocket/RocketCore.scala`)
- Instruction decode → Instruction encodings: matches encodings (evidence: `diplomatic/src/rocket/IDecode.scala`)
- Instruction decode → 32-bit encodings: uses encodings (evidence: `diplomatic/src/rocket/IDecode.scala`)
- Rocket core → CSR and traps: controls privilege state
- CSR and traps → Custom CSRs: uses custom CSR definitions (evidence: `diplomatic/src/rocket/CSR.scala`)
- Rocket core → Multiply and divide: issues arithmetic requests (evidence: `diplomatic/src/rocket/RocketCore.scala`)
- Rocket core → Floating point: connects floating point
- Rocket core → RoCC coprocessors: routes coprocessor commands
- Rocket core → Frontend: connects fetch interface
- Rocket core → Data cache: sends data requests
- Rocket core → Page-table walker: connects translation walk
- Data cache → Cache interface: uses cache interface (evidence: `diplomatic/src/rocket/DCache.scala`)
- Instruction cache → Address translation: translates fetch addresses
- Data cache → Address translation: translates data addresses
- Page-table walker → Address translation: services page walks
- Rocket tile → Rocket core: instantiates core (evidence: `diplomatic/src/tile/RocketTile.scala`)
- Rocket tile → TileLink fabric: extends tile fabric (evidence: `diplomatic/src/tile/BaseTile.scala`)
- Rocket tile → Scratchpad port: connects scratchpad (evidence: `diplomatic/src/tile/RocketTile.scala`)
- Rocket tile → Bus error unit: reports cache errors (evidence: `diplomatic/src/tile/RocketTile.scala`)
- Rocket tile → Interrupt handling: integrates interrupts
- Verilator emulator → Remote bitbang: creates debug server (evidence: `diplomatic/resources/csrc/emulator.cc`)
- OpenOCD / GDB → Remote bitbang: drives JTAG remotely
