Skip to content

Commit

Permalink
Merge pull request #332 from slaclab/pre-release
Browse files Browse the repository at this point in the history
Release Candidate 4.17.0
  • Loading branch information
ruck314 authored Nov 12, 2024
2 parents e3ff0b0 + 1569f9a commit 918ae75
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 9 deletions.
4 changes: 4 additions & 0 deletions vivado/gui.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ if { [isVersal] } {
# Call the user script
SourceTclFile ${VIVADO_DIR}/gui.tcl

# Attempt to upgrade before opening GUI
upgrade_ip [get_ips]
export_ip_user_files -of_objects [get_ips] -no_script -sync -force -quiet

# Bug fix work around for Vivado due to post script changes
if { [CheckSynth] == true } {
set_property NEEDS_REFRESH 0 [get_runs impl_1]
Expand Down
78 changes: 70 additions & 8 deletions vivado/proc/code_loading.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,72 @@ proc loadConstraints args {
}
}

## Function to check if the component.xml is different for new user ZIP IP core
## Returns True if they are different of IP not loaded yet
proc checkComponentXml { newIpPath repoPath } {
# Define paths for the existing and new component.xml files
set ipName [file rootname [file tail $newIpPath]]
set oldComponentPath "${repoPath}/${ipName}/component.xml"
set tempComponentPath "$::env(OUT_DIR)/component.xml"

# Check if the old component.xml exists in the repository
if { ![file exists $oldComponentPath] } {
# Return TRUE if the old component.xml does not exist
return true
}

# Check if the ZIP file exists
if { ![file exists $newIpPath] } {
puts "\n\n\n\n\n********************************************************"
puts "checkComponentXml: ZIP file does not exist at $newIpPath"
puts "********************************************************\n\n\n\n\n"
exit -1
}

# Try extracting component.xml from the ZIP file
if {[catch {exec unzip -p $newIpPath component.xml > $tempComponentPath} result]} {
puts "\n\n\n\n\n********************************************************"
puts "checkComponentXml: Failed to extract component.xml from ZIP file. Details: $result"
puts "********************************************************\n\n\n\n\n"
exit -1
}

# Verify the extracted file exists
if { ![file exists $tempComponentPath] } {
puts "\n\n\n\n\n********************************************************"
puts "checkComponentXml: component.xml could not be found in the extracted ZIP content"
puts "********************************************************\n\n\n\n\n"
exit -1
}

# Read both files for comparison
set oldFile [open $oldComponentPath]
set oldContent [read $oldFile]
close $oldFile

set newFile [open $tempComponentPath]
set newContent [read $newFile]
close $newFile

# Clean up the temporary file
file delete $tempComponentPath

# Compare the content of both files
if { $oldContent ne $newContent } {

# Delete the old content
exec rm -rf ${repoPath}/${ipName}
update_ip_catalog -rebuild -scan_changes

# Return TRUE if files are different
return true

}

# Return FALSE if files are identical
return false
}

## Function to load ZIP IP cores
proc loadZipIpCore args {
set options {
Expand Down Expand Up @@ -486,10 +552,8 @@ proc loadZipIpCore args {
set fileExt [file extension $params(path)]
if { ${fileExt} eq {.zip} ||
${fileExt} eq {.ZIP} } {
# Check if directory doesn't exist yet
set strip [file rootname [file tail $params(path)]]
set dirPath "$params(repo_path)/${strip}"
if { [file isdirectory [file rootname ${dirPath}]] == 0 } {
# Check the component.xml file
if { [checkComponentXml $params(path) $params(repo_path)] } {
# Add achieved .zip to repo path
update_ip_catalog -add_ip $params(path) -repo_path $params(repo_path)
}
Expand Down Expand Up @@ -518,10 +582,8 @@ proc loadZipIpCore args {
if { ${list} != "" } {
# Load all the constraint files
foreach pntr ${list} {
# Check if directory doesn't exist yet
set strip [file rootname [file tail ${pntr}]]
set dirPath "$params(repo_path)/${strip}"
if { [file isdirectory [file rootname ${dirPath}]] == 0 } {
# Check the component.xml file
if { [checkComponentXml ${pntr} $params(repo_path)] } {
# Add achieved .zip to repo path
update_ip_catalog -add_ip ${pntr} -repo_path $params(repo_path)
}
Expand Down
1 change: 1 addition & 0 deletions vivado/proc/debug_probes.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ proc WriteDebugProbes {ilaName {filePath ""}} {
if { [VersionCompare 2017.2] <= 0 } {
# Write the port map file
write_debug_probes -force ${filePath}

} else {
# Check if not empty string
if { ${filePath} != "" } {
Expand Down
1 change: 1 addition & 0 deletions vivado/proc/ip_management.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ proc BuildIpCores { } {

# Attempt to upgrade before building IP cores
upgrade_ip [get_ips]
export_ip_user_files -of_objects [get_ips] -no_script -sync -force -quiet

# Check if the target project has IP cores
if { [get_ips] != "" } {
Expand Down
2 changes: 1 addition & 1 deletion vivado/vcs.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ proc VcsVersionCheck { } {
set retVar -1

# List of supported VCS versions
set supported "M-2017.03 N-2017.12 O-2018.09 Q-2020.03 R-2020.12 S-2021.09 T-2022.06 V-2023.12"
set supported "M-2017.03 N-2017.12 O-2018.09 Q-2020.03 R-2020.12 S-2021.09 T-2022.06 V-2023.12 W-2024.09"

# Get Version Name
set VersionNumber [GetVcsName]
Expand Down

0 comments on commit 918ae75

Please sign in to comment.