From 5f7faa311b3589ada3983a518a5c95304643fdab Mon Sep 17 00:00:00 2001 From: Michael Adler Date: Mon, 10 Oct 2022 19:22:26 -0400 Subject: [PATCH] Detect ASE in host_exerciser to adjust timeout for simulation --- samples/host_exerciser/host_exerciser_cmd.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/samples/host_exerciser/host_exerciser_cmd.h b/samples/host_exerciser/host_exerciser_cmd.h index 600320af219b..2e0bb159ee62 100644 --- a/samples/host_exerciser/host_exerciser_cmd.h +++ b/samples/host_exerciser/host_exerciser_cmd.h @@ -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() {} @@ -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)) { @@ -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_; @@ -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; @@ -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