This is an attempt to migrate A Vitis Extensible Platform with a single ADC for RFSoC4x2 to the Vitis 2023.2 Unified IDE. Steps 0 to 2 are exactly the same as those before.
If not already installed, do the following steps to install the RFSoC board files:
git clone https://github.com/RealDigitalOrg/RFSoC4x2-BSP.git ~/workspace/RFSoC4x2-BSP
The board files are in ~/workspace/RFSoC4x2-BSP/board_files/rfsoc4x2.
~/.Xilinx/Vivado/Vivado_init.tcl (if the file doesn’t exist, add it):
set_param board.repoPaths [list "<full path to home directory>/workspace/RFSoC4x2-BSP"]
~/workspace.vivado -source rfsoc_adc_hardware_2023_2_1.tcl
to generate the following block design:
which adds an RF Data Converter IP to a slightly modified version of the hardware design in Vitis Platform Creation Tutorial for
ZCU104-Step 1.
rfsoc_adc_hardware.rfsoc_adc_hardware.xsa for hardware and platform rfsoc_adc_hardware_emu.xsa for hardware emulation.cd ~/workspace
petalinux-create -t project --template zynqMP -n rfsoc-linux
cd rfsoc-linux
rfsoc_adc_hardware.xsa and select EXT4 for rootfs:
petalinux-config --get-hw-description=../rfsoc_adc_hardware/rfsoc_adc_hardware.xsa
~/workspace/rfsoc-linux/project-spec/meta-user/conf/user-rootfsconfig:
CONFIG_rfdc
to allow including the rfdc library (we don’t use it in this experiment though)
petalinux-config -c rootfs
xrt:
libmetal (mostly for rfdc):
openssh for convenience:
petalinux-config -c kernel
~/workspace/rfsoc-linux/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi:
/include/ "system-conf.dtsi"
/ {
chosen {
bootargs = " earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw";
stdout-path = "serial0:115200n8";
};
};
&sdhci0 {
no-1-8-v;
};
&spi0 {
lmk@0 {
compatible = "ti,lmk04828";
reg = <0x0>;
spi-max-frequency = <500000>;
num_bytes = <3>;
};
lmxdac@1 {
compatible = "ti,lmx2594";
reg = <0x1>;
spi-max-frequency = <500000>;
num_bytes = <3>;
};
lmxadc@2 {
compatible = "ti,lmx2594";
reg = <0x2>;
spi-max-frequency = <500000>;
num_bytes = <3>;
};
};
&gem1 {
status = "okay";
phy-handle = <&phy0>;
phy-mode = "rgmii-id";
/* pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gem1_default>; */
phy0: phy@f {
reg = <0xf>;
ti,rx-internal-delay = <0x8>;
ti,tx-internal-delay = <0xa>;
ti,fifo-depth = <0x1>;
ti,dp83867-rxctrl-strap-quirk;
};
};
petalinux-build
petalinux-build --sdk
cd images/linux
./sdk.sh -d .
~/workspace/rfsoc-linux/images/linux/. The sysroot is in ~/workspace/rfsoc-linux/images/linux/sysroots/cortexa72-cortexa53-xilinx-linux.Download the Python script create_rfsoc_adc_vitis_platform.py to ~/workspace and run
vitis -s create_rfsoc_adc_vitis_platform.py
to create and build the platform component rfsoc_adc_vitis_platform in ~/workspace. You can also run the python script line by line in the Vitis interactive mode (vitis -i).
vitis -w ~/workspace
Examples button on the left widown edge to open the EXAMPLES viewDownload (a downarrow pointing to a bar) button to install the templates from the Vitis Accel Examples RepositoryCreate Application from Template button to create a system project from the example template:
test_adc. Press the Next button.rfsoc_adc_vitis_platform created in Step 3. If the platform doesn’t show up as a choice, you can press the + button to add it. Press the Next button.Embedded Component Paths:
Kernel Image: Click the Browse button to select ~/workspace/rfsoc-linux/images/linux/Image.Root FS: Click the Browse button to select ~/workspace/rfsoc-linux/images/linux/rootfs.ext4.Sysroot: Click the Browse button to select ~/workspace/rfsoc-linux/images/linux/sysroots/cortexa72-cortexa53-xilinx-linux.Update Workspace Perference box so that don’t need to enter the info again.Next and the Finish buttons to generate the project.dummy_kernel.cpp in test_adc_dummy_kernel [HLS]->Sources with this dummy_kernel.cpp.host.cpp in test_adc_host [Application]->Sources->src with this host.cpp.v++ linker connectivity:
dummy_kernel-link.cfg in test_adc [rfsoc_adc_vitis_platform]->Sources->hw_link[clock]
id=2:dummy_kernel_1
[connectivity]
stream_connect = RFDC_AXIS:dummy_kernel_1.s_in
package.cfg in test_adc [rfsoc_adc_vitis_platform]->Sources->packagetest_adc in Componentlsblk -r -O
For example, my SD card is /dev/sdj.
/dev/sdj.sudo dd if=~/workspace/rfsoc-linux/images/linux/rootfs.ext4 of=/dev/sdj2 bs=1M
sudo resize2fs /dev/sdj2
cd ~/workspace
mkdir mnt
sudo mount -t vfat /dev/sdj1 mnt
sudo cp ~/workspace/test_adc/build/hw/package/package/sd_card/* mnt/
sudo umount mnt
picocom if needed):
sudo picocom -b 115200 /dev/ttyUSB1
Boot up the RFSoC4x2 board.
root (default password is root, remember to change it after logging in).
Do ifconfig to check the IP address. With the IP address, can also ssh in as root.
Petalinux also creates a sudoer with login petalinux, whose passwd is set by the user when logging in the first time.scp this python package file xrfclk-2.0.tar.gz (I hacked out from the RFSoC-PYNQ distribution) to say /home/root/ on the RFSoC board.python -m pip install /home/root/xrfclk-2.0.tar.gz
scp this python script set_ref_clocks.py to say /home/root/ and then run it:
python /home/root/set_ref_clocks.py
to turn on the reference clocks.
test_adc app to grab samples from the ADC:
cd /run/media/boot-mmcblk0p1/
./test_adc_host dummy_kernel.xclbin
If the app runs properly, should see the following printout:
Found Platform
Platform Name: Xilinx
INFO: Reading dummy_kernel.xclbin
Loading: 'dummy_kernel.xclbin'
Trying to program device[0]: edge
Device[0]: program successful!
Reading data from device
Writing data to wave.txt
The samples are stored in the file wave.txt.
Here is an example plot of the captured samples when a 2 MHz sinusoid is fed to the ADC-D SMA connector:

test_adc in Componentxczu48dr chip on the RFSoC4x2 board.xczu48dr chip:
vitis-comp.json created for the Vitis platform, the field supportedFamily is set to the generic value fpga, rather than the value zynquplusRFSOC exported by Vivado.package.cfg), but QEMU hangs after it is started from the script file provided.zynquplusRFSOC to zynquplus in the file xsa.json in the hardware archives rfsoc_adc_hardware.xsa and rfsoc_adc_hardware_emu.xsa, and the value of the field supportedFamily in vitis-comp.json to zynquplus in order to trick Vitis into thinking xczu48dr was a zynquplus. The choice HARDWARE EMULATION->Start Emulator showed up under the FLOW view, but QEMU still hung.