Go to file
Luke Wren 155d3ba554 Tie off 1 or 2 LSBs of DPC depending on IALIGN 2021-07-23 23:09:03 +01:00
doc Add RISC-V debug tests 2021-07-22 17:50:04 +01:00
example_soc Tweaks to example soc configuration 2021-07-23 23:08:23 +01:00
hdl Tie off 1 or 2 LSBs of DPC depending on IALIGN 2021-07-23 23:09:03 +01:00
scripts@53af1540e5 Add RISC-V debug tests 2021-07-22 17:50:04 +01:00
test Add RISC-V debug tests 2021-07-22 17:50:04 +01:00
.gitmodules Add RISC-V debug tests 2021-07-22 17:50:04 +01:00
License Change how constants are plumbed through the hierarchy. Some small cleanups of variable declaration order etc 2021-05-21 03:23:44 +01:00
Readme.md Minor doc updates 2021-07-18 20:45:08 +01:00
sourceme Add simple formal bus properties check 2021-05-30 10:19:42 +01:00

Readme.md

Hazard3

Hazard3 is a 3-stage RISC-V processor, providing the following architectural support:

  • RV32I: 32-bit base instruction set
  • M extension: integer multiply/divide/modulo
  • C extension: compressed instructions
  • Zicsr extension: CSR access
  • M-mode privileged instructions ECALL, EBREAK, MRET
  • The machine-mode (M-mode) privilege state, and standard M-mode CSRs
  • Debug support, compliant with RISC-V debug specification version 0.13.2

You can read the documentation here. (PDF link)

This repository also contains a compliant RISC-V Debug Module for Hazard3, which can be accessed over an AMBA 3 APB port or using the optional JTAG Debug Transport Module.

There is an example SoC integration, showing how these components can be assembled to create a minimal system with a JTAG-enabled RISC-V processor, some RAM and a serial port.

The following are planned for future implementation:

  • Support for WFI instruction
  • A extension: atomic memory access

Hazard3 is still under development.

Pipeline

  • F fetch
    • Instruction fetch data phase
    • Instruction alignment
    • Decode of rs1/rs2 register specifiers into register file read ports
  • X execute
    • Expand compressed instructions
    • Expand immediates
    • Forward appropriate data and decoded operation to ALU or to load/store address phase
    • Resolve branch conditions
    • Instruction fetch address phase
    • Load/store address phase
  • M memory
    • Load/store data phase
    • Some complex instructions, particularly multiply and divide
    • Exception handling

This is essentially Hazard5, with the D and X stages merged and the register file brought forward. Many components are reused directly from Hazard5. The particular focus here is on shortening the branch delay, which is one of the weak points in Hazard5's IPC.