Skip to content

Instantly share code, notes, and snippets.

@imrickysu
imrickysu / vivado_vcu_2018.2_bd.tcl
Created January 7, 2019 02:34
A Vivado Block Design Tcl for simple VCU connection with PS
################################################################
# This is a generated script based on design: design_1
#
# Though there are limitations about the generated script,
# the main purpose of this utility is to make learning
# IP Integrator Tcl commands easier.
################################################################
namespace eval _tcl {
@imrickysu
imrickysu / load.tcl
Created February 13, 2018 06:35
Use XSCT to load FSBL, PMUFW, ATF and U-boot on MPSoC via JTAG
# How to use load.tcl
# source settings.sh of Vivado, SDK or PetaLinux in Bash
# xsct
# XSCT% source load.tcl
# XSCT% disconnect # when rerun needed or complete
connect
# connect -host <IP> if using SmartLync or remote debug
after 2000
@imrickysu
imrickysu / vivado_proj_hdf_generation.tcl
Created January 22, 2017 08:25
Export Hardware for a generic Vivado project without using specific project paths
# Export Hardware
set project_name [get_property NAME [current_project ]]
set project_path [get_property DIRECTORY [current_project ]]
set sdk_name [append project_name ".sdk"]
set sdk_path [file join $project_path $sdk_name]
set top_name [get_property TOP [current_fileset]]
if {![file exists $sdk_path]} {
file mkdir $sdk_path
}
write_hwdef -force -file ${sdk_path}/${top_name}.hdf
@imrickysu
imrickysu / vivado_proj_bit_generation.tcl
Created January 22, 2017 07:35
Create Vivado project by bd.tcl and run through implementation to bitstream generation
# launch with vivado -mode batch -source vivado_proj_bit_generation.tcl
# create block design
# bd.tcl is exported by "write_bd_tcl bd.tcl" in an existing project
source bd.tcl
# run through implementation
set wrapper_file [make_wrapper -files [get_files -filter {FILE_TYPE == "Block Designs"}] -top]
add_files -norecurse $wrapper_file
update_compile_order -fileset sources_1
@imrickysu
imrickysu / sdsoc_rootfs_pack.sh
Created November 5, 2015 02:25
pack sdsoc rootfs. Tested on 2015.2.
# refer to http://www.wiki.xilinx.com/Build+and+Modify+a+Rootfs
sh -c 'cd tmp_mnt/ && sudo find . | sudo cpio -H newc -o' | gzip -9 > new_initramfs.cpio.gz
mkimage -A arm -T ramdisk -C gzip -d new_initramfs.cpio.gz new_uramdisk.image.gz
@imrickysu
imrickysu / sdsoc_rootfs_unpack.sh
Created November 5, 2015 02:22
unpack sdsoc rootfs
# refer to http://www.wiki.xilinx.com/Build+and+Modify+a+Rootfs
dd if=uramdisk.image.gz bs=64 skip=1 of=ramdisk.image.gz
mkdir tmp_mnt
gunzip -c ramdisk.image.gz | sudo sh -c 'cd tmp_mnt/ && cpio -i'
cd tmp_mnt
@imrickysu
imrickysu / xapp1078_2014.4.markdown
Last active July 13, 2018 11:16
The instructions of creating an AMP example design with PetaLinux tools

Xapp1078 Instructions for Vivado 2014.4

NOTE: The zedBoard flow has not been verified

Note: This xapp requires using a Linux host to compile the embedded Linux kernel. The instructions have been setup such that all implementation work will be done in a directory called xapp1078_2014.4/design and all linux work will be done in a directory called xapp1078_2014.4/plnx-project. The instructions will require files to be copied between xapp1078_2014.4/design and xapp1078_2014.4/plnx-project so if the Vivado and SDK tools are ran on a Windows machine, the files will need to be copied from the Windows xapp1078_2014.4/design to the Linux machine's xapp1078_2014.4/plnx-project.

@imrickysu
imrickysu / download_bit.bat
Created August 19, 2015 06:28
Use XMD to download FPGA bit stream with one click.
set BIT_FILENAME=ps_emio_sfp.bit
echo fpga -f %BIT_FILENAME% > download_bit.tcl
call C:\Xilinx\SDK\2014.4\bin\xmd.bat -tcl download_bit.tcl
del download_bit.tcl
@imrickysu
imrickysu / ila_data_rw.tcl
Created July 14, 2015 09:00
ILA Waveform Manipulation
# Write ILA data into zip file
write_hw_ila_data filename.zip
# Read the waveform data in Vivado
open_hw
display_hw_ila_data [read_hw_ila_data filename.zip]
@imrickysu
imrickysu / file2bram.tcl
Created October 31, 2014 03:46
A demo to write to BRAM from File and read from BRAM to file for JTAG2AXI IP Core.
# Usage
# > settings64.bat
# > vivado -mode batch -source file2bram.tcl
# Note: Bitstream needs to be downloaded and running first
#################################################
# file2bram