Testing processor_system on FPGA
After verifying the design through simulation, you need to test it on an FPGA prototype.
Instructions for implementing the prototype are described here.
Fig. 1 shows the structure of the FPGA prototype.
Figure 1. Block diagram of the nexys_processor_system module.
The prototype allows step-by-step execution of the program loaded into instruction memory. It also displays the operation currently being executed.
Note
The instance of the
processor_coremodule inside theprocessor_systemmodule must be namedcore. That is, the instantiation line must look as follows:processor_core core(...).
Description of the peripherals used
-
Buttons
BTND— when pressed, generates a clock pulse delivered to theclk_iport of the design module. Note that instructions that access external memory require several clock cycles to complete.CPU_RESET— connected to therst_iinput of the design module. Sinceprocessor_systemuses synchronous reset (i.e., the reset signal is only sampled on the rising edge of the clock), resettingprocessor_systemand its submodules requires holding the reset button while also pressing the clock button.
-
Seven-segment displays
The seven-segment displays are divided into 2 groups (see Fig. 1):
PC— displays the lower 16 bits of the program counter as a hexadecimal number, derived from theinstr_addr_ooutput of the processor core module.operation— displays the operation currently being executed by the processor.
Operations displayed by the prototype
The prototype determines the operation type from the lower 7 bits of the instruction.
If the operation type is legal within the processor implemented in the lab assignments, the corresponding opcode is displayed. Opcodes are defined in decoder_pkg.sv. If the operation type determined by the prototype is illegal, the seven-segment displays show ILL (from illegal).
The mapping between operations and their representation on the seven-segment displays is shown in Fig. 2:
Figure 2. Mapping between operations and their representation on the seven-segment displays.
Demo program
The recommended demo program is program.mem. A description of its operation can be found in the #task section.