Code Monkey home page Code Monkey logo

risc-v-processor's Introduction

RISC-V-Processor


Logo

Open Source RISC ISA

Verilog implementation of 32-bit RISC-V processor!
Explore the docs »

· Report Bug ·

Table of Contents

About The Project

In this project we implement a 32-bit, RISC-V ISA based processor in verilog. The sub-modules that are used and their interaction with each other are shown in the following picture.



Output waveform using GTKWave:

Project Structure:

  • Each sub-unit that has been created has its own folder in root of the repository.
  • This sub-unit folder comprises of the modules used in that particular unit.
  • Additionally it consists of testbench and waveform used for testing and debugging those modules.
  • The final processor implementation is in the folder called "Processor".
  • This uses all the relevent units created individually and integrates them to give us our working processor.

Tools Used

While there are many compilers for verilog present, not many of them are open source, and even fewer are robust, user-friendly and updated regularly. Icarus Verilog checks all boxes and can be learnt easily with this really helpful wiki setup for it.

Another really powerful open source tool that was essential in building this project was GTKWave. It helps to view vcd and other waveforms. Really important for debugging and understanding if dependencies of different signals are as described by you.

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Setting up instructions

Before we begin to run our processor we must initialize the instruction memory with the desired sequence of instructions that we want to execute. By default 8 instructions are included that will execute in that particular sequence of initialization.

Initializing the register file

In order to implement instructions we must have values in the register to act upon, these values can be initialized in the register file. By default each register is initialized to have a value the same as the register number - 1. Example: Register 14 will have value 13.

Running the processor

Once the above initializations have been done as desired, compile the file "Processor_tb.v" using iverilog using the following command:

  • compilation
iverilog -o gen-compiled "Processor_tb.v"

The above command generates a compile file named as "gen-compile". After compilation we can execute the compiled file using:

  • execution
vvp gen-compiled

Viewing waveform

  1. The waveform generated from testbench is named as "output_wave.vcd"
  2. Use GTKWave to view the waveform file
gtkwave output_wave.vcd

License

Distributed under the MIT License. See LICENSE for more information.

Project Link: https://github.com/ash-olakangal/RISC-V-Processor

risc-v-processor's People

Contributors

ash-olakangal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.