[Simh] Unit/functional testing simulators

J. David Bryan jdbryan at acm.org
Wed Dec 3 23:18:16 EST 2014


On Wednesday, December 3, 2014 at 18:19, Seth Morabito wrote:

> I meant unit tests in the Kent Beck sense of unit testing, i.e. code
> that is automatically run at or shortly after compile time to verify
> correctness of "units" (likely C functions, in this case). 

I understand now, thanks.


> There are diagnostics for the 3B2, but I won't actually be able to run
> them until I have most of the simulator to the point where I can load
> software off a disk image. 

If there is a CPU diagnostic that will run on a bare machine, and you can 
decipher the disk format, then it's possible to copy the binary data and 
set up a SIMH script that loads that data into memory as a series of 
DEPOSIT commands.  I've used this method to load a diagnostic from a mag 
tape image before the mag tape simulator was built.


> I'm pretty worried about this for the 3B2 emulator. There's precious
> little documentation. 

If you don't have schematics (and microcode, if applicable) for the CPU, 
then the best I can advise is to instrument the simulator as I mentioned.  
That way, when something fails due to an implementation "gotcha", at least 
you can get a trace of the actions of the simulator leading up to the 
error.

Of the 250 bugs so far that I've found and fixed in HP simulator, perhaps 
ten were for undocumented features on which the operating systems relied.  
One was an undocumented CPU instruction used by the kernel.  Another was a 
race condition in the OS that was tripped by a too-short intercharacter 
timing in the line printer simulation.  Yet another was a value derived by 
reading the undriven I/O backplane, which depended upon the logic family 
used to implement the backplane drivers (that varied from model to model).  
Still another was erroneous documentation for a hard disk controller 
function that was resolved by referring to the controller microcode 
listings.

Hopefully, AT&T did a better job of documenting the machine.  :-)

                                      -- Dave



More information about the Simh mailing list