Skip to content

ft-jasong/mips_pipeline_simulator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIPS_PIPELINE_SIMULATOR

It shows how the "MIPS 5-staged pipeline" works.




Summary

  • This program is made for showing how the "MIPS 5-staged pipeline" works.
  • Your assembly code will be converted to machine code and then executed.
  • You can see the process of execution in the data path of the window.


Platform

  • Code Type:  ARM64
  • Platform:   macOS 12.6 (21G115)



Requirement

Raylib

Link to raylib (Github)

  • checkout following link to install raylib
  • You can find a few ways to install raylib

OSX

https://github.com/raysan5/raylib/wiki/Working-on-macOS

Linux

https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux


Spim

Link to spim (Sourceforge)

  • You need to install flex and bison before installing spim

OSX

$ brew install flex bison

Linux

$ sudo apt-get -y install flex bison




Install

$ make (all) [SIZE_FACTOR=size_factor]
  • SIZE_FACTOR: size factor of the window (default: 8.0)
    • Only 7, 8, and 9 are supported for  SIZE_FACTOR
    • If you want to resize the simulator, you have to execute
      • $ make re SIZE_FACTOR=other_value



How to run

Default

$ make run [INPUT_FILE="test.s"] [SIZE_FACTOR=size_factor]
  • Default  INPUT_FILE  is "test.s"
  • Rule "run" executes following two commands
    • cd ./libs/assembler/spim; ./spim -file ../../../test.s -dump; cd ../../../;
    • ./mips_pipeline_simulator ./libs/assembler/spim/text.asm ./libs/assembler/spim/data.asm
  • Using in manual is not recommended

For custom File

$ make run [INPUT_FILE="your_assembly_file.s"]
  •  INPUT_FILE  has to be ".s" file

Make support following commands

  • make (all) : compile program
  • make run : run program (includes make all)
  • make clean : remove all object files
  • make fclean : remove all object files and executable file
  • make re : recompile program


Usage

Keyboard Interaction

Key Action
Move camera to left
Move camera to right
Move camera to up
Move camera to down
i/o Zoom in / Zoom out
r Reset camera
d Open/Close User Data Segment Page
[/] (in Data Segment Page) Move to prev/next page
ESC ⎋ Exit program

Mouse Interaction

Mouse Action
Click "next_cycle" button Execute next cycle of pipeline




Result

결과 이미지 스크린샷, 동영상




Description of source code

In Markdown

Link to Youtube


Contact

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 70.1%
  • C++ 9.5%
  • HTML 5.8%
  • Assembly 3.3%
  • Lua 3.2%
  • Makefile 2.2%
  • Other 5.9%