Tests: Add support for Questa in TestSimulator class (#5718)

This commit is contained in:
Krzysztof Starecki 2025-01-08 15:43:57 +01:00 committed by GitHub
parent 87d856339f
commit 260ac342f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View File

@ -1418,7 +1418,7 @@ class VlTest:
cmd = [ cmd = [
"echo q | " + run_env + VtOs.getenv_def('VERILATOR_MODELSIM', "vsim"), "echo q | " + run_env + VtOs.getenv_def('VERILATOR_MODELSIM', "vsim"),
' '.join(param['ms_run_flags']), ' '.join(param['all_run_flags']), pli_opt, ' '.join(param['ms_run_flags']), ' '.join(param['all_run_flags']), pli_opt,
(" top") (" t")
] ]
self.run(cmd=cmd, self.run(cmd=cmd,
check_finished=param['check_finished'], check_finished=param['check_finished'],

View File

@ -17,11 +17,12 @@
class TestSimulator { class TestSimulator {
private: private:
struct SimTypes { struct SimTypes {
int verilator; bool verilator = false;
int icarus; bool icarus = false;
int mti; bool mti = false;
int ncsim; bool ncsim = false;
int vcs; bool vcs = false;
bool questa = false;
}; };
s_vpi_vlog_info m_info; s_vpi_vlog_info m_info;
SimTypes m_simulators; SimTypes m_simulators;
@ -37,6 +38,8 @@ public:
== strncmp(m_info.product, "Chronologic Simulation VCS", == strncmp(m_info.product, "Chronologic Simulation VCS",
std::strlen("Chronologic Simulation VCS"))) { std::strlen("Chronologic Simulation VCS"))) {
m_simulators.vcs = true; m_simulators.vcs = true;
} else if (0 == strcmp(m_info.product, "ModelSim for Questa-64")) {
m_simulators.questa = true;
} else { } else {
printf("%%Warning: %s:%d: Unknown simulator in TestSimulator.h: %s\n", __FILE__, printf("%%Warning: %s:%d: Unknown simulator in TestSimulator.h: %s\n", __FILE__,
__LINE__, m_info.product); __LINE__, m_info.product);
@ -59,12 +62,13 @@ public:
static bool is_mti() { return simulators().mti; } static bool is_mti() { return simulators().mti; }
static bool is_ncsim() { return simulators().ncsim; } static bool is_ncsim() { return simulators().ncsim; }
static bool is_vcs() { return simulators().vcs; } static bool is_vcs() { return simulators().vcs; }
static bool is_questa() { return simulators().questa; }
// Simulator properties // Simulator properties
static bool is_event_driven() { return !simulators().verilator; } static bool is_event_driven() { return !simulators().verilator; }
static bool has_get_scalar() { return !simulators().icarus; } static bool has_get_scalar() { return !simulators().icarus; }
// return test level scope // return test level scope
static const char* top() { static const char* top() {
if (simulators().verilator || simulators().icarus) { if (simulators().verilator || simulators().icarus || simulators().questa) {
return "t"; return "t";
} else { } else {
return "top.t"; return "top.t";