LESS Quickstart

A few key things of note:

1. The "mainX" routine in "test.U" is the actual function that the simulator
starts executing.  This routine is just linked in with the simulator like
any other function, but it is not actually called by any part of the
simulator -- instead, the simulator's initial PC is set to the start of
"mainX" before it starts simulating.  If you want to hook your own code into
the simulator in place of the existing "test" code, then you should rename
"main" to "mainX" and link it in with the rest of the simulator.

2. "test.U" demonstrates a fair amount of the speculation API, in this case
working with a counted FOR loop.  I've commented it so that sections that
are fairly generic (like thread spawning and the speculation
startup/cleanup, that only need to be performed once for the entire program)
should be pretty clear.  However, feel free to ask any questions about any
of this stuff.

3. The "main" for the simulator (that is, the "main" that runs on the real
machine) is in less.cpp.  There are a few lines in it that may be of
interest, up near the top, since they set three important variables:
startPrintTime, endPrintTime, and endKillTime.

The first two give the simulator a range of cycle times when it should
perform a cycle-by-cycle dump of what it's doing into the instructionOutput
file.  I don't recommend doing this for more than about 1000 cycles or so,
since the files can get huge.  However, it is a nice way to examine what's
happening in EXTREME detail.  Even without this, important information about
speculation (when it's starting, ending, etc.) is dumped into
instructionOutput.

The third lets you set a cutoff time for your program.  When LESS finishes a
simulation, it automatically dumps statistics into the statOutput file (info
about which instructions were executed, how long it was running which
subroutines, what SYSCALLs were made, etc.).  However, if you kill the
simulation early using a "kill" signal you won't get any stats.  The
endKillTime value gives the simulator a fixed ending time when it will stop
and dump statistics, in case your simulations are too long to run to
completion or get lost in an endless loop.