Skip to content

A 5 stage-pipeline RV32I implementation in VHDL (modified to run on Vivado, fixed several bugs)

License

Notifications You must be signed in to change notification settings

mkozden/maestro_fix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a fork of the original repo, that has been modified to run on Xilinx Vivado.

There are also several fixes, including:

  • Fixed control unit, which lacked sign-extending for immediates in several places, and also had a typo in the decoding of the branch instructions
  • Fixed the data memory controller, which was decoding the data format (Word, Byte, Halfword etc.) incorrectly
  • The core was skipping the instruction immediately following a branch/jump, so I added a -4 offset to the Jump Target Unit

The readme for the original repo is below:

Maestro

This repository contains a 5 stage pipeline implementation of the RV32I ISA strongly inspired by David Patterson's and John Hennessy's Computer Organization and Design RISC-V Edition. The project is entirely academic, it was delevoped at Rio Grande do Norte's Federal University in Brazil and it does not aim to be competitive against complex implementations. The rationale behind it was basically learning about RISC-V, the ISA, and processor design in general. If you want to deploy a RISC-V core, I strongly recommend using a fully-featured and tested core instead.

Current Design

  • Entirely written in VHDL.
  • 5-stage pipeline.
  • Not designed with multiple RISC-V harts in mind, the memory model is relaxed.
  • The privileged ISA is not implemented.
  • FENCE, FENCE.I and CSR instructions are not implemented.
  • Unimplemented instructions (including extensions) will be executed as NOPs.

User Guide

  • The repository contains a Quartus Prime 18.1 project file.
  • The repository contains Altera memory files generated for the Cyclone IV GX FPGA. If you wish to use it on a different Altera FPGA you'll have to use the Megawizard plug-in manager to reconfigure them.
  • Progmem.mif comes with a simple fibonacci program for quick debugging.
  • Outputs that start with "debug" are not mandatory and only exist to make debugging easier.

Inconveniences

  • If you want to run compiled code, Sifive's elf2hex might help. The core, however, is only intended to be used academically and writing assembly or even the machine code yourself is usually reasonable for super simple programs.
  • The processor does not have any output. Use the debug output or load to memory to move data out of it.

Simplified Schematic

Schematic

About

A 5 stage-pipeline RV32I implementation in VHDL (modified to run on Vivado, fixed several bugs)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • VHDL 97.2%
  • Verilog 2.4%
  • Other 0.4%