From fe08222bdf54b32b18dbd1ee734da6dac471c162 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 13 Jul 2016 18:46:34 +0200 Subject: [PATCH] Enable bitstream compression for Xilinx projects Enabling bitstream compression reduces the size of the generated bitstream. This means on one hand it will consume less storage, which is especially useful for the BOOT partition of the ADI images where we store BOOT.BIN files for all supported platforms. On the other hand a smaller bitstream is faster to load from the storage medium and it is also faster to program to the FPGA. So it reduces the overall boot time as well. The only downside of bitstream compression is that the bitstream size is no longer constant, but depends on the actual design and resource utilization. This will not work with bootloaders that expect a fixed size. When building a bitstream using the tcl scripts bitstream compression can be disabled by setting the ADI_NO_BITSTREAM_COMPRESSION environment variable. Initial tests show a reduction of a round 50% in size for most ADI projects. Signed-off-by: Lars-Peter Clausen --- projects/common/xilinx/compression_system_constr.xdc | 1 + projects/scripts/adi_project.tcl | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 projects/common/xilinx/compression_system_constr.xdc diff --git a/projects/common/xilinx/compression_system_constr.xdc b/projects/common/xilinx/compression_system_constr.xdc new file mode 100644 index 000000000..94ea80e52 --- /dev/null +++ b/projects/common/xilinx/compression_system_constr.xdc @@ -0,0 +1 @@ +set_property BITSTREAM.GENERAL.COMPRESS TRUE [current_design] diff --git a/projects/scripts/adi_project.tcl b/projects/scripts/adi_project.tcl index 15e76142f..2efdc701a 100644 --- a/projects/scripts/adi_project.tcl +++ b/projects/scripts/adi_project.tcl @@ -126,6 +126,12 @@ proc adi_project_create {project_name {mode 0}} { } else { write_hwdef -file "$project_name.data/$project_name.hwdef" } + + if {![info exists ::env(ADI_NO_BITSTREAM_COMPRESSION)] || ![info exists ADI_NO_BITSTREAM_COMPRESSION]} { + add_files -norecurse -fileset sources_1 \ + "$ad_hdl_dir/projects/common/xilinx/compression_system_constr.xdc" + } + } proc adi_project_files {project_name project_files} {