Debugging will also require displaying signals that are neither pins
nor registers, for example register enables. NB: For purposes of de-
bugging it is easiest to make the signal of interest an output of the
microprocessor. Doing this also ensures that neither the Quartus com-
piler nor fitter will optimize the signal out of the design. For exam-
ple, to view register enables in the wave window it would have to be
made an output of the microprocessor and then compiled in Quartus.
The instantiation of the microprocessor in the testbench would have
to be changed to include register enables in the connection list. Also
register enables would have to be declared as a wire[8:0] in the test-
bench.
To display data bus is a bit more involved.
NB: Two assembler programs are provided on the web (under micro extras)
to help you with debugging. One exercises the move instructions and
1
the other exercises the ALU instructions. These programs do not
perform exhaustive tests, but will help with debugging. To use these
programs effectively you must display the pc and ir waveforms in your
simulation. Just as importantly, you must print (or copy to notepad
and display) the listing (the middle window of the assembler). The
first column of the listing is the address at which the instruction is
stored and the second column is the machine code for the instruction.
The time at which an instruction is executed can be easily found in the
simulator waveform report using the pc. The pc holds the address (the
last 8 bits of the 16H address given in the listing). The ir contains the
machine code for the instruction.
It is suggested that you generate your own test programs and share
them among other students and compare results. You may even form a
testing team where each member writes a program to test a different
part of the microprocessor.