Giter VIP home page Giter VIP logo

mips-processor-harvard-architecture's Introduction

MIPS Processor(Harvard Architecture)

A Simple 5-stage 32-bit pipelined processor with Harvard architecture and a RISC-like instruction set architecture.

In addition to an assembler to decode assembly code files to fill the instruction memory with the right data



⚙ ISA Specifications

  1. Registers:
    • R[0:7]: Eight 16-bit general purpose registers
    • PC: 32-bit program counter register
    • SP: 32-bit Stack Pointer register
    • EPC: 32-bit Exception Program Counter register
    • CCR: Condition Code Register
      • Z: zero flag
      • N: negative flag
      • C: carry flag
  2. Ports:
    • IN port: 16-bit data input port
    • OUT port: 16-bit data output port

📋 Instruction Set

One Operand Instructions Two Operand Instructions Memory Instructions Branch Instructions
NOP MOV Rsrc, Rdst PUSH Rsrc JZ Rdst
HLT ADD Rdst, Rsrc1, Rsrc2 POP Rdst JC Rdst
SETC SUB Rdst, Rsrc1, Rsrc2 LDM Rdst, Imm JN Rdst
NOT Rdst AND Rdst, Rsrc1, Rsrc2 LDD Rdst, offset(Rsrc) JMP Rdst
INC Rdst IADD Rdst, Rsrc1, Imm STD Rsrc1, offset(Rsrc2) CALL Rdst
OUT Rsrc - - RET (for call)
IN Rdst - - INT index
- - - RTI (for interrupt)

Instruction

5-bit Opcode 3-bit src1 register address 3-bit src2 register address 3-bit dst register address 1-bit for hlt 1-bit (not yet used) 16-bit offset

🎗 Features

  • reset signal

  • Successful hazards detection and handling (using full forwarding)

  • Successful Interrupts calling

  • Successful Exceptions handling

    • Exception 1: empty stack

    • Exception 2: invalid addess

🔄 Pipeline Stages

  • 1️⃣ Fetch Stage

    fetch stage schematic

  • 2️⃣ Decode Stage

    decode stage schematic
  • 2️⃣ Execute Stage

    decode stage schematic

Run

  1. cd to where you want to clone the repo
  2. run git clone https://github.com/Passant-Abdelgalil/MIPS-Processor-Harvard-Architecture.git
  3. run cd MIPS-Processor-Harvard-Architecture
  4. to run the assembler with your file, run python ./Assembler/assembler.py code_file="./Test_Cases/branch_code.asm"
  5. Create a project in modelsim, Tutorial
  6. To run Do files, in the transcript window run do ./Do_files/<do file name you want to run>
  7. Or start your own simulation :)

Contributors

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.