Giter Club home page Giter Club logo

scoreboard-simulator's Introduction

Scoreboard Simulator

This is the design and implementation of the scoreboarding algorithm for a subset of MIPS in software. The scoreboarding simulator accepts as input a text-file containing MIPS assembly and output the completed instruction status table showing the clock cycle of Issue, Read Operands, Execute Complete, and Write Result. We will utilize four distinct functional units: integer, mult, add, and div. In order to configure the system, we will use an assembly directive to define the number of each functional unit and the latency.

Here is a sample ASM file that the simulator would be able to read (see decode.py for all accepted instructions):

.integer 1 1  ; one int unit that operates in 1 clock 
              ; (execute complete the cycle after read operands)
.mult 2 10    ; two multiply units that take 10 clocks
.add 1 2      ; one add unit that takes 2 clocks
.div 1 40     ; one div unit that takes 40 clocks
LD    F6,  34(R2)
LD    F2,  45(R3)
MULTD F0,  F2, F4
SUBD  F8,  F6, F2
DIVD  F10, F0, F6
ADDD  F6,  F8, F2

The simulator contains three important files:

  • scoreboard.py defines the Scoreboard class and the ScoreboardParser class which are used for the scoreboarding algorithm and parsing the asm file respectively
  • fu.py defines a generic functional unit, which has properties for the type and number of remaining clocks
  • decode.py contains the Instruction class which describes an Instruction object within the scoreboard. It also provides methods for decoding an instruction string from the asm file and producing an Instruction object

Compiling and running the file is easy. It can be done with the following command

python scoreboard.py

To choose a different asm file, open up the scoreboard.py class and change the ASM_FILE property at the top.

NOTE : This code has been tested on both windows and linux operating system.

Important: This repository is the extended work of jcomo (https://github.com/jcomo/scoreboard-simulation). Hope you will find it helpful.

scoreboard-simulator's People

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.