How vivaansh001/risc-v-cpu works
This repository is a Verilog RV32I processor project: its product workflow is executing instruction programs on either a pipelined or single-cycle core, with memory access routed through a shared interface and a SoC wrapper extending the core with UART MMIO. The README also describes reusable Verilog learning building blocks and the pipeline’s forwarding and hazard handling. Source excerpts were limited to the README and encoder; relationships among RTL modules below are therefore included only where the README explicitly documents them, and other connections are omitted rather than inferred.
Main entry points: core_pipelined.v Pipelined core · mem_interface.v Memory interface · core.v Single-cycle core · soc.v SoC wrapper
Components 16
CPU cores
- Single-cycle core
rtl/core/core.v - Pipelined core
rtl/core/core_pipelined.v
Pipeline control
- Pipeline registers
rtl/core/if_id_reg.v - Forwarding unit
rtl/core/forwarding_unit.v - Hazard detection
rtl/core/hazard_detect.v
Memory and I/O
- Memory interface
rtl/core/mem_interface.v - Instruction memory
rtl/core/instr_mem.v - Data memory
rtl/core/data_mem.v - UART MMIO
rtl/core/uart_mmio.v - UART transmitter
rtl/core/uart_tx.v - UART receiver
rtl/core/uart_rx.v
System integration
- SoC wrapper
rtl/soc/soc.v
Logic foundations
- Verilog building blocks
verilog-fundamentals
Other components
- Program author
- Encoded program
- Instruction encoder
programs/encoder/encoder.py
Connections 14
- Program author → Instruction encoder: encodes instructions
programs/encoder/encoder.py - Instruction encoder → Encoded program: writes hex program
programs/encoder/encoder.py - Encoded program → Single-cycle core: loads instructions
README.md - Encoded program → Pipelined core: loads instructions
README.md - Single-cycle core → Memory interface: accesses memory
README.md - Pipelined core → Memory interface: accesses memory
README.md - Pipelined core → Pipeline registers: separates stages
README.md - Pipelined core → Forwarding unit: uses forwarding
README.md - Pipelined core → Hazard detection: detects hazards
README.md - Memory interface → Data memory: routes RAM accesses
README.md - Memory interface → UART transmitter: routes UART writes
README.md - SoC wrapper → Single-cycle core: integrates core
- SoC wrapper → Pipelined core: integrates core
- Verilog building blocks → Single-cycle core: foundation for
README.md