Giter Club home page Giter Club logo

mipsprocessor's Introduction

MIPS Processor

In this project, a 32-bit multi-cycle MIPS processor that supports exceptions is implemented in Verilog HDL.

Goals

  1. This machine is designed to be able to execute a variety of instructions in a multicycle implementation.
  2. The multicycle processor should support two types of exceptions: undefined instructions and arithmetic overflow.

Implementation

The multicycle implementation breaks instructions down into multiple steps. These steps typically are the:

  1. Instruction fetch step
  2. Instruction decode and Register fetch step
  3. Execution, memory address computation, or branch completion step
  4. Memory access or R-type instruction completion step
  5. Memory read completion step

In each short step, the processor can read or write the memory or register file or use the ALU. Different instructions use different numbers of steps, so simpler instructions can complete faster than more complex ones. The processor needs only one adder; this adder is reused for different purposes on various steps. And the processor uses a combined memory for instructions and data. The instruction is fetched from memory on the first step, and data may be read or written on later steps. we add nonarchitectural state elements to hold intermediate results between the steps.

Instructions

  1. Add : R[rd] = R[rs] + R[rt]
  2. Subtract : R[rd] = R[rs] - R[rt]
  3. And: R[rd] = R[rs] & R[rt]
  4. Or : R[rd] = R[rs] | R[rt]
  5. SLT: R[rd] = 1 if R[rs] < R[rt] else 0
  6. Lw: R[rt] = M[R[rs]+SignExtImm]
  7. Sw : M[R[rs]+SignExtImm] = R[rt]
  8. Beq : if(R[rs]==R[rt]) PC=PC+1+BranchAddr
  9. J : PC=JumpAddr
  • Based on the provided instruction set, the data-path and control unit are designed and implemented.

Dependencies

Linux

Ubuntu

This project needs Xlinx ISE and python3.

Building on Ubuntu

  1. Download Full Installer for Linux from here. See How to install Xilinx ISE on Ubuntu.

  2. Install Python 3.6 via command : $ sudo apt-get install python3.6

  3. Clone the repository.

  4. Change the directory to MipsAssembler.

  5. Type MIPS code to see it in binary form in src folder.

  6. Synthesize and simulate the verilog design in src folder to see the results.

  7. That's all !

Control_Unit FSM

Data Path

TODO

  • โญ• Fix Control Branch

mipsprocessor's People

Contributors

yasnakateb avatar

Stargazers

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