Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vunit_tb_name tcl variable and vunit_tb_path for Active-HDL #1033

Merged
merged 2 commits into from
Jun 22, 2024

Conversation

maleiter
Copy link
Contributor

The main usage of the sim options .init_file.gui is loading the correct wave file.
To load the correct wave file, the vunit_tb_path variable is defined during script evaluation. That variable points to the directory that contains the testbench.

If a user wants to load different wave files for different test benches located in the same directory, the name of the testbench is needed.

This PR adds the name of the test bench as a tcl variable called vunit_tb_name for modelsim, riviera and active-hdl.
This PR also adds the vunit_tb_path for active-hdl.

Example usage for Active-HDL

tb.set_sim_option("activehdl.init_file.gui", "activehdl_gui.do")

activehdl_gui.do:

global wavefile
set wavefile ${vunit_tb_path}/${vunit_tb_name}_wave.do

# try to source a wave file with the name of the design unit
if { [file exists ${wavefile}] } {
    puts "loading wave from '${wavefile}'."
    do ${wavefile}
} else {
    puts "No Wave file found in the testbench directory. If you save a wave as '${vunit_tb_name}_wave.do', it will be loaded automatically next time."
}

vunit/sim_if/vsim_simulator_mixin.py Outdated Show resolved Hide resolved
vunit/sim_if/activehdl.py Outdated Show resolved Hide resolved
@maleiter
Copy link
Contributor Author

@LarsAsplund Since my changes were based on a former version of #1032, I had to rebase and force-push everything. It's ready now :)

@LarsAsplund LarsAsplund merged commit 76e9732 into VUnit:master Jun 22, 2024
14 checks passed
@LarsAsplund
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants