-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathStartUpShared.tcl
203 lines (178 loc) · 8.97 KB
/
StartUpShared.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File Name: StartUpShared.tcl
# Purpose: Scripts for running simulations
# Revision: OSVVM MODELS STANDARD VERSION
#
# Maintainer: Jim Lewis email: [email protected]
# Contributor(s):
# Jim Lewis email: [email protected]
#
# Description
# StartUp scripts that are shared by any simulator
# Called by StartUp and StartVCS, StartXcelium, ...
#
# Developed by:
# SynthWorks Design Inc.
# VHDL Training Classes
# OSVVM Methodology and Model Library
# 11898 SW 128th Ave. Tigard, Or 97223
# http://www.SynthWorks.com
#
# Revision History:
# Date Version Description
# 05/2024 2024.05 Updated for renaming during refactoring
# 05/2022 2022.05 Refactored StartUp.tcl to remove items
# shared by all StartUp scripts
# 10/2021 2021.10 Loads OsvvmYamlSupport.tcl when YAML library available
# Loads LocalScriptDefaults.tcl if it is in the OsvvmScriptDirectory
# This is a optional user settings file.
# LocalScriptsDefaults.tcl is not provided by OSVVM so your local settings will not be overwritten.
# 2/2021 2021.02 Refactored.
# - Initial tool settings now in VendorScripts_*.tcl (was in ToolConfiguration.tcl)
# - Added: Default settings now in OsvvmScriptDefaults.tcl (was here)
# - Removed: ToolConfiguration.tcl (now in StartUp.tcl and VendorScripts_*.tcl)
# 7/2020 2020.07 Refactored tool execution for simpler vendor customization
# 1/2020 2020.01 Updated Licenses to Apache
# 2/2019 Beta Project descriptors in .pro which execute
# 11/2018 Alpha Project descriptors in .files and .dirs files
# as TCL scripts in conjunction with the library
# procedures
#
#
# This file is part of OSVVM.
#
# Copyright (c) 2018 - 2022 by SynthWorks Design Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
namespace eval ::osvvm {
# --------------------------------
# Set OsvvmScriptDirectory if it is not already set
# --------------------------------
# Usage of SCRIPT_DIR is deprecated.
if {![info exists OsvvmScriptDirectory]} {
# if a calling script uses SCRIPT_DIR, this supports backward compatibility
variable OsvvmScriptDirectory ${SCRIPT_DIR}
} else {
# if a user add on script uses SCRIPT_DIR, this supports backward compatibility
variable SCRIPT_DIR ${OsvvmScriptDirectory}
}
variable OsvvmHomeDirectory [file normalize ${OsvvmScriptDirectory}/..]
}
variable OsvvmLibraries $::osvvm::OsvvmHomeDirectory
# --------------------------------
# Load OSVVM Core API
# --------------------------------
source ${::osvvm::OsvvmScriptDirectory}/OsvvmScriptsCreateYamlReports.tcl ;# Helpers for creating YAML files
source ${::osvvm::OsvvmScriptDirectory}/OsvvmScriptsCore.tcl ;# OSVVM Core API
source ${::osvvm::OsvvmScriptDirectory}/OsvvmScriptsFileCreate.tcl ;# OSVVM API for file creation
# --------------------------------
# Vendor personalization of OSVVM API
# --------------------------------
namespace eval ::osvvm {
source ${::osvvm::OsvvmScriptDirectory}/VendorScripts_${::osvvm::ScriptBaseName}.tcl
}
# --------------------------------
# Scripts to convert OSVVM Yaml outputs to HTML and XML files
# --------------------------------
if {[catch {package require yaml}]} {
source ${::osvvm::OsvvmScriptDirectory}/StartUpYamlMockReports.tcl
} else {
source ${::osvvm::OsvvmScriptDirectory}/StartUpYamlLoadReports.tcl
}
# --------------------------------
# Convert tool generated log files to HTML, ...
# --------------------------------
source ${::osvvm::OsvvmScriptDirectory}/Log2Osvvm.tcl
# --------------------------------
# CoSim API additions
# --------------------------------
if {[file exists ${::osvvm::OsvvmScriptDirectory}/../CoSim]} {
source ${::osvvm::OsvvmScriptDirectory}/../CoSim/Scripts/MakeVproc.tcl
}
# Import any procedure exported by previous OSVVM scripts
namespace import ::osvvm::*
# --------------------------------
# Get Directory for User Settings
# --------------------------------
if {[info exists ::env(OSVVM_SETTINGS_DIR)]} {
# file join supports either relative or absolute paths
variable ::osvvm::OsvvmUserSettingsDirectory [file join $::osvvm::OsvvmScriptDirectory $::env(OSVVM_SETTINGS_DIR)]
if {![file isdirectory $::osvvm::OsvvmUserSettingsDirectory]} {
puts "ScriptError: OSVVM_SETTINGS_DIR not a directory: $::env(OSVVM_SETTINGS_DIR)"
variable ::osvvm::OsvvmUserSettingsDirectory $::osvvm::OsvvmScriptDirectory
}
} elseif {[file isdirectory $OsvvmLibraries/../OsvvmSettings] } {
variable ::osvvm::OsvvmUserSettingsDirectory [file $OsvvmLibraries/../OsvvmSettings]
} else {
variable ::osvvm::OsvvmUserSettingsDirectory $::osvvm::OsvvmScriptDirectory
}
# --------------------------------
# Settings: OsvvmSettings*.tcl
# --------------------------------
# Settings First: OSVVM Default Settings
source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsDefault.tcl
# Settings Second: OSVVM User/Project Customizations - not required
if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal.tcl]} {
# Found in OSVVM_SETTINGS_DIR
source ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal.tcl
} elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsLocal.tcl]} {
# Deprecated. Found in Scripts Directory - backward compatible
source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsLocal.tcl
} elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/LocalScriptDefaults.tcl]} {
# Deprecated: Uses old name - backward compatible
source ${::osvvm::OsvvmScriptDirectory}/LocalScriptDefaults.tcl
}
# Settings Third OSVVM User Simulator specific defaults - not required
if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal_${::osvvm::ScriptBaseName}.tcl]} {
# Found in OSVVM_SETTINGS_DIR
source ${::osvvm::OsvvmUserSettingsDirectory}/OsvvmSettingsLocal_${::osvvm::ScriptBaseName}.tcl
} elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsLocal_${::osvvm::ScriptBaseName}.tcl]} {
# Deprecated. Found in Scripts Directory - backward compatible
source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsLocal_${::osvvm::ScriptBaseName}.tcl
} elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/LocalScriptDefaults_${::osvvm::ScriptBaseName}.tcl]} {
# Deprecated: Uses old name - backward compatible
source ${::osvvm::OsvvmScriptDirectory}/LocalScriptDefaults_${::osvvm::ScriptBaseName}.tcl
}
# Settings Final OSVVM Finalize Settings - builds names that are dependent on other names
source ${::osvvm::OsvvmScriptDirectory}/OsvvmSettingsRequired.tcl
# --------------------------------
# CallBacks & Error Handlers: Callback*.tcl
# --------------------------------
# Callbacks First: OSVVM Default CallBacks
source ${::osvvm::OsvvmScriptDirectory}/CallbackDefaults.tcl
# Callbacks Second: OSVVM User/Project Customizations - not required
if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/LocalCallbacks.tcl]} {
# Found in OSVVM_SETTINGS_DIR
source ${::osvvm::OsvvmUserSettingsDirectory}/LocalCallbacks.tcl
} elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/LocalCallbacks.tcl]} {
# Deprecated. Found in Scripts Directory - backward compatible
source ${::osvvm::OsvvmScriptDirectory}/LocalCallbacks.tcl
}
# Callback Third: OSVVM User Simulator specific defaults - not required
if {[file exists ${::osvvm::OsvvmUserSettingsDirectory}/LocalCallbacks_${::osvvm::ScriptBaseName}.tcl]} {
# Found in OSVVM_SETTINGS_DIR
source ${::osvvm::OsvvmUserSettingsDirectory}/LocalCallbacks_${::osvvm::ScriptBaseName}.tcl
} elseif {[file exists ${::osvvm::OsvvmScriptDirectory}/LocalCallbacks_${::osvvm::ScriptBaseName}.tcl]} {
# Deprecated. Found in Scripts Directory - backward compatible
source ${::osvvm::OsvvmScriptDirectory}/LocalCallbacks_${::osvvm::ScriptBaseName}.tcl
}
# --------------------------------
# If the tee scripts load, mark them as available
# --------------------------------
if {[catch {source ${::osvvm::OsvvmScriptDirectory}/tee.tcl}]} {
variable ::osvvm::GotTee false
} else {
variable ::osvvm::GotTee true
}
puts "OSVVM Script Version: $::osvvm::OsvvmVersion"
puts "Simulator Version: $::osvvm::ToolNameVersion"