Giter Site home page Giter Site logo

gbalaratnaswamy / risc_v_model_1 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 315 KB

This repo is implementation of 32 bit RISC -V based processor in verilog with 5 stage pipelining

License: MIT License

Verilog 91.04% SystemVerilog 8.96%
verilog risc-v microprocessor

risc_v_model_1's Introduction

RISC-V MicroProcessor

This repo contains verilog implementation of RISC-V 32-bit architecture based processor. It is implemented as Pipelining model and it has 5 pipelined stages.

This has 5 stages in pipelining named

  1. Instruction Fetch
  2. Instruction Decode
  3. Instruction Excecute
  4. Memory access
  5. Write Back

Pipelining block diagram

RISC-V architecture

Instruction Set

Following Instructions are implemented

R32I Base Instruction set:

Instruction Instruction Type opcode fun3 fun7
LUI U-type 0110111
AUIPC U-type 0010111
JAL UJ-type 1101111
JALR I-type 1100111 000
BEQ SB-type 1100011 000
BNE SB-type 1100011 001
BLT SB-type 1100011 100
BGT SB-type 1100011 101
BLTU SB-type 1100011 110
BGTU SB-type 1100011 111
LB I-type 0000011 000
LH I-type 0000011 001
LW I-type 0000011 010
LBU I-type 0000011 100
LHU I-type 0000011 101
SB S-type 0100011 000
SH S-type 0100011 001
SW S-type 0100011 010
ADDI I-type 0010011 000
SLTI I-type 0010011 010
SLTIU I-type 0010011 011
XORI I-type 0010011 100
ORI I-type 0010011 110
ANDI I-type 0010011 111
SLLI I-type 0010011 001
SRLI I-type 0010011 101
SRAI I-type 0010011 101
ADD R-type 0110011 000 0000000
SUB R-type 0110011 000 1000000
SLL R-type 0110011 001 0000000
SLT R-type 0110011 010 0000000
SLTU R-type 0110011 011 0000000
XOR R-type 0110011 100 0000000
SRL R-type 0110011 101 0000000
SRA R-type 0110011 101 1000000
OR R-type 0110011 110 0000000
AND R-type 0110011 111 0000000

M Standard Extension

Instruction Instruction Type opcode fun3 fun7
MUL R-type 0110011 000 0000001
MULH R-type 0110011 001 0000001
MULHSU R-type 0110011 010 0000001
MULHU R-type 0110011 011 0000001
DIV R-type 0110011 100 0000001
DIVU R-type 0110011 101 0000001
REM R-type 0110011 110 0000001
REMU R-type 0110011 111 0000001

future plans

  • Implement forwarding for avoiding pipelining hazard
  • Implement stalling
  • Optimise Muliplication, Division and remainder operations
  • Add CSR and its instructions
  • Implement interrupts
  • Implement Floating Point operations
  • Support for Compressed instruction standard
  • Support for atomic instructions
  • Implement caching
  • Make single RAM for instruction and data memory (modified Harvard model)
  • Optimization

risc_v_model_1's People

Contributors

gbalaratnaswamy avatar

Stargazers

 avatar

Watchers

 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.