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 = [
"echo q | " + run_env + VtOs.getenv_def('VERILATOR_MODELSIM', "vsim"),
' '.join(param['ms_run_flags']), ' '.join(param['all_run_flags']), pli_opt,
(" top")
(" t")
]
self.run(cmd=cmd,
check_finished=param['check_finished'],

View File

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