Skip to content

Commit b92bb4f

Browse files
Fixed incorrect path returned by getHLSPaths function. (#62)
* Fixed incorrect path returned by getHLSPaths function. The base_path was being set incorrectly when the shls_path variable was already set by using the 'which' command. * Added fix for getting the base_path when using a release version of SHLS (#63) This fix doesn't work if the "shls" env var isn't in the path (line 21). The change to risc-v-demo/sev-kit-reference-design/script_support/additional_configurations/smarthls/sd_add_axis_converters.tcl means that "base_path" needs to be one level up from bin. So then that means "base_path" should be Libero_SoC_v2024.1/SmartHLS-2024.1/SmartHLS or C:\Microchip\Libero_SoC_v2024.1\SmartHLS-2024.1\SmartHLS. --------- Co-authored-by: jennifermah76 <132939922+jennifermah76@users.noreply.github.com>
1 parent 8b5b4ec commit b92bb4f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

risc-v-demo/sev-kit-reference-design/script_support/additional_configurations/functions.tcl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ proc getHlsPaths { } {
1717
if {![info exists shls_path]} {catch {set shls_path [exec which shls]}}
1818

1919
if {[info exists shls_path]} {
20-
set base_path [string trimright $shls_path SmartHLS/bin/shls]
20+
set base_path [string trimright $shls_path bin/shls]
2121
} else {
2222
global shls_path
2323
if { $OS == "Linux" } {
24-
set base_path [string cat [string trimright $install_loc Libero]/SmartHLS-$liberoRelease {/}]
25-
set ::env(PATH) [string cat $::env(PATH) ":" $base_path {SmartHLS/bin}]
26-
set shls_path [string cat $base_path {SmartHLS/bin/shls}]
24+
set base_path [string cat [string trimright $install_loc Libero]/SmartHLS-$liberoRelease {/SmartHLS}]
25+
set ::env(PATH) [string cat $::env(PATH) ":" $base_path {/bin}]
26+
set shls_path [string cat $base_path {/bin/shls}]
2727
} else {
28-
set base_path [string cat [string trimright $install_loc Designer]SmartHLS-$liberoRelease {/}]
28+
set base_path [string cat [string trimright $install_loc Designer]SmartHLS-$liberoRelease {/SmartHLS}]
2929
set base_path [file normalize $base_path]
3030
set drive [string range $install_loc 0 0]
31-
set shls_path "$base_path/SmartHLS/bin/shls.bat"
31+
set shls_path "$base_path/bin/shls.bat"
3232
set shls_path [file normalize $shls_path]
33-
set ::env(PATH) [string cat $::env(PATH) ";" $base_path {SmartHLS/bin}]
33+
set ::env(PATH) [string cat $::env(PATH) ";" $base_path {bin}]
3434
}
3535
}
3636
puts "base_path: $base_path"
@@ -44,8 +44,6 @@ proc getHlsPaths { } {
4444
}
4545

4646
#return the list of paths
47-
puts "SHLS PATH $shls_path"
48-
puts "BASE PATH $base_path"
4947
set pathList [list $base_path $shls_path]
5048
}
5149

risc-v-demo/sev-kit-reference-design/script_support/additional_configurations/smarthls/sd_add_axis_converters.tcl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
puts "TCL_BEGIN: [info script]"
2+
13
#
24
# NOTES:
35
# - Ideally this should go into their own create_hdl_plus_*.tcl files
46
#
57
set pathList [getHlsPaths]
68
set base_path [lindex $pathList 0]
7-
set base_path "$base_path/SmartHLS"
89
puts "base_path: $base_path"
910

1011
open_smartdesign -sd_name {Video_Pipeline}
@@ -126,3 +127,5 @@ sd_invert_pins -sd_name {Video_Pipeline} -pin_names {"AXIS_Video_Converter_0:i_v
126127
sd_invert_pins -sd_name {Video_Pipeline} -pin_names {"AXIS_Video_Converter_0:i_axis_reset"}
127128

128129
save_smartdesign -sd_name {Video_Pipeline}
130+
131+
puts "TCL_END: [info script]"

0 commit comments

Comments
 (0)