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
Visitor hr92
Visitor
6,635 Views
Registered: ‎04-04-2016

How to use the PL block in an SDK linux application?

Hello,

 

I'm trying to add a PL block for a simple image processing algorithm. I've used Vivado HLS to create the ip block and added it to my hardware platform. Now I'm trying to build a Linux application with SDK to test my block. I'm guessing there are libraries to pass an image to the block knowing its adress but I can't seem to find tutorials for that. Can someone help?

0 Kudos
3 Replies
Teacher muzaffer
Teacher
6,514 Views
Registered: ‎03-31-2012

Re: How to use the PL block in an SDK linux application?

what does your IP block look like? Can you show the top level functions parameters and interface pragmas you used?
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor hr92
Visitor
6,453 Views
Registered: ‎04-04-2016

Re: How to use the PL block in an SDK linux application?

Here is how my top level function looks like :

 

 

void face_detect(AXI_STREAM& input, AXI_STREAM& output, int rows, int cols)
{

     #pragma HLS RESOURCE variable=input core=AXIS metadata="-bus_bundle INPUT_STREAM"
     #pragma HLS RESOURCE variable=output core=AXIS metadata="-bus_bundle OUTPUT_STREAM"

     #pragma HLS RESOURCE core=AXI_SLAVE variable=rows metadata="-bus_bundle CONTROL_BUS"
     #pragma HLS RESOURCE core=AXI_SLAVE variable=cols metadata="-bus_bundle CONTROL_BUS"
     #pragma HLS RESOURCE core=AXI_SLAVE variable=return metadata="-bus_bundle CONTROL_BUS"

     #pragma HLS INTERFACE ap_stable port=rows
     #pragma HLS INTERFACE ap_stable port=cols

      ....

      #pragma HLS dataflow

     hls::AXIvideo2Mat(input, im1);
     ...
     hls::Mat2AXIvideo(im2, output);

 }

 

AXI_STREAM is a  hls::stream<ap_axiu<32,1,1,1>> .

 

And here is how the IP block looks like :

 

IP Block.PNG

 

And after exporting the hw platform to SDK I get my function mapped in the address  :  0x43c00000 0x43c0ffff.

0 Kudos
Teacher muzaffer
Teacher
6,408 Views
Registered: ‎03-31-2012

Re: How to use the PL block in an SDK linux application?

Your block takes the image over axi-stream interfaces so there is no trivial way of sourcing an image to it. The only choice I can see is to use a datamover with mm2s interface (read ?) and connect the m side to an HP port and s side to your IPs input. The reverse connectivity on the other side, ie s2mm with s coming from your block and mm going to HP.

The address you get from BD is only for the control_bus interface over which you write the rows, cols etc. It's not for image data.

Why do you think you need axi-stream at this stage? It's true that cameras produce an axis compatible output but if you need to test it without a camera, you may think about making your connectivity directly memory mapped initially.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos