This section contains information on verifying the design using a demonstration board by creating and downloading the bitstream. This section also contains information about testing the design.
The Configure stage in the Flow Engine created a bitstream. You can now download the bitstream using a parallel download cable or the more versatile XChecker cable connected to your workstation. You can download the XC4000E version of the Calc design into an FPGA demonstration board available from Xilinx.
Use Hardware Debugger to download. To invoke Hardware Debugger, select Tools Hardware Debugger from the menu bar, or click the Hardware Debugger icon on the toolbar. See the next figure. If using an XChecker cable, you can also use the Hardware Debugger to read back information from the device to verify both the configuration as well as the state of memories and registers in the device.
A separate tutorial explains Hardware Debugger. Refer to the Hardware Debugger Reference/User Guide. Before starting this tutorial, select the ver1 rev1 revision of the design in the project view.
You can physically test this design only on an FPGA demoboard because no demoboard exists for CPLDs.
As described earlier, the Calc design is a 4-bit processor with a stack similar to a calculator that uses reverse polish notation. You must supply three types of input: an opcode, data, and an execute command.
Each demonstration board contains a row of eight rocker switches that provide input to the design (SW3 on the XC3000A/XC4000E board, SW5 on the XC4000E board). The left-most switch, labeled 1, is the Execute command, activated by toggling the switch twice. The next three switches (labeled 2-4) select the opcode. Opcode encoding appears in the following table. Use the right-most four switches (labeled 5-8) to input data. When you select the extended instruction set with opcode 111, these switches provide additional bits of opcode.
2 | 3 | 4 | 5 | 6 | 7 | 8 | Operation |
---|---|---|---|---|---|---|---|
0 | 0 | 0 | Data | ADD between switches and register | |||
0 | 0 | 1 | Data | AND between switches and register | |||
0 | 1 | 0 | Data | OR between switches and register | |||
0 | 1 | 1 | Data | XOR between switches and register | |||
1 | 0 | 0 | Data | SUB switch value from register | |||
1 | 0 | 1 | X | X | X | X | CLEAR register |
1 | 1 | 0 | Data | LOAD register | |||
1 | 1 | 1 | 0 | 0 | 0 | X | ADD between stack and register |
1 | 1 | 1 | 0 | 0 | 1 | X | AND between stack and register |
1 | 1 | 1 | 0 | 1 | 0 | X | OR between stack and register |
1 | 1 | 1 | 0 | 1 | 1 | X | XOR between stack and register |
1 | 1 | 1 | 1 | 0 | 0 | X | SUB stack value from register |
1 | 1 | 1 | 1 | 0 | 1 | X | PUSH register value to stack |
1 | 1 | 1 | 1 | 1 | 0 | X | POP stack value to register |
1 | 1 | 1 | 1 | 1 | 1 | X | NOP |
To perform an operation, set the data on the right-most nibble. On is a one; Off is a zero. Look up the correct opcode for the operation you want to perform and set the three opcode switches to the correct value. Then toggle the left-most Execute switch twice. If the switch is already On, switch it Off, wait a moment, and then return it to the On position.
The contents of the ALU register display in hexadecimal on the seven-segment display. The top value in the stack displays in binary on the right bank of LEDs. A gauge indicating the number of items on the stack displays on the left bank of LEDs.