Tim's Machine Simulator Source Documentation
Introduction

This Machine Simulator contains a fairly modularized system for building and testing various theoretical machines. It has a GUI that shows the running of the machine over time and a code editor. It uses a simplified instruction set containing only two instructions (add, multiply). This file describes the various source files contained within the project.

The Source Files

In reading the source for this application I would suggest reading them in the order provided below to ensure the best understanding of the project.

Package ca.mitmaro.cs3725.a2.machine.scoreboard

This package contain the parts of the scoreboard. DUnitStatus records the status of the dunits and InstructionStatus records the status of the instructions.

Package ca.mitmaro.cs3725.a2.machine.component

This package contain all the components of the machine. The important classes to view are OperableComponent, DUnit and RegisterBank. OperableComponent is the base class for all components in the machine that perform an operation. DUnit is an extension of OperableComponent but has no special functionality. RegisterBank contains all the registers and performs various operations on the registers.

Package ca.mitmaro.cs3725.a2.program

This package contains only two classes, Instruction and Operation. An Instruction is a line of code and the Operation is the operation that is performed by a line of code or a OperableComponent.

Package ca.mitmaro.cs3725.a2

This is the main program package. The important classes in this package are the Program which is a simple wrapper around a list; the Machine which links all the components and the program; the Application class which is responsible for initializing, starting, stopping and resetting the Machine - among other thing; and last the Main class which contains the Main method.

Package ca.mitmaro.cs3725.a2.gui

This package contains a swing GUI that talks to the application. This package has little to do with the machine and is more to allow peaking into it's working. The only two classes that are interesting in this package are Events and GuiState. Events contains all the event handlers for the various buttons of the GUI. GUIState contains all the logic for updating the GUI depending on the Application state.

Package ca.mitmaro.io

This package doesn't really pertain to this program. It's an IO library I wrote some years back to simplify file IO. It's used in this project to load and save programs.

Package ca.mitmaro.prattle

This package doesn't really pertain to this program. It's a threaded message system I developed a few months back to allow indirect communication between components.