The repository contains the source code for a single cycle processor designed to run the RISC-V 32-bit base intruction set (RV32I).
The processor is interfaced with UART to communicate with a computer so that the content of the registers, data memory or instruction memory can be observed, and modified.
The source code is found in the src
folder.
-
src/single_cycle_processor
- Verilog files for the processor -
src/uart
- Verilog files for UART communication -
src/top_single_cycle_processor_quartus.v
- Top level entity for the Quartus project
To do simulation as described below, Icarus Verilog and GTKWave are required.
Once installed, follow these steps to run simulation. Otherwise, you are free to use any simulation tool you prefer.
Note that you should start executing commands from the repository root.
-
cd src/single_cycle_processor/src
-
iverilog -g2012 -o ../sim/processor_tb ../sim/processor_tb.sv control.v control_main_decoder.v control_alu_decoder.v pc.v adder.sv imem.v register_file.v extend.v alu.v data_memory.v
-
cd ../sim
-
vvp processor_tb
-
gtkwave processor_tb.vcd
- Clone the repository with
--recursive
flag, so that all submodules are also cloned.
git clone --recursive https://github.com/RISC-Processor/Single-Cycle-Processor.git
- Add
bin
folder of your Quartus installation to thePATH
(System Variables). For example:
set PATH=C:\intelFPGA\<VERSION>\quartus\bin;%PATH%
In Windows, use
Git Bash
, since Command Prompt/ PowerShell does not support the above command. Or do it manually.
- In repo root, execute the following line to build the Quartus project.
./Hog/Do CREATE single_cycle_processor_quartus
In Windows, use
Git Bash
, since Command Prompt/ PowerShell does not support the above command.
- Navigate to
Projects/single_cycle_processor_quartus
folder and opensingle_cycle_processor_quartus.qpf
.