Skip to content

SanujaRupasinghe/single_cycle_riscv_verification_platform

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Single-Cycle RISC-V CPU Framework

Overview

This project provides a framework for implementing a single-cycle RISC-V processor. It is designed as an educational tool, allowing users to practice writing a CPU by completing the missing components. The framework includes a basic structure with memory and a simple testbench, but requires users to implement core functionalities such as the ALU, register file, and control logic.

Features

  • Pre-configured environment for implementing a single-cycle RISC-V CPU.
  • Provided components:
    • Memory module (Instruction & Data Memory)
    • Testbench for simulation
  • Missing components that users need to implement:
    • core (The single cycle cpu to implement)
  • Simple test cases to verify implementation.

Getting Started

Prerequisites

Before using this framework, ensure you have the following tools installed:

Setup Instructions

  1. Clone the repository:
    git clone https://github.com/Kaveesha-98/single_cycle_riscv_verification_platform.git
    cd single_cycle_riscv_verification_platform
  2. Open the project in your preferred development environment and open the file rtl/core.v.
  3. Complete the module core.
  4. Run the simulation using the testbench.
    cd sim/cocotb_env/
    python -m venv venv
    cd riscv_test/
    pip install -r requirements.txt
    make
    (insert file name from target_texts to load instructions)
    gtkwave dump.vcd

Project Structure

├── rtl
│   ├── core.v                # single cycle core to be implemented
│   ├── sim_top.sv            # simulation test bench
│
├── sim/cocotb_env/riscv_test 
│   ├── target_texts          # instructions to be written to memory
│   ├── Makefile              # Makefile
│   ├── requirements.txt      # python venv requirements
│   ├── sim_top.py            # Testbench
│
└── README.md                 # Readme

Contributing

Contributions are welcome! If you have improvements or additional test cases, feel free to submit a pull request.

About

Provides a template to test single cycle riscv cores. Provided test binaries only test for RV32I (no priviledge instruction support)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Verilog 44.7%
  • SystemVerilog 27.0%
  • Python 24.8%
  • Makefile 3.5%