Giter Club home page Giter Club logo

kgp-risc's Introduction

KGP-RISC

A Single-Cycle 32-bit RISC Architecture CPU build using verilog for Artix-7 FPGA. Complete FPGA working project is avaliable in KGP-RISC directory.

Modules

Module Description
KGP_RISC.v Top module to control all other modules.
ALU.v Module to perform arithmetic operations only.

Modules used under ALU.v are :
1) Arithmetic_Barrel_Right_Shifter.v,
2) Barrel_Shifter.v,
3) hybrid_adder.v,
4) MUX_2x1.v,
5) twos_complement.v,
6) twos_complement_64.v,
7) Combinational_32x32_Multiplier.v
branch.v Perform all the logical operations for branching instructions.
assignInputs.v Module provides modified and appropriate sign extended input to ALU module depending upon OPCODE and FCODE.
InstDecode.v This module decodes 32-bit instruction input to generate opcode, fcode, rs, rt, imm, shamt, etc.
InstrFetch.v Gets instruction from Block-RAM (BRAM) using Program Counter (PC) and decides next PC depending upon braching condition.
regBank.v This module contains 32 32-bit registers that we will use to write our MIPS program. Assignment of registers_name to corresponding register_number in regBank is provided in Instruction_Fromat_and_Decodings.pdf file.
writeAddress.v This module provides address(register number), data, and control signal for instructions involving register write/update.
intmem.coe Stores 32-bit program instructions. Used when creating BRAM.
__.tb Test Bench for corresponding __.v file

Usage Information

  • Register $t0 (register number 8 or r[7]) is used to output final result.
  • Block RAM 1(blk_mem_gen_v7_3.v) is used to store 32-bit program instructions. This module is generated by Core Generator using intmem.coe .
  • Block RAM 2(blk_mem_gen_v7_3b.v) is initialised empty and used as ROM to store input data like array during program execution. This module is also generated by Core Generator.
  • Use Target_Code_Generator.ipynb module to generate 32-bit instructions from assembly code. Instructions are generated according to the Instruction Format and Decodings.

NOTE :

  • Create Block RAM 1 using core generator first then import all the other __.v and __.tb modules using Add source to your project. Before importing KGP_RISC_ucf.ucf make sure to set KGP_RISC.v as top module.
  • blk_mem_gen_v7_3.v and blk_mem_gen_v7_3b.v are just a verilog modules accessing BRAM.

Schematic Diagram

Sample Test File

MIPS Assembly code and corresponding Instruction Memory

Simulation

Linear Search Simulation

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.