Skip to content

RISC-Processor/Single-Cycle-Processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Single Cycle Processor for RV32I

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.

  1. src/single_cycle_processor - Verilog files for the processor

  2. src/uart - Verilog files for UART communication

  3. src/top_single_cycle_processor_quartus.v - Top level entity for the Quartus project

Top Level Block Design

Top Level Block Design

Simulation

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.

  1. cd src/single_cycle_processor/src

  2. 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

  3. cd ../sim

  4. vvp processor_tb

  5. gtkwave processor_tb.vcd

Waveform zoomed out

Waveform

Build Project

  1. 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
  1. Add bin folder of your Quartus installation to the PATH (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.

  1. 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.

  1. Navigate to Projects/single_cycle_processor_quartus folder and open single_cycle_processor_quartus.qpf.

About

Single Cycle Non-Pipelined Processor for RV32I.

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •