Debugging offers a means for capturing the internal CLB output states and displaying them in waveforms like a simulator. The Hardware Debugger offers two types of debugging modes: Synchronous and Asynchronous.
This section describes the synchronous debugging mode. In the synchronous debugging mode, the Hardware Debugger gives you control over the system clock, allowing for a specified number of clocks between snapshots of the internal FPGA states. For a description on triggering snapshots asynchronously, see theAsynchronous Debugging section.
Before you can begin debugging your design, you must make sure that the cable is properly connected for synchronous debugging. This was not needed for the downloading and verifying section so it was skipped.
To debug your design, you must setup the debugging mode, set the Trigger type, set the clock type, and include signals and signal groups in your display list.
To set the debugging mode, follow these steps.
Figure 9.8 Debug Control Panel |
Figure 9.9 Clock Settings Dialog Box |
Figure 9.10 Trigger Settings Dialog Box |
The Watch design has two internal buses that represent the value of the seconds counter prior the HEX2LED conversion: ONES[3:0] and TENS[3:0]. These signals are divided or separated into their individual bits during the implementation phase.
For HDL designs, the ONES and TENS signals may have been renamed by the compiler. In this case, use the ONESOUT and TENSOUT signals instead. These signals will have undergone HEX2LED conversion to encode the seconds counter values for the seven segment display. For these binary conversions, see the following table.
HEX [3:0] (Binary) | LED [6:0] Binary |
---|---|
0 (0000) | 40 (100 0000) |
1 (0001) | 79 (111 1001) |
2 (0010) | 24 (010 0100) |
3 (0011) | 30 (011 0000) |
4 (0100) | 19 (001 1001) |
5 (0101) | 12 (001 0010) |
6 (0110) | 02 (00 0010) |
7 (0111) | 78 (111 1000) |
8 (1000) | 00 (000 0000) |
9 (1001) | 18 (001 1000) |
A (1010) | 08 (000 1000) |
B (1011) | 03 (000 0011) |
C (1100) | 46 (100 0110) |
D (1101) | 21 (010 0001) |
E (1110) | 06 (000 0110) |
F (1111) | 0E (000 1110) |
For example, HEX [3:0] would be ONES[3:0] and LED[6:0] would be ONESOUT [6:0]. The counters only count up to 9 since they are designated to count in powers of ten. With this encoding, the seven-segment display LEDs are active low. In other words, for the output of HEX2LED, a `0' is On.
In the Hardware Debugger, these signals can be recombined into a bus format for a more convenient display.
To specify which signals to view, follow these steps to add signals to the list of signals to display.
Figure 9.11 Signal Groups Dialog Box |
Figure 9.12 Group Name Dialog Box |
If you are verifying the HDL design, select the ONESOUT<0> through ONESOUT<3> instead of ONES<0> through ONES<3>.
Figure 9.13 Signal Groups Dialog Box (Schematic Design) |
Figure 9.14 Signal Groups Dialog Box (HDL Design) |
You can globally define the signals to display in the selection list box by typing the first characters of the signals followed by a wildcard character (*) in the Filter For Signals box and clicking Apply.
If you are verifying the HDL design, select the TENSOUT<0> through TENSOUT<3> instead of TENS<0> through TENS<3>.
In this section, you use the Display Signals dialog box to select the signals to view and debug. To add signals and the groups you just defined to your display list, follow these steps.
Figure 9.15 Display Signals Dialog Box |
A new Waveform window appears with the selected signals for display.
Figure 9.16 Waveform Window |
Now you can begin reading snapshots of the internal device states. You will adjust the number of clock cycles before each snapshot so that you can see the three buses independently transition appropriately.
Figure 9.17 Waveform Window |
Figure 9.18 Waveform Window (Schematic Design) |
Figure 9.19 Waveform Window (HDL Design) |
Figure 9.20 Waveform Window (Schematic Design) |
Figure 9.21 Waveform Window (HDL Design) |
The logical value of the displayed signals are shown in numerical form in the Cycle column. Click the portion of the waveform that you would like to see the numerical listing for, and the Cycle column automatically updates itself.
To start fresh with the same waveform, click the right mouse button once. From the pop-up menu, select Clear All Waveforms. You will lose all unsaved data.
You may choose which radix you prefer your signals and groups to display in. The groups should have defaulted to HEX. To change to binary follow these steps.
When you are done with a debugging session and before exiting the waveform window, you can save it for future reference.
Figure 9.22 Pop-up Dialog Box |