Skip to content

Commit

Permalink
Detect ASE in host_exerciser to adjust timeout for simulation (#2759)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-adler committed Oct 11, 2022
1 parent 214c25c commit aeec5f7
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions samples/host_exerciser/host_exerciser_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class host_exerciser_cmd : public test_command
he_lpbk_ctl_.value = 0;
he_lpbk_api_ver_ = 0;
he_lpbk_atomics_supported_ = false;
is_ase_sim_ = false;
}
virtual ~host_exerciser_cmd() {}

Expand Down Expand Up @@ -187,7 +188,12 @@ class host_exerciser_cmd : public test_command
bool he_wait_test_completion()
{
/* Wait for test completion */
uint32_t timeout = HELPBK_TEST_TIMEOUT;
uint32_t timeout = HELPBK_TEST_TIMEOUT;
if (is_ase_sim_) {
// Much longer timeout when running HW simulation
timeout *= 100;
}

volatile uint8_t* status_ptr = dsm_->c_type();

while (0 == ((*status_ptr) & 0x1)) {
Expand Down Expand Up @@ -377,6 +383,15 @@ class host_exerciser_cmd : public test_command
if (!host_exe_)
return -1;

// ASE simulation?
auto afu_props = fpga::properties::get(token_);
uint32_t vendor_id = afu_props->vendor_id;
uint32_t device_id = afu_props->device_id;
is_ase_sim_ = (vendor_id == 0x8086) && (device_id == 0xa5e);
if (is_ase_sim_) {
std::cout << "Simulation: ASE mode" << std::endl;
}

// Host Exerciser Mode
he_lpbk_cfg_.TestMode = host_exe_->he_modes_;

Expand All @@ -397,7 +412,6 @@ class host_exerciser_cmd : public test_command
}

// Set Interrupt test mode
auto afu_props = fpga::properties::get(token_);
if (host_exe_->option_passed("--interrupt")) {
if (host_exe_->he_interrupt_ < afu_props->num_interrupts) {
he_lpbk_cfg_.IntrTestMode = 1;
Expand Down Expand Up @@ -759,6 +773,7 @@ class host_exerciser_cmd : public test_command
token::ptr_t token_;
uint8_t he_lpbk_api_ver_;
bool he_lpbk_atomics_supported_;
bool is_ase_sim_;
};

} // end of namespace host_exerciser
Expand Down

0 comments on commit aeec5f7

Please sign in to comment.