In the XML specification file of the RTL module within an Intel® FPGA SDK for OpenCL™ library, there are XML elements under INTERFACE that you can define to specify aspects of the RTL module's interface (for example, Avalon®-ST interface).
Table 8. Mandatory XML Elements Associated with the INTERFACE Element in the XML Specification File of an RTL Module
XML Element |
Description |
INPUT |
Specifies the input parameter of the RTL module. INPUT attributes:
- port—Specifies the port name of the RTL module.
- width—Specifies the width of the port in bits.
AOCL only supports widths that correspond to OpenCL data types (that is, 8 (uchar), 16, 32, 64, 128, 256, 512, and 1024 bits (long16)).
Note: Size of a type3 vector is 4 x sizeof(type), giving the impression that valid sizes of 24, 48, 96, and 192 bits are unsupported.
The input parameters are concatenated to form the input stream. Aggregate data structures such as structs and arrays are not supported as input parameters. |
OUTPUT |
Specifies the output parameter of the RTL module. OUTPUT attributes:
- port—Specifies the port name of the RTL module.
- width—Specifies the width of the port in bits.
The SDK only supports widths that correspond to OpenCL data types (that is, 8 (uchar), 16, 32, 64, 128, 256, 512, and 1024 bits (long16)).
Note: Size of type3 vector is 4 x sizeof(type), giving the impression that valid sizes of 24, 48, 96, and 192 bits are unsupported.
The return value from the input stream is sent out via the output parameter on the output stream. Aggregate data structures such as structs and arrays are not supported as input parameters. |
If your RTL module communicates with external memory, you need to include additional XML elements:
<MEM_INPUT port="m_input_A" access="readonly"/>
<MEM_INPUT port="m_input_sum" access ="readwrite"/>
<AVALON_MEM port="avm_port0" width="512" burstwidth="5" optype="read" buffer_location=""/>
Table 9. Additional XML Elements to Support External Memory Access
XML Element |
Description |
MEM_INPUT |
Describes a pointer input to the RTL module. MEM_INPUT attributes:
- port—Specifies the name of the pointer input.
- access—Specifies to the Intel® FPGA SDK for OpenCL™ Offline Compiler how the RTL module will use this pointer. Valid access values are readonly and readwrite. If the RTL module only writes with this pointer, assign readwrite to access.
Because all pointers to external memory must be 64 bits, there is no width attribute associated with MEM_INPUT. |
AVALON_MEM |
Declares the Avalon-MM interface for your RTL module. AVALON_MEM attributes:
- port—Specifies the root of the corresponding port names in the RTL module. For example, if port has a value of avm_port0_, the names of all Avalon-MM interface ports for the RTL module will start with avm_port0_.
- width—Specifies the data width, which must match the corresponding width value in the accelerator board's board_spec.xml file. Within the board_spec.xml file, the width value is specified in the interface element under global_mem.
For more information, refer to the global_mem section under XML Elements, Attributes, and Parameters in the board_spec.xml File in the Intel® FPGA SDK for OpenCL™ Custom Platform Toolkit User Guide .
- burstwidth—Specifies the number of bits required to represent burst size. Use burstwidth = log(maxburst) +1 to calculate the burst size, where maxburst is the corresponding maximum burst size specified in the board_spec.xml file. For example, if maxburst=16, burstwidth=5.
- optype—Specifies either the Avalon-MM port is reading (read) or writing (write) from external memory. You can only assign either read or write to optype.
- buffer_location—Supports heterogeneous memory. Leave this attribute blank because the heterogeneous memory compilation flow is currently untested.
|
For the AVALON_MEM element defined in the code example above, the corresponding RTL module ports are as follows:
output avm_port0_enable,
input [511:0] avm_port0_readdata,
input avm_port0_readdatavalid,
input avm_port0_waitrequest,
output [31:0] avm_port0_address,
output avm_port0_read,
output avm_port0_write,
input avm_port0_writeack,
output [511:0] avm_port0_writedata,
output [63:0] avm_port0_byteenable,
output [4:0] avm_port0_burstcount,
There is no assumed correspondence between pointers that you specify with MEM_INPUT and the Avalon-MM interfaces that you specify with AVALON_MEM. An RTL module can use a single pointer to address zero to multiple Avalon-MM interfaces.