Cache Simulation in DLSim
In the summer of 2008, I worked under my professors John Donaldson and Rich Salter on their DLSim 3 project. Back in the dark ages, Rich developed DLSim (http://www.dlsim.com/) as a logic circuit simulator for pedagogical use. The system uses XML to describe circuits, which makes it useful for any application of circuits. (I've heard of people printing hard circuits using DLSim's robust XML output.) My contribution to the project was the development of a Cache Plugin using the API and suggesting new features in the API to create a simple test suite for the original plugin.
In DLSim 3, a bunch of new features were added, one of them being an API that lets users build Plugins. Plugins are logic circuit devices described completely in Java, allowing one to introduce hard-to-draw circuits such as large memories (one can't practically drag and drop thousands of gates). Using the Plugin API, John wrote a working MicroMIPS (simpler subset of MIPS) processor in DLSim. It was a spectacular sight, a toy processor churning through
real code and return results (http://www.cs.oberlin.edu/~rms/dlsim.com/demos/DLSim_Mips_fib.html).
Following from an old Computer Architecture assignment I once did under Mr.Donaldson, I developed a Cache memory plugin for this processor with variable configurations. The Cache Memory plugin can pretend to be a Cache memory of any size (relative to memory) and of any level of associativity up to 64. When designing an architecture, one may want to measure the performance of different components, and that idea led me to develop a Tester for this Cache. In order to implement the Tester, Mr. Salter added Plugin Reflections to the API, allowing certain Plugins to interact without wires for diagnostic purposes. The result is this arrangement where the Tester runs the loaded program once through every configuration of the Cache, and notes down cache performance (hit/miss ratio) of each run.
Here's a video of my submission on the project at MCURCSM:
and a video of the plugins in action:
(the paper can also be seen here)