Go to file
Luke Wren 8014239d47 openocd tb: report AHB error response when processor accesses outside of RAM/IO 2021-07-17 19:26:05 +01:00
doc Some doc updates 2021-07-17 13:07:09 +01:00
example_soc Example soc tweaks, add openocd config 2021-07-16 20:44:25 +01:00
hdl DM: don't report as running/halted in dmstatus if unavailable. 2021-07-17 16:46:39 +01:00
scripts@24f0f32b1d Merge stages D and X, and bring all branch resolution into X. Passes RV32I compliance 2021-05-22 07:55:13 +01:00
test openocd tb: report AHB error response when processor accesses outside of RAM/IO 2021-07-17 19:26:05 +01:00
.gitmodules Add simple example SoC, hangs nextpnr for some reason! 2021-07-13 03:40:06 +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 Some doc updates 2021-07-17 13:07:09 +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

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.