vunit
vunit copied to clipboard
The path of the tcl files are missing as own variable
Within the file vsim_simulator_mixin.py
The file_path can help to source some other files from the same directory like:
do $file_path/wave.do .....
@staticmethod`
def _source_tcl_file(file_name, config, message):
"""
Create TCL to source a file and catch errors
Also defines the vunit_tb_path variable as the config.tb_path
"""
template = """
set vunit_tb_path "%s"
set file_name "%s"
set file_path "%s"
puts "Sourcing file ${file_name} from %s"
if {[catch {source ${file_name}} error_msg]} {
puts "Sourcing ${file_name} failed"
puts ${error_msg}
return true
}
"""
tcl = template % (
fix_path(str(Path(config.tb_path).resolve())),
fix_path(str(Path(file_name).resolve())),
fix_path(str(Path(file_name).resolve().parent)),
message,
)
return tcl