Xilinx UG129 Answering Machine User Manual


 
PicoBlaze 8-bit Embedded Microcontroller www.xilinx.com 77
UG129 (v1.1.2) June 24, 2008
Defining I/O Ports (pBlazIDE)
R
Input Ports
The DSIN directive defines the name and the port address (or port identification number)
for a read-only input port. The DSIN directive models an input port that only connects to
the PicoBlaze microcontroller’s IN_PORT port. An optional field specifies a text file
containing input values used during instruction set simulation. Figure 11-2 provides an
example.
As shown in Figure 11-3, the stimulus contained in the specified switch_inputs.txt is
rather simple. Each line defines the data for an input (read) operation from the specified
port address. Each line represents a single port input operation. Data is specified as
decimal, unless prepended with a dollar sign ($), which indicates the data is hexadecimal.
If the simulation reads through all the values provided, the last value is persistent until the
end of simulation.
During instruction set simulation, pBlazIDE displays the input port as shown in
Figure 11-4. Edit the input port values during simulation by checking the individual bit
values or, to modify the entire byte value, double-click the current port value.
Output Ports
The DSOUT directive defines the name and the port address (or port identification
number) for a write-only output port. The DSOUT directive models an output port that
only connects to the PicoBlaze microcontroller’s OUT_PORT port. An optional field
Figure 11-2: Example of pBlazIDE DSIN Directive
Figure 11-3: Example File (switch_inputs.txt) to Describe Input Values for
Simulation
Figure 11-4: The pBlazIDE DSIN Directive Defines an Input Port
; pBlazIDE syntax to define an input port
; input_port_name DSIN <port_id#>[, “<input_file_name>”]
;
switches DSIN $00, “switch_inputs.txt”
readport DSIN $1F
$FF
01
02
03
$A5
$5A
$FF
76543210
$27
input_port_name
Current port value.
Double-click to edit
byte value.
User-defined
input port name.
Port address
(Port ID #)
Check or uncheck to
set or clear a bit.
UG129_c11_01_051404