UPGRADE YOUR BROWSER

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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer akshayjrkp
Observer
263 Views
Registered: ‎01-08-2016

How to configure and access the PS-PL shared registers in SDSoC flow?

Hi,

I have to copy some data from the host to PL. The same data is updated and send back to the host.

This is easily implemented using the DDR memory using the "sds_alloc" and "data zero_copy" pragmas as shown below.

//using sds_alloc
int* x = (int *) sds_alloc(sizeof(int)*8); 

// Function definition in use_logic.h file
#pragma SDS data zero_copy(x[0:8],t[0:8],Q[0:8])
void user_logic(int* x,int* t, int N, float* Q, int res_in, int *res_out, int reward);

But the size of data is very small (8 values of 4 bytes each), so using DDR for this is not an efficient way and very slow on board.

I tried using "malloc" and "data copy" pragmas so that I can do it directly between the host and the PL, as shown below.

// using malloc
int* x = (int *) malloc(sizeof(int)*8);

//function definition
#pragma SDS data copy(x[0:8],t[0:8],Q[0:8])
#pragma SDS data access_pattern(x:SEQUENTIAL, t:SEQUENTIAL, Q:SEQUENTIAL)
void user_logic(int* x,int* t, int N, float* Q, int res_in, int *res_out, int reward);

But, it turns out it is implemented as a FIFO and thus can not be synthesized for both read and write operations. Following error is there:

port 'x' (<paath>/user_logic.cpp:5) of function 'user_logic' cannot be set to a FIFO
ERROR: [SYNCHK 200-91] as it has both write (<path>/user_logic.cpp:9:6) and
read (<path>/user_logic.cpp:26:7) operations.

Now, which interface or options should I use so that the data is copied to/from the host itself?

In Vivado+SDK flow, there were shared registers which could easily handle this combination of read/write operations and sharing the data between the PS and PL.

Is there any similar way that can be used in SDSoC?

 

Please help.

 

Thanks,

Akshay

 

0 Kudos