Tests: Add support for Questa in TestSimulator class (#5718)
This commit is contained in:
parent
87d856339f
commit
260ac342f4
|
|
@ -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'],
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue