Skip to content

Commit 4db8eed

Browse files
committed
Merge branch 'dev'
2 parents 2738eed + 6920504 commit 4db8eed

8 files changed

+54
-43
lines changed

Log2Osvvm.tcl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,10 @@ namespace eval ::osvvm {
214214
set GenericNames ""
215215
if {[regexp {generic} $LineOfLogFile] } {
216216
set GenericDict [regsub {\].*} [regsub -all {[^\[]*\[generic ([^\]]*)} $LineOfLogFile {\1 }] ""]
217-
foreach {name val} $GenericDict {
218-
set GenericNames ${GenericNames}_${name}_${val}
219-
}
217+
set GenericNames [ToGenericNames $GenericDict]
218+
# foreach {name val} $GenericDict {
219+
# set GenericNames ${GenericNames}_${name}_${val}
220+
# }
220221
}
221222
if {! $InRunTest} {
222223
puts $HtmlFileHandle "${PrintPrefix}<details><summary>$LineOfLogFile</summary><span id=\"${LogTestSuiteName}_${LogTestCaseName}${GenericNames}\" />"

OsvvmScriptsCore.tcl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,14 +1243,19 @@ proc CoSim {} {
12431243
return ""
12441244
}
12451245

1246+
#--------------------------------------------------------------
1247+
proc RemoveFilePathChars {PathString} {
1248+
return [regsub {:} [regsub -all {\/} ${PathString} "_"] ""]
1249+
}
1250+
12461251
# -------------------------------------------------
12471252
proc generic {Name Value} {
12481253
variable GenericDict
12491254
variable GenericNames
12501255
variable GenericOptions
12511256

12521257
dict append GenericDict $Name $Value
1253-
set GenericNames ${GenericNames}_${Name}_${Value}
1258+
set GenericNames ${GenericNames}_${Name}_[RemoveFilePathChars ${Value}]
12541259
#x lappend GenericOptions [vendor_generic ${Name} ${Value}]
12551260
append GenericOptions " " [vendor_generic ${Name} ${Value}]
12561261
return ""
@@ -1279,7 +1284,7 @@ proc ToGenericNames {GenericDict} {
12791284
set Names ""
12801285
if {${GenericDict} ne ""} {
12811286
foreach {GenericName GenericValue} $GenericDict {
1282-
set Names ${Names}_${GenericName}_${GenericValue}
1287+
set Names ${Names}_${GenericName}_[RemoveFilePathChars ${GenericValue}]
12831288
}
12841289
}
12851290
return $Names
@@ -1363,6 +1368,7 @@ proc TestSuite {SuiteName} {
13631368

13641369
set TestSuiteName $SuiteName
13651370

1371+
CheckWorkingDir
13661372
CheckSimulationDirs
13671373
CreateDirectory [file join ${::osvvm::CurrentSimulationDirectory} ${::osvvm::ReportsDirectory} ${TestSuiteName}]
13681374
CreateDirectory [file join ${::osvvm::CurrentSimulationDirectory} ${::osvvm::ResultsDirectory} ${TestSuiteName}]

OsvvmScriptsFileCreate.tcl

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,43 @@ namespace eval ::osvvm {
4646
# -------------------------------------------------
4747
# FindOsvvmSettingsDirectory
4848
#
49-
proc FindOsvvmSettingsDirectory {} {
49+
proc FindOsvvmSettingsDirectory {{OsvvmSubdirectory "osvvm"}} {
50+
# When StartUpShared.tcl calls this to determine the value of ::osvvm::OsvvmUserSettingsDirectory,
51+
# OsvvmSettingsLocal.tcl has not been run yet, as a result,
52+
# * OsvvmSettingsSubDirectory will have its default value of "" and
53+
# * SettingsAreRelativeToSimulationDirectory will have its default value of false.
54+
# For OsvvmSettingsSubDirectory, this is ok as it is only needed to differentiate the VHDL code and not the settings.
55+
# SettingsAreRelativeToSimulationDirectory this is not ok and it usage has been deprecated.
56+
# This was used to differentiate VHDL sources for different simulators - use OsvvmSettingsSubDirectory instead
57+
#
58+
59+
set SettingsRootDirectory ${::osvvm::OsvvmHomeDirectory}
60+
if {$::osvvm::SettingsAreRelativeToSimulationDirectory} {
61+
puts "WARNING: SettingsAreRelativeToSimulationDirectory is deprecated. Usage will generate an error in the future"
62+
set SettingsRootDirectory [file normalize ${::osvvm::CurrentSimulationDirectory}]
63+
}
5064

5165
if {[info exists ::env(OSVVM_SETTINGS_DIR)]} {
52-
# if OSVVM_SETTINGS_DIR has an absolute path, CurrentSimulationDirectory/OsvvmHomeDirectory is ignored
53-
if {$::osvvm::SettingsAreRelativeToSimulationDirectory} {
54-
set SettingsDirectory [file join ${::osvvm::CurrentSimulationDirectory} $::env(OSVVM_SETTINGS_DIR) ${::osvvm::OsvvmSettingsSubDirectory}]
55-
} else {
56-
set SettingsDirectory [file join ${::osvvm::OsvvmHomeDirectory} $::env(OSVVM_SETTINGS_DIR) ${::osvvm::OsvvmSettingsSubDirectory}]
57-
}
66+
# Note that OSVVM_SETTINGS_DIR may be either an absolute or relative path
67+
# For relative paths, use OsvvmHomeDirectory (location of OsvvmLibraries) as the base
68+
set SettingsDirectory $::env(OSVVM_SETTINGS_DIR)
69+
} elseif {[file isdirectory ${SettingsRootDirectory}/../OsvvmSettings]} {
70+
set SettingsDirectory ../OsvvmSettings
5871
} else {
59-
if {$::osvvm::SettingsAreRelativeToSimulationDirectory} {
60-
set SettingsDirectory [file join ${::osvvm::CurrentSimulationDirectory} ${::osvvm::OsvvmSettingsSubDirectory}]
61-
} else {
62-
set SettingsDirectory [file join ${::osvvm::OsvvmHomeDirectory} "osvvm" ${::osvvm::OsvvmSettingsSubDirectory}]
63-
}
72+
puts "Note: Putting setting in directory OsvvmLibraries/${OsvvmSubdirectory}"
73+
set SettingsDirectory ${OsvvmSubdirectory}
6474
}
65-
CreateDirectory $SettingsDirectory
66-
# set RelativeSettingsDirectory [::fileutil::relative [pwd] $SettingsDirectory]
75+
76+
set SettingsDirectoryFullPath [file normalize [file join ${SettingsRootDirectory} ${SettingsDirectory} ${::osvvm::OsvvmSettingsSubDirectory}]]
77+
78+
CreateDirectory $SettingsDirectoryFullPath
79+
# set RelativeSettingsDirectory [::fileutil::relative [pwd] $SettingsDirectoryFullPath]
6780
# return $RelativeSettingsDirectory
6881
# Needs to be a normalized path
69-
return $SettingsDirectory
82+
return $SettingsDirectoryFullPath
7083
}
7184

85+
7286
# -------------------------------------------------
7387
# CreateOsvvmScriptSettingsPkg
7488
#

OsvvmSettingsLocal_example.tcl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ namespace eval ::osvvm {
111111
# OsvvmSettingsSubDirectory
112112
# Location for package bodies generated: OsvvmScriptSettingsPkg_generated.vhd and OsvvmScriptSettingsPkg_generated.vhd
113113
# Project/User settings OsvvmSettingsPkg_local.vhd
114-
# variable SettingsAreRelativeToSimulationDirectory "false"
115-
# variable OsvvmSettingsSubDirectory ""
114+
# Deprecated: variable SettingsAreRelativeToSimulationDirectory "false" ;# Setting deprecated. false is the only legal value
115+
# variable OsvvmSettingsSubDirectory "" ;# default value
116+
# variable OsvvmSettingsSubDirectory "${ToolName}" ;# Recommended if running multiple simulators
117+
# variable OsvvmSettingsSubDirectory "${ToolNameVersion}" ;# Recommended if running multiple simulators
116118

117119

118120
#
@@ -152,7 +154,7 @@ namespace eval ::osvvm {
152154
#
153155
# VHDL Simulation Settings
154156
#
155-
# variable DefaultVHDLVersion "2008" ; # OSVVM requires > 2008. Valid values 1993, 2002, 2008, 2019
157+
# variable DefaultVHDLVersion "2008" ; # OSVVM requires >= 2008. Valid values 1993, 2002, 2008, 2019
156158
# variable SimulateTimeUnits "ps"
157159
# variable DefaultLibraryName "DefaultLib"
158160

OsvvmSettingsRequired.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
namespace eval ::osvvm {
5858

59-
variable OsvvmVersion 2025.02
59+
variable OsvvmVersion 2025.04
6060
variable OsvvmBuildYamlVersion 2025.02
6161
variable OsvvmTestCaseYamlVersion 2025.02
6262
# The following are set in VHDL code. Either need to pass these or have it directly in the VHDL Code.

StartUpShared.tcl

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,28 +112,16 @@ if {[file exists ${::osvvm::OsvvmScriptDirectory}/../CoSim]} {
112112
# Import any procedure exported by previous OSVVM scripts
113113
namespace import ::osvvm::*
114114

115-
# --------------------------------
116-
# Get Directory for User Settings
117-
# --------------------------------
118-
if {[info exists ::env(OSVVM_SETTINGS_DIR)]} {
119-
# file join supports either relative or absolute paths
120-
variable ::osvvm::OsvvmUserSettingsDirectory [file join $::osvvm::OsvvmScriptDirectory $::env(OSVVM_SETTINGS_DIR)]
121-
if {![file isdirectory $::osvvm::OsvvmUserSettingsDirectory]} {
122-
puts "ScriptError: OSVVM_SETTINGS_DIR not a directory: $::env(OSVVM_SETTINGS_DIR)"
123-
variable ::osvvm::OsvvmUserSettingsDirectory $::osvvm::OsvvmScriptDirectory
124-
}
125-
} elseif {[file isdirectory $OsvvmLibraries/../OsvvmSettings] } {
126-
variable ::osvvm::OsvvmUserSettingsDirectory [file $OsvvmLibraries/../OsvvmSettings]
127-
} else {
128-
variable ::osvvm::OsvvmUserSettingsDirectory $::osvvm::OsvvmScriptDirectory
129-
}
130115

131116
# --------------------------------
132117
# Settings: OsvvmSettings*.tcl
133118
# --------------------------------
134119
# Settings First: OSVVM Default Settings
135120
source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsDefault.tcl
136121

122+
# Get Directory for User settings
123+
variable ::osvvm::OsvvmUserSettingsDirectory [FindOsvvmSettingsDirectory "Scripts"]
124+
137125
# Settings Second: OSVVM User/Project Customizations - not required
138126
if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal.tcl]} {
139127
# Found in OSVVM_SETTINGS_DIR

VendorScripts_Siemens.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ package require fileutil
114114
variable DebugOptions "+acc"
115115
}
116116

117-
if {[expr [string compare $ToolVersion "2024.2"] >= 0]} {
118-
SetVHDLVersion 2019
119-
}
117+
# if {[expr [string compare $ToolVersion "2024.2"] >= 0]} {
118+
# SetVHDLVersion 2019
119+
# }
120120

121121
# -------------------------------------------------
122122
# StartTranscript / StopTranscxript

VendorScripts_Visualizer.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ package require fileutil
9090
variable ToolVersion tbd
9191
}
9292

93-
SetVHDLVersion 2019
93+
# SetVHDLVersion 2019
9494

9595
# Set if not set
9696
if {![info exists ::VoptArgs]} {

0 commit comments

Comments
 (0)