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-2provides an example.

;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

Figure 11-2:Example of pBlazIDE DSIN Directive

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.

$FF 01 02 03 $A5 $5A

Figure 11-3:Example File (switch_inputs.txt) to Describe Input Values for

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.

User-defined

Current port value.

Double-click to edit

input port name.

byte value.

 

Port address (Port ID #)

input_port_name

 

 

 

 

$FF

 

 

 

 

 

 

$27

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

Check or uncheck to

 

 

 

 

 

 

 

set or clear a bit.

UG129_c11_01_051404

Figure 11-4:The pBlazIDE DSIN Directive Defines an Input Port

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

PicoBlaze 8-bit Embedded Microcontroller

www.xilinx.com

77

UG129 (v1.1.2) June 24, 2008

Page 77
Image 77
Xilinx UG129 manual Input Ports, Output Ports, Defining I/O Ports pBlazIDE