Hello all,
I’m trying to modify the baremetal DMA example [1] to have a data producer write directly to DDR memory. I began by just cloning the repo in [1], downloading the CI/CD build artifacts, and changing the gateware on the beagle. I could see the new memory access gateware in the device tree and run the uio-dma-interrupt script to test the PL SRAM and DDR memory access successfully.
I wrote a TCL script to generate a modifed FIC_0_PERIPHERALS smartdesign that looks like this:
I then edited my_custom_fpga_design.yaml to specify that the FIC_0_PERIPHERALS smartdesign with the DMA controller be built and connected to the MSS. At this point, the CI/CD script fails [2] with the following error messages:
...
Reading file '/home/beagle/builds/UqLYJU_q/home/beagle/Microchip/common/vault/Components/Actel/DirectCore/COREAXI4DMACONTROLLER/2.2.107/fs/p1f7/Standalone/tgi/executables/linux/CoreAXI4DMAGenerator.exe: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
...
Error: Generator 'LINGENERATOR' for instance 'DMA_CONTROLLER_0' of 'Actel:DirectCore:COREAXI4DMACONTROLLER:2.2.107' failed.
Error: Unable to generate design "DMA_CONTROLLER" due to errors.
Generation of hardware IP core(s) failed.
[OK]
Error: Could not configure component 'DMA_CONTROLLER'.
Error: The command 'create_and_configure_core' failed.
After googling this, I found the reason for the failure [3]:
Certain IP Cores (i.e. CoreFIFO) in Libero catalog require a monitor or DISPLAY setting variable to be set in order to configure them via TCL. These older cores still use gfx (simple C library for graphics) when called to configures cores even in a TCL flow.
Use the below command to set the Display variable on a Linux machine:
export DISPLAY=:0.0
echo $DISPLAY=:0.0
Above solution may not work on a Linux Machine when there is no display hardware, and no physical input devices present. Use following workaround:
The Xvfb Package for Linux provides an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory.
When running on a Linux system with no display hardware you can install the xvfb package on the machine:
Ie. For Ubuntu: sudo apt install xvfb
Then execute the following command:
nohup Xvfb :99 > /dev/null 2>&1 &
export DISPLAY=:99
Once this is done the cores can be built in a TCL flow on a Linux Machine with no display hardware and no physical input devices.
Following the post, I modified my CI/CD pipeline to export the display variable and echo it to the terminal, but the script still fails to generate the DMA controller core because of the libgtk issue.
My questions are therefore:
- Why does the gateware (including the DMA controller) build without issue when not specified in the
my_custom_fpga_design.yaml
file? Does the DMA controller IP core not have to be generated and configured to be added to the device tree? - Has anyone encountered this error with the CI/CD build before? I looked through the forums and could not find another instance of anyone running into this issue
- Is there a way to add the
xvfb
to the build stage somehow to test if this solves the issue?
I guess I can just use my local installation of Libero to build the project from the TCL script since that seems to work, but I’d rather not deal with Libero if I can help it…
Sorry for the long post, and thanks in advance for any help with this.
[1] https://forum.beagleboard.org/t/polarfire-soc-linux-examples-dma-test-on-beaglev-fire/38980
[2] https://openbeagle.org/amitra/gateware/-/jobs/50609
[3] Microchip Lightning Support