Skip to content

Instantly share code, notes, and snippets.

@imrickysu
imrickysu / cd_project_directory.tcl
Created May 8, 2014 07:07
change working directory to project root directory
# This command is supported in Vivado.
cd [get_property DIRECTORY [current_project ]]
# Set it in "Customize Commands" can help to improve productivity.
@imrickysu
imrickysu / vivado_synth_ooc.tcl
Created May 17, 2014 15:25
prevent Vivado synthesis inserting IO to the netlist
synth_design -mode out_of_context
#For more info, refer to UG901.
@imrickysu
imrickysu / trip_plan_helper.md
Last active August 29, 2015 14:01
Useful websites in travel planing
@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 / 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 / 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 / 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 / enable_bitstream_compression.xdc
Last active April 19, 2018 14:04
Vivado enable bitstream compression
# From UG908
# Add the following command to xdc can make it take effect
set_property BITSTREAM.GENERAL.COMPRESS True [current_design]
@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.