Debugging Example
The waveform in this section represents the states of your switches mapped to the EIN signal and to the signal groups OPCODE1, DATA, ALU, STACK, and SWITCHES.
- EIN is the signal output by the EXEC signal.
- OPCODE1 is the group associated with the set of 3-digit opcodes listed in the Operation Codes (Opcodes) table.
- DATA is the group associated with the last four switches on your demonstration board bank of input switches.
- ALU is the group associated with the demonstration board 7-segment display.
- STACK is the group associated with the digital display, which is the right-most row of LED bars on your demonstration board.
- SWITCHES is the group associated with the bank of eight input switches on your demonstration board.
Refer to the FPGA Demonstration Board Components figure to locate the demonstration board components.
Capturing the Add Operation
In this section, you add the value 2 to your 7-segment display (ALU group) by setting the switches for OPCODE1 and DATA.
- Set the OPCODE and DATA switches to the Low position.
- Select Read from the Debug Control Panel to read the state of the device.
- Set your input switches 2, 3, and 4 to 000 (ADD opcode) and set switches 7 and 8 to 10 (binary for 2).
- Select Read from the Debug Control Panel to read the state of the device.
The data value 2 appears in the DATA signal group in hexadecimal notation and in the SWITCHES group in binary notation (10).
- Toggle input switch 1 to the High position.
- Select Read from the Debug Control Panel to read the state of the device.
The EIN signal is High.
- Toggle your input switch 1 to the Low position.
- Select Read from the Debug Control Panel to read the state of the device.
- The 7-segment display (ALU group) displays the data: 2.
Adding and Removing Signal Groups
In this section, you add the OPCODE2 group to your display list and you remove the DATA group, which has no pertinent value in the next part of the tutorial. To bring up the list of defined groups, follow these steps.
- In the Debug Control Panel, click the Display button.
The Display Signals dialog box appears.
- Click the Group radio button.
The list of groups already included in your display list appears in the Displayed Signals column of the dialog box.
The groups that are defined but are not included in the display list are in the Available Signals column.
Adding a Signal Group to the Display List
To include the OPCODE2 group in your display list, follow these steps.
- Select the OPCODE2 group in the left column.
- Click the > button to move the group to the Displayed Signals column.
- Click OK to display the group in the waveform.
Removing a Signal Group from the Display List
To remove the DATA group from the display list, follow these steps.
- Click on the group DATA in the Displayed Signals list box.
- Click the < button to move the signal to the Available Signals list box.
- Click OK.
Updating the Waveform
To view the changes you made to the list of displayed signals, read the states of the device.
- Select Read from the Debug Control Panel to read the state of the device.
- The waveform is updated.
The DATA group has been removed from the waveform and the OPCODE2 has been added to the waveform.
Capturing the Push Operation
To push the values displayed on the 7-segment display to the stack, follow these steps.
- Set your input switches 2, 3, 4, 5, 6, and 7 to 111101, the PUSH opcode.
- Select Read from the Debug Control Panel to read the state of the device.
The SWITCHES and OPCODE2 groups are updated to reflect the new switch settings.
- Toggle your input switch 1 to the High position.
- Select Read from the Debug Control Panel to read the state of the device.
The EIN signal is High.
- Toggle your input switch 1 to the Low position.
- Select Read from the Debug Control Panel to read the state of the device.
The STACK group reflects the state of the 7-segment display (ALU group) in binary notation.
