Code Monkey home page Code Monkey logo

mips-five-stage-cpu's Introduction

README

This is the third project of CSC 3050, Computer Architecture in LGU. A 5-stage pipelined CPU in verilog is implemented in this project.

Project introduction and structure

Below is the file tree of this project:

.
├── ALU.v
├── Adder.v
├── BranchForward.v
├── BranchUnit.v
├── CPU.v
├── ControlUnit.v
├── ForwardingUnit.v
├── HazardUnit.v
├── InstructionRAM.v
├── MainMemory.v
├── RAM_OUTPUT
├── RegisterFile.v
├── SignExtend.v
├── StageRegs.v
├── Suber.v
├── cpu_tb.v
├── cpu_test/
├── makefile
└── readme.md

This project mainly follows the architecture of the implementation of the 5-stage pipelined CPU described in the textbook with a few modifications, which support more instructions(as required):

Data transfer instructions: 
- lw, sw
Arithmetic instructions:
- add, addu, addi, addiu, sub, subu
Logical instructions: 
- and, andi, nor, or, ori, xor, xori
Shifting instructions:
- sll, sllv, srl, srlv, sra, srav
Branch/Jump instructions:
- beq, bne, slt
- j, jr, jal

How to compile and run the testbench

Baically, to compile the project, just type

> make

in your terminal. The test samples were downloaded from the blackboard. To test the 8 samples, type

> make 
> make auto -i

This will test all the eight samples and generate a file DIFFERENCE containing all the outputs generated by diff(I think there is one mistake in the official sample DATA_RAM1.txt in which the output of xori may be wrong).

Specifically, if you want to just test specific sample, you can just type, e.g.,

> make 
> make test1

This will run the diff in the terminal.

Dealing with hazard and forwarding

This project supports data and control forwarding and completes all the basic situations described in the textbook. For more details, you can just refer to the report.

mips-five-stage-cpu's People

Contributors

zhangbaozhe avatar

Stargazers

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