cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pdiffley
Contributor
Contributor
1,400 Views
Registered: ‎05-07-2019

What is "#pragma HLS INTERFACE s_axilite" used for?

The example matrix multiplication kernel for SDAccel contains a series of HLS INTERFACES.

extern "C" {
void mmult( int* in1,  //Read-only input matrix1
            int* in2,  //Read-only input matrix2
            int* out_r,  //Output matrix
            int dim             //One dimension of the matrix
          )
{
#pragma HLS INTERFACE m_axi port=in1 offset=slave bundle=gmem
#pragma HLS INTERFACE m_axi port=in2 offset=slave bundle=gmem
#pragma HLS INTERFACE m_axi port=out_r offset=slave bundle=gmem
#pragma HLS INTERFACE s_axilite port=in1 bundle=control
#pragma HLS INTERFACE s_axilite port=in2 bundle=control
#pragma HLS INTERFACE s_axilite port=out_r bundle=control
#pragma HLS INTERFACE s_axilite port=dim bundle=control
#pragma HLS INTERFACE s_axilite port=return bundle=control
...
}

As described in the SDAcell programming guide, the "m_axi" interfaces correspond to ports to global memory for the kernel's arguments. The guide also states that "s_axilite" interfaces can be used for scalar arguments to a kernel function as shown in this example:

void process_image(int *input, int *output, int width, int height) {  
#pragma HLS INTERFACE s_axilite port=width bundle=control
#pragma HLS INTERFACE s_axilite port=height bundle=control

The kernel function in the matrix multiplication example has no scalar arguments or return value, but has multiple "s_axilite" interfaces. When I tried deleting the "s_axilite" interfaces, I received an error. What are the "s_axilite" interfaces being used for?

0 Kudos
2 Replies
graces
Moderator
Moderator
1,382 Views
Registered: ‎07-16-2008

From UG902 (Vivado Design Suite User Guide: High-Level Synthesis):

The s_axilite mode specifies an AXI4-Lite slave I/O protocol. For a complete description of the AXI4-Lite slave interface, including timing and ports, see the Vivado Design Suite: AXI Reference Guide (UG1037).

You can specify the s_axilite interface on any type of argument except arrays. You can group multiple arguments into the same AXI4-Lite interface.

-----------------------------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs.
-----------------------------------------------------------------------------------------------------------------------
0 Kudos
pdiffley
Contributor
Contributor
1,355 Views
Registered: ‎05-07-2019

After looking at the example again, I saw that there is a scalar argument to the kernel, dim. The following code runs without error in software emulation:

void mmult( int* in1,  //Read-only input matrix1
            int* in2,  //Read-only input matrix2
            int* out_r,  //Output matrix
            int dim             //One dimension of the matrix
          )
{
#pragma HLS INTERFACE m_axi port=in1 offset=slave bundle=gmem
#pragma HLS INTERFACE m_axi port=in2 offset=slave bundle=gmem
#pragma HLS INTERFACE m_axi port=out_r offset=slave bundle=gmem
//#pragma HLS INTERFACE s_axilite port=in1 bundle=control
//#pragma HLS INTERFACE s_axilite port=in2 bundle=control
//#pragma HLS INTERFACE s_axilite port=out_r bundle=control
#pragma HLS INTERFACE s_axilite port=dim bundle=control
//#pragma HLS INTERFACE s_axilite port=return bundle=control

I am correct to conclude that the s_axilite pragmas for the array arguments and void return value are unnecessary?

0 Kudos