
R
Chapter 11: Assembler Directives
Defining Constants
Similar to renaming registers, assign names to constant values. By defining names for constants, it is easier to understand and document the PicoBlaze code rather than using the constant values in the code. Similarly, assigning names to registers and constants simplifies code maintenance. Updating the value assigned to a constant is easier if the constant is declared just once rather than searching for each occurrence in the application code.
Table
Table
KCPSM3
pBlazIDE
CONSTANT myconstant, 80
myconstant EQU $80
Naming the Program ROM Output File
The PicoBlaze assembler generates object code and formats the results for some form of internal memory within the FPGA. In general, the internal memory is block RAM, as described in Chapter 7, “Instruction Storage Configurations.”
KCPSM3
The output files from the KCPSM3 assembler are always named according to the source program name. For example, an assembly program named myprog.psm produces output files called myprog.vhd, myprog.v, etc. for the various output formats.
pBlazIDE
The pBlazIDE assembler provides a directive, using the keyword VHDL, to explicitly name the target output file and the VHDL entity name, as shown in Figure
VHDL "template.vhd", "target.vhd", "entity_name"
Figure 11-1: pBlazIDE Directive to Name the VHDL Output File
Defining I/O Ports (pBlazIDE)
To aid modeling and debugging of the interaction between the PicoBlaze microcontroller and the remainder of the FPGA, the pBlazIDE assembler supports some additional directives to describe and define I/O ports. These directives are particularly useful during instruction set simulation, as shown in Figure
76 | www.xilinx.com | PicoBlaze |
|
| UG129 (v1.1.2) June 24, 2008 |