-
Notifications
You must be signed in to change notification settings - Fork 101
en fpga zynq synth for linux
- See Development Environment and setup the development environment for
Boot on Xilinx Zynq FPGA boards
. - See Environment Variables and setup the environment variables for
Boot on Xilinx Zynq FPGA boards
. - (Optional, but recommended) Install Synplify.
- You can choose either from synthesizing using Synplify netlist and synthesizing using Vivado only.
- However, Synplify+Vivado provided better operating frequency compared to Vivado only in our evaluation.
source /<path_of_Xilinx>/Vitis/2019.2/settings64.sh
- Modify the
TARGET_BOARD
variable. - Note:
ZedBoard
is considered in the following steps.
This procedure is unnecessary if you will synthesis RSD using Vivado only.
- Open Processor/Project/Synplify/ver2017-03.prj on Synplify.
- In Synplify, select "ZedBoard" in the opened project and click "Run".
- If the synthesis ran successfully, rsd.vm is generated in Project/Synplify/ZedBoard/.
-
Go to $(RSD_ROOT)/Processor/Src and run either of below command.
- For synthesizing using Vivado only,
make -f Makefile.vivado.mk xilinx-arm-linux
- For synthesizing using the netlist generated by Synplify,
make -f Makefile.synplify.mk xilinx-arm-linux
-
Be sure to run
vivado-clean
if you switch synthesizersmake -f Makefile.vivado.mk vivado-clean make -f Makefile.synplify.mk vivado-clean
- For synthesizing using Vivado only,
-
This step may take minutes or hours, depending on your machine and network speed.
-
These commands generate the following files in $(RSD_ARM_LINUX)/boot.
- ARM Linux kernel for Zynq PS (uImage)
- Device tree for ARM Linux kernel (devicetree.dtb)
- Boot image including the RSD bitstream file (boot.bin)
-
A Debian rootfs for Zynq PS (ROOTFS.tar.gz) is also downloaded in $(RSD_ARM_LINUX).
If you want to add your new source files into Vivado project, please refer "Add New Files into Project" in this page
Note: root privileges are required.
tar -xf ROOTFS.tar.gz
Edit $(RSD_ARM_LINUX)/ROOTFS/etc/network/interfaces using a text editor.
Note: root privileges are required.
Example (set the IP address statically to 192.168.1.83):
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.83
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.2
Note: a high-speed 16GB>= SD card is recommended.
Note: root privileges are required.
- Check the device name of the SD card in /dev/.
Note:
lsblk
/dev/sdd
is considered in the following steps. - Create partitions in the SD card.
# The following operations in the fdisk command are separated by ";" and are executed one by one. sudo fdisk /dev/sdd d # Delete all the partitions in the SD card n; p; 1; Enter; +1024M; # Create the 1st partition n; p; 2; Enter; Enter; # Create the 2nd partition t; 1; b; # Change the partition type of the 1st partition to FAT32(Win95) a; 1; # Add a bootable flag to the 1st partition w # Apply all the changes to the SD card
- Format the SD card.
sudo mkfs.msdos -n BOOT /dev/sdd1 sudo mkfs.ext4 -L ROOTFS /dev/sdd2
- Copy all files to the SD card.
mkdir BOOT_MNT mkdir ROOTFS_MNT sudo mount /dev/sdd1 BOOT_MNT sudo mount /dev/sdd2 ROOTFS_MNT sudo cp -R $(RSD_ARM_LINUX)/ROOTFS/* ROOTFS_MNT sudo cp $(RSD_ARM_LINUX)/boot/devicetree.dtb BOOT_MNT sudo cp $(RSD_ARM_LINUX)/boot/uImage BOOT_MNT sudo cp $(RSD_ARM_LINUX)/boot/boot.bin BOOT_MNT # You must unmount these directories! sudo umount BOOT_MNT sudo umount ROOTFS_MNT
- Login via SSH.
User name : root Password : rsd
- Please check the boot log via the USB-UART port if SSH connection is not established.
- Send $(RSD_ROOT)/Processor/Project/Vivado/ARM_Linux/ProgramLoader/loader.c to ZedBoard via SCP.
- Compile loader.c on ZedBoard.
- Send your program code.hex via SCP.
- See this page to learn how to make your program code.hex.
- Run your program using the program loader.
# "byte size of code.hex" is the size in binary, which matches the size of code.bin # Currently 98304 ./loader <path of code.hex> <byte size of code.hex>
- Regenerate boot image (boot.bin) containing RSD bitstream file in your local machine
make -f Makefile.(synplify|vivado).mk xilinx-arm-linux
- Mount the BOOT partition in Zynq
mkdir boot mount /dev/mmcblk0p1 boot
- Transfer boot.bin to Zynq
- Overwrite the boot.bin in the "boot" that you just mounted.
- boot.bin is generated at
${RSD_ARM_LINUX}/boot/boot.bin/boot.bin
.
- Reboot
shutdown -r now