Skip to content

Commit

Permalink
adding ability to bypass bit and/or xsa copy
Browse files Browse the repository at this point in the history
  • Loading branch information
ruck314 committed Nov 4, 2023
1 parent 530c950 commit 20df08f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
8 changes: 8 additions & 0 deletions system_vivado.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ ifndef GEN_BIN_IMAGE
export GEN_BIN_IMAGE = 0
endif

ifndef GEN_BIT_IMAGE
export GEN_BIT_IMAGE = 1
endif

ifndef GEN_XSA_IMAGE
export GEN_XSA_IMAGE = 1
endif

ifndef RECONFIG_CHECKPOINT
export RECONFIG_CHECKPOINT = 0
export RECONFIG_STATIC_HASH = 0
Expand Down
31 changes: 17 additions & 14 deletions vivado/proc/output_files.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ proc CreateFpgaBit { } {
set topModule [file rootname [file tail [glob -dir ${IMPL_DIR} *.bit]]]

# Copy the .BIT file to image directory
exec cp -f ${IMPL_DIR}/${topModule}.bit ${imagePath}.bit
puts "Bit file copied to ${imagePath}.bit"

# Check if gzip-ing the image files
if { $::env(GZIP_BUILD_IMAGE) != 0 } {
exec gzip -c -f -9 ${IMPL_DIR}/${topModule}.bit > ${imagePath}.bit.gz
if { $::env(GEN_BIT_IMAGE) != 0 } {
exec cp -f ${IMPL_DIR}/${topModule}.bit ${imagePath}.bit
if { $::env(GZIP_BUILD_IMAGE) != 0 } {
exec gzip -c -f -9 ${IMPL_DIR}/${topModule}.bit > ${imagePath}.bit.gz
}
puts "Bit file copied to ${imagePath}.bit"
}

# Copy the .BIN file to image directory
Expand All @@ -38,20 +38,23 @@ proc CreateFpgaBit { } {
if { $::env(GZIP_BUILD_IMAGE) != 0 } {
exec gzip -c -f -9 ${IMPL_DIR}/${topModule}.bin > ${imagePath}.bin.gz
}
puts "Bin file copied to ${imagePath}.bin"
}

# Copy the .ltx file (if it exists)
CopyLtxFile

# Check for Vivado 2019.2 (or newer)
if { [VersionCompare 2019.2] >= 0 } {
# Try to generate the .XSA file
set src_rc [catch { write_hw_platform -fixed -force -include_bit -file ${imagePath}.xsa } _RESULT]
if { $::env(GEN_XSA_IMAGE) != 0 } {
# Check for Vivado 2019.2 (or newer)
if { [VersionCompare 2019.2] >= 0 } {
# Try to generate the .XSA file
set src_rc [catch { write_hw_platform -fixed -force -include_bit -file ${imagePath}.xsa } _RESULT]

# Else Vivado 2019.1 (or older)
} else {
# Try to generate the .HDF file
write_hwdef -force -file ${imagePath}.hdf
# Else Vivado 2019.1 (or older)
} else {
# Try to generate the .HDF file
write_hwdef -force -file ${imagePath}.hdf
}
}

# Create the MCS file (if target/vivado/promgen.tcl exists)
Expand Down

0 comments on commit 20df08f

Please sign in to comment.