[dvsim] Add GUI mode for running simulations
The adds support for running simulations in GUI mode. This change plumbs
the dvsim switch `--gui` to the underlying tools. With VCS and Xcelium,
the respective GUI windows will open, exposing the UCLI prompt, where
the user can take control of running the simulation (debugging, adding
breakpoints etc).
If GUI mode is enabled and multiple tests are provided for run, it picks
the first and drops everything else. The onus is on the user to pick
correctly (pass a single test with `--items` and a specific seed with
`--seed`).
Further, in GUI mode, it drops the pass and fail patterns, since the
whole simulation is run from inside the tool (the log file is not
generated).
Only VCS and Xcelium are currently fully supported. For all others,
`--gui` has no effect.
Signed-off-by: Srikrishna Iyer <sriyer@google.com>
diff --git a/util/dvsim/Deploy.py b/util/dvsim/Deploy.py
index 372c5a0..a9b1677 100644
--- a/util/dvsim/Deploy.py
+++ b/util/dvsim/Deploy.py
@@ -435,8 +435,11 @@
self.job_name = "{}_{}_{}".format(self.sim_cfg.name, self.target,
self.build_mode)
self.output_dirs += [self.cov_db_test_dir]
- self.pass_patterns = self.run_pass_patterns
- self.fail_patterns = self.run_fail_patterns
+
+ # In GUI mode, the log file is not updated; hence, nothing to check.
+ if not self.sim_cfg.gui:
+ self.pass_patterns = self.run_pass_patterns
+ self.fail_patterns = self.run_fail_patterns
def post_finish(self, status):
if status != 'P':
diff --git a/util/dvsim/FlowCfg.py b/util/dvsim/FlowCfg.py
index 0159177..49443cc 100644
--- a/util/dvsim/FlowCfg.py
+++ b/util/dvsim/FlowCfg.py
@@ -47,6 +47,7 @@
self.scratch_root = args.scratch_root
self.branch = args.branch
self.job_prefix = args.job_prefix
+ self.gui = args.gui
# Options set from hjson cfg.
self.project = ""
@@ -348,6 +349,12 @@
'''Public facing API for _create_deploy_objects().
'''
self.prune_selected_cfgs()
+
+ # GUI mode is allowed only for one cfg.
+ if self.gui and len(self.cfgs) > 1:
+ log.fatal("In GUI mode, only one cfg can be run.")
+ sys.exit(1)
+
for item in self.cfgs:
item._create_deploy_objects()
diff --git a/util/dvsim/SimCfg.py b/util/dvsim/SimCfg.py
index f47d000..e281e53 100644
--- a/util/dvsim/SimCfg.py
+++ b/util/dvsim/SimCfg.py
@@ -126,6 +126,8 @@
self.map_full_testplan = args.map_full_testplan
# Set default sim modes for unpacking
+ if args.gui:
+ self.en_build_modes.append("gui")
if args.waves is not None:
self.en_build_modes.append("waves")
if self.cov is True:
@@ -504,6 +506,12 @@
self.runs = ([]
if self.build_only else self._expand_run_list(build_map))
+ # In GUI mode, only allow one test to run.
+ if self.gui and len(self.runs) > 1:
+ self.runs = self.runs[:1]
+ log.warning("In GUI mode, only one test is allowed to run. "
+ "Picking {}".format(self.runs[0].full_name))
+
# Add builds to the list of things to run, only if --run-only switch
# is not passed.
self.deploy = []
@@ -545,7 +553,7 @@
'''
# TODO, Only support VCS
if self.tool not in ['vcs', 'xcelium']:
- log.error("Currently only support VCS and Xcelium for coverage UNR")
+ log.error("Only VCS and Xcelium are supported for the UNR flow.")
sys.exit(1)
# Create initial set of directories, such as dispatched, passed etc.
self._create_dirs()
diff --git a/util/dvsim/dvsim.py b/util/dvsim/dvsim.py
index e0261ea..d42b5bc 100755
--- a/util/dvsim/dvsim.py
+++ b/util/dvsim/dvsim.py
@@ -402,6 +402,11 @@
help=('The options for each build_mode in this list '
'are applied to all build and run targets.'))
+ disg.add_argument("--gui",
+ action='store_true',
+ help=('Run the flow in interactive mode instead of the '
+ 'batch mode.'))
+
rung = parser.add_argument_group('Options for running')
rung.add_argument("--run-only",