We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 
Participant anto95
Registered: ‎07-17-2017

How to use BSP generated driver

Hi guys, i'm trying to create a simple standalone application that does a 10x10 multiplication in FPGA. 

I've first generated with Vivado HLS the IP for the multiplication from this code: 


void mult_accel(float A[DIM*DIM],  float B[DIM*DIM], float res[DIM*DIM])
#pragma HLS INTERFACE s_axilite port=return bundle=CTRL_BUS
#pragma HLS INTERFACE s_axilite port=A bundle=INPUT_PORTS
#pragma HLS INTERFACE s_axilite port=B bundle=INPUT_PORTS
#pragma HLS INTERFACE m_axi depth=max_depth port=res offset=slave bundle=MASTER_PORT

	for (int row = 0; row < DIM; row++) {
          for (int col = 0; col < DIM; col++) {
               float val = 0.0;
               for (int k = 0; k < DIM; k++) {
                    val += A[row*DIM+k]*B[k*DIM+col];
               res[row*DIM+col] = val;

Then i've created a project in Vivado and linked the 2 slave axilite port to a master gp port in the PS, and the master port of my IP to a slave gp port on the PS. I've synthetized the design and generated the hardware platform with bitstream included for the SDK.

Following i've created a project in SDK using that platform and generated a BSP.

In the end i've created an application that allocate 2 matrix and a result matrix, and i tried to use the drivers function for communicate to my IP in this way:


//send matrix to the slave s_axilite port
XMult_accel_Write_A_Bytes(&multAccel,0, (char *) A, sizeof(float)*DIM*DIM); XMult_accel_Write_B_Bytes(&multAccel,0, (char *) B, sizeof(float)*DIM*DIM);
//send address of memory to the master port
XMult_accel_Set_res(&multAccel, (u32) res_accel);
//start accelerator in fpga XMult_accel_Start(&multAccel);

//wait until it's done while(!XMult_accel_IsDone(&multAccel)) ;

my code blocks on the while loop, like the accelerator never ends to computate.

I've done something wrong to initialize the right values for the fpga block?


Thanks for the attention.



0 Kudos