cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
6,759 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
Highlighted
Teacher
Teacher
6,638 Views
Registered: ‎03-31-2012

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

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
Highlighted
Teacher
Teacher
6,532 Views
Registered: ‎03-31-2012

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