Skip to content

gavinmcd17/toy-cpu-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pipelined Y86 Simulator

yess is a small Y86-64 pipeline simulator written in C++. It loads assembled .yo programs, simulates the pipeline cycle by cycle, and prints the pipeline registers, condition codes, register file, and memory dump after each cycle.

Layout

  • include/: public headers for the simulator modules
  • src/: implementation files, grouped by executable entrypoint, core state, and pipeline logic
  • examples/: checked-in Y86 example programs with readable .ys source, runnable .yo inputs, and expected output snapshots
  • tests/fixtures/: non-example inputs used by the smoke tests
  • scripts/: local helper scripts

Build

make

This produces the yess executable at the repository root.

Run a program

./yess path/to/.yo/file

Debug output:

./yess examples/arithmetic/arithmetic.yo -D

Smoke Tests

Run the local regression suite with:

make test

The smoke tests run yess against the checked-in .yo fixtures under examples/ and compare the output against the bundled snapshots. They also include an invalid-input loader case under tests/fixtures/.

Example programs

Each example directory contains:

  • *.ys: human-readable source for the program
  • *.yo: assembled input that can be executed directly by yess
  • expected.txt: the expected simulator output used by make test

The examples cover:

  • halt and nop
  • register moves and immediate moves
  • ALU operations
  • conditional moves
  • memory reads and writes
  • stack operations
  • small multi-instruction programs, including the original powers/register-growth sample

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors