/csp-y86-sim

Implementation of Y86 Simulator

Primary LanguageC

Y86 Instruction Set Simulator

This is a very simple implementation of the Y86 Instruction Set Simulator. It has limited pipelining support, and does not handle any data / instruction hazards in the pipeline.
The maximum supported memory is 16KB (memory and data inclusive). All operaands are 64 bits in size

Description

There are two parts to this: the parser, and the simulator
The parser is responsible to read a ".ys" file, and generate an object (".yo") file.
The simulator program will take the generated ".yo" file as an output, and has options to run the program in several modes:

  • Run the full program
  • Run the program one (simulated) cycle at a time
  • Run the next "n" clock cycles
  • Toggle Pipeline mode
  • Show the contents of the registers
  • Show the pipeline stage registers
  • Show the contents of the memory

Prerequisites

sudo apt install flex

Software

OS: Ubuntu 18.04
GCC version: gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

Building the code

Run make from the trunk folder

Running the Code

The binaries are placed under the bin folder.

Specify an assembly file as input to the parser:
bin/y86-parser samples/addnos.ys
This generates the "samples/addnos.yo" file

To run the simulator, run bin/y86-sim which opens a menu based interface to execute instructions

Cleanup

Run make clean from the trunk folder to remove any existing object files and binaries