Board Debugging Features

CIS 372 (Spring 2009): Computer Organization and Design Lab

Immediately after download to the board, the processor begins executing its instructions.

The simulated processor effectively runs at 25MHz, executing 25 million instructions per second. That's way too fast for debugging. For debugging, the processor-board-interface subsystem supports a clock single-stepping mode, which allows you to control the advance of the clock by pushing a button.

The switch that controls the clock mode is on-board switch 1, under the large opening in the cover and to the right of the five buttons. When the switch is "up", the clock is in automatic 25MHz mode. When the switch is "down", the clock is in manual mode. You can advance the clock by a single cycle by pushing the down-button next to the switches. The clock will advance when you release the button. In reality, the clock is running at full speed in both modes, what changes is control of the "global write enable" signal to all of the rgisters. Anyways, in order for this to work well, you need the new implementation of the one_pulse "de-bouncing" module.

The right button on the board resets the processors registers and memory, and sets the program counter back to its initial state. This button does not reset video memory, to do this you must reprogram the device.

During manual clock mode, you can debug the processor using the 4-digit 7-segment display on the daughter board. On-board switches 2, 3, and 4 determine what value the display corresponds to. In the following table, a 0 means down and a 1 means up, as we've inverted the switches.

sw2 sw3 sw4 information displayed
0 0 0 unused
0 0 1 IMEM_ADDR (PC)
0 1 0 IMEM_OUT (Instruction)
0 1 1 unused
1 0 0 {reset,0,0, DMEM_WE}
1 0 1 DMEM_ADDR
1 1 0 DMEM_OUT
1 1 1 DMEM_IN

You are free to expand the lc4_processor (e.g., lc4_single) and dio4 interfaces to display any information you want.