Visualizer Open source files on Visualizer GUI from the transcript terminal or from a do file

2024-07-23T08:50:37.000-0400
Debug

Summary

Opening source windows from the transcript window is available by running a TCL command. Once you know which files to open, you can automate the process. For instance, open those files on Visualizer startup. For that, you will need to invoke visualizer with addition of '-do' and specify the relevant TCL command directly or indirectly with a '*.do' file.


Details

The following TCL command will open a source file in Visualizer GUI:

view source -new -lang automatic -file <filename>

 

For instance:

Useful suggestion to open multiple files is with a "foreach" loop:

foreach src_file {file1 file2 file3} {
    view source -new -lang automatic -file $src_file
}

 

Motivation:

On startup there is one file open by default: the top file. When debugging, we may find ourselves opening the same files repeatedly. Most likely, we will spend some time to open a certain hierarchy, check drivers, or search a file manually. With this TCL command, we can make it more convenient by having several files open in the GUI right on startup.

This is not limited to known files, we can open a file based on test results. For instance, to open the file that called the first failure message in the test log file:

set src_file [ exec grep -E "UVM_ERROR|UVM_FATAL" myTest.log -m 1 | awk "{print \$2}" | cut -d ( -f1 ]

view source -new -lang automatic -file $src_file

 

Example:

The following example is taken from Questa installation dir: <QUESTA_DIR>/questasim/ examples/qrun_examples/simple_vpi/

First, we can create the following .do file

open.do:

foreach src_file {prim.v dff.v} {

    view source -new -lang automatic -file $src_file

}

 

Next, from the terminal run and launch Visualizer with the following command:

qrun -f qrun.f -gui -visualizer -do "open.do"

Visualizer is now open with 2 additional files: prim.v and dff.v

 

KB Article ID# KB000133720_EN_US

Contents

SummaryDetails

Associated Components

Visualizer Debug