Giter Site home page Giter Site logo

risc-processor-simulator's Introduction

The project includes 3 program: mips_asm, mips_emulator and mips_emulator_forwarding.

The mips_asm can translate the given mips assembly code to a simple format file. The file "code.asm" contains the instruction to be tested. Use the command bellow:

#./mips_asm code.asm

Then "code.bin" will be generate.

mips_emulator is a simple mips pipeline emulator that can support several instructions. 
mips_emulator_forwarding is an advanced version that use forwarding to reduce the stall cycles.

To test the emulator, use the command bellow:

#./mips_emulator < code.bin
#./mips_emulator_singel < code.bin

The output will be like this:
"xxxth clock cycle ended!"
PC=xx
xxx, xxx, xxx, xxx
r[0]=x ,r[1]=x ,r[2]=x ,r[3]=x ,r[4]=x ,r[5]=x ,r[6]=x ,r[7]=x ,r[8]=x ,r[9]=x

(The 3rd line show the instructions in the registers between each stage, IF_ID, ID_EX, EX_MEM, MEM_WB)

In my test data, the result of "BLTZ" branch instruction will only be false for 2 times. So the total instructions to be executed will be 4+7x20+2+1=147.

For mips_emulator, 352 clocl cycles are needed. The CPI is 2.39.

For mips_emulator_forwarding, 210 clocl cycles are needed. The CPI is 1.43.

risc-processor-simulator's People

Contributors

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