08-16-2017 08:43 AM
The final step will be to integrate the SDK-generated device drivers with the user space application and run them on Linux on the board. Is there any tutorial about that?
This video shows only the setup of a user space application
08-16-2017 10:06 AM
@gdg Usually you would just create a device driver and embed the baremetal code inside. It is not much different.
Have you considered leaving that app running on baremetal and just talking to Linux on other cores?
08-16-2017 10:14 AM
@hbucher, I guess I will "integrate/port" the baremetal core to the device driver.
But I am still wondering if Xilinx provide an example of how to "seamlessly" port a traditional baremetal application to user app + device driver.
08-16-2017 10:29 AM - edited 08-16-2017 10:37 AM
@gdg Perhaps but I dont know of.
The issue is that under linux you have to choose the way your driver will interact with the user app - or if it is going to expose any device at all.
At this point it is not Xilinx-specific anymore since on standalone everything is basically done through memory poking.
There are a few choices: char device, block device, through ioctl, memory mapped, etc.
08-16-2017 10:59 AM
@hbucher, I understand the point.
As an alternative to the Vivado flow (HLS, integrator, SDK), I use another HLS tool to design accelerators on FPGAs. In that case, I manually write the device drivers (char device, memory map, and ioctl). I assume that adapting those drivers is doable. But I do not want to re-invent the wheel if there is a Xilinx automatic flow.
In particular, I can find in my Vivado project these files:
accelerator_project/accelerator_project.sdk/accelerator_design_wrapper_hw_platform_0/drivers/accelerator_v1_0/src/accelerator.c accelerator_project/accelerator_project.sdk/accelerator_design_wrapper_hw_platform_0/drivers/accelerator_v1_0/src/accelerator.h accelerator_project/accelerator_project.sdk/accelerator_design_wrapper_hw_platform_0/drivers/accelerator_v1_0/src/accelerator_linux.c accelerator_project/accelerator_project.sdk/accelerator_design_wrapper_hw_platform_0/drivers/accelerator_v1_0/src/accelerator_sinit.c
These seem to be Linux User Space device drivers:
I am wondering if I can use them.
08-16-2017 07:31 PM
The drivers that are generated in SDK seems to be good both for bare-metal and UIO on Linux. I put here an image showing what I am looking at. Hopefully, someone can tell me if they can be really used in Linux and how.
09-21-2017 12:29 PM
I have almost successfully ported the generated UIO drivers to Linux, but there is a problem on ZynqUltrascale+ (i.e. ARM Cortex-A53, 64bit-processor).
I opened a different topic for that: