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: 
Adventurer
Adventurer
543 Views
Registered: ‎05-30-2018

Custom SDSoC C++ Software

Hi,

I am using SDSoC 2018.3 with ZCU102, and I am able to produce .elf application that runs on PetaLinux.

However, I would like to write my own software using C++ that runs on the Arm Cortex (specifically in Ubuntu Desktop) and add my own customizations (instead of cross-compiling).

So I want to take the generated Hardware only, and then write my own software and compile it using G++ for example.

- How to communicate with the PL from the PS (C++) software?

- Is there anything special regarding SDSoC?

- should I use SDK? or mmap?

- Any directives to add for having drivers/axi flags ?

 

Thanks !

Rashed

0 Kudos
9 Replies
Adventurer
Adventurer
505 Views
Registered: ‎05-30-2018

Re: Custom SDSoC C++ Software

Any thoughts please ?

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
485 Views
Registered: ‎08-20-2018

Re: Custom SDSoC C++ Software

Hi @rashedkoutayni 

- How to communicate with the PL from the PS (C++) software?

The data mover transfers data between processor system (PS) and accelerators, and among accelerators. SDSoC™ can generate various types of data movers based on the properties and size of the data being transferred.

https://www.xilinx.com/html_docs/xilinx2018_2/sdsoc_doc/data-mover-diw1504034390755.html?hl=dma

- Is there anything special regarding SDSoC?

Speciality of SDSoC is, it helps developers to improve the speed/performance by executing part of our software code/functions in hardware.

These functions which are moved to harware are called accelerators. Profiling our software helps us understand which function should be moved to hardware. 

Along with these there are some optimization techniques which will help us improve the speed further.

- should I use SDK? or mmap?

SDK is software development kit, we cannot compare SDK with mmap.

- Any directives to add for having drivers/axi flags ?

Please refer below document

https://www.xilinx.com/content/dam/xilinx/support/documentation/sw_manuals/xilinx2018_2/ug1253-sdx-pragma-reference.pdf

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
Xilinx Employee
Xilinx Employee
474 Views
Registered: ‎08-20-2018

Re: Custom SDSoC C++ Software

Hi @rashedkoutayni 

If you feel my post was useful, please accept that as a solution.

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Adventurer
Adventurer
471 Views
Registered: ‎05-30-2018

Re: Custom SDSoC C++ Software

Hi @nutang ,

Thanks for this descent answer ! It is useful but I still have some confusion. May be a bit more details could hopefully clarify my problem.

I referred to UG1253 before asking my question and did the following:

I use a top level function (or accelerator as per SDSoC) :

void top_function(unsigned char flattened_image[IN_SIZE*IN_SIZE], unsigned short int XYZ[OUT_SIZE]){
#pragma HLS INTERFACE s_axilite port=return bundle=CRTL_BUS
#pragma HLS INTERFACE m_axi offset=slave port=flattened_image bundle=input depth=10000000
#pragma HLS INTERFACE s_axilite port=flattened_image bundle=CRTL_BUS
#pragma HLS INTERFACE m_axi offset=slave port=XYZ bundle=output depth=96
#pragma HLS INTERFACE s_axilite port=XYZ bundle=CRTL_BUS

....
}

In SDSoC, I move this function to hardware and I build the whole project.

The project is working well on PetaLinux. However, I take the output .hdf and .bit from Vivado project that was created and run by SDSoC under the hood, and I compile Linux Kernel using PetaLinux in order to run Ubuntu Desktop on the board, as described here:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841937/Zynq+UltraScale+MPSoC+Ubuntu+part+2+-+Building+and+Running+the+Ubuntu+Desktop+From+Sources

Now in Ubuntu Desktop, I would like to call the PL from the PS. I use mmap to map the address given by vivado (0xA0000000) to a virtual address in the PS. But I found out that the PL is not responding correctly, as if it doesn't exist.

For example I set ap_start manually after mmap, but it stays high forever. Even after the execusion ends, ap_start is always high ! ap_done is high as well. So both stay high.

By the way, I added the reserved memory space to Linux device tree before compiling.

I don't know how to debug this issue. But to sum up:

- I build the project in SDSoC.

- Then I take the design file and bit stream and use them with petalinux to compile the kernel, taking into account the reserved memory.

- finallly I try to access the PL using mmap, but it doesn't work !

What do you suggest in this case ?

 

Thank you !

 

0 Kudos
Xilinx Employee
Xilinx Employee
455 Views
Registered: ‎08-20-2018

Re: Custom SDSoC C++ Software

Hi @rashedkoutayni 

I understand your problem.

In case of SDSoC, you need to create a platform which contains hardware and software components, hardware will contain the outputs of Vivado and software components are boot files from petalinux build.

You need to generate the platform and then compile your application project for this platform.

Please refer below document and links

https://www.xilinx.com/html_docs/xilinx2018_2/sdsoc_doc/creating-sdsoc-platforms-fgz1504034372334.html

https://www.xilinx.com/content/dam/xilinx/support/documentation/sw_manuals/xilinx2018_2/ug1146-sdsoc-platform-development.pdf

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
Xilinx Employee
Xilinx Employee
453 Views
Registered: ‎08-20-2018

Re: Custom SDSoC C++ Software

Hi @rashedkoutayni 

I also suggest you to refer https://www.xilinx.com/support/documentation-navigation/design-hubs/dh0057-sdsoc-hub.html

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
Adventurer
Adventurer
445 Views
Registered: ‎05-30-2018

Re: Custom SDSoC C++ Software

Hi @nutang  ! Thanks !

So you mean I should run my design using SDSoC which generates the vivado files. And then I should use these vivado files along with petalinux generated FIT image and BOOT.BIN to create SDSoC platform again?

SDSoC --> {hdf,bit} --> PetaLinux compile --> {image.ub,boot.bin} --> SDSoC Platform ?

0 Kudos
Xilinx Employee
Xilinx Employee
423 Views
Registered: ‎08-20-2018

Re: Custom SDSoC C++ Software

Hi @rashedkoutayni 

No. Steps will be as follows

1. Generate your design in Vivado. 

2. Generate your boot files (software components) using petalinux (use HDF derived from Vivado)

3. Create a platform project in SDSoC and use .dsa file from vivado and software components generated from petalinux build

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Adventurer
Adventurer
417 Views
Registered: ‎05-30-2018

Re: Custom SDSoC C++ Software

Hi,

Thank you for your answer.

Actually, that's a totally different approach from what I am doing. Before I go into it I would like to know the possible reasons behind this phenomenon, where I set ap_start to 1, but ap_done stays 1 as well. 

When does this happen? Is there a specific reason behind this or does it tell you something ?

 

Thank you again !

 

0 Kudos