From a8c1295c73f9b39baf5f969dce99a60265aba274 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 8 Nov 2025 20:11:36 +0100 Subject: [PATCH] updates quantum_keeper_mt test --- scc | 2 +- tests/quantum_keeper_mt/sc_main.cpp | 6 +++--- tests/quantum_keeper_mt/top_module.h | 14 +++++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/scc b/scc index f396174..9e1b18d 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit f3961745afbf46d4321d4c40b5998d727050a4d6 +Subproject commit 9e1b18db3f2d59fc0d2f22c8a677d03e9720ced4 diff --git a/tests/quantum_keeper_mt/sc_main.cpp b/tests/quantum_keeper_mt/sc_main.cpp index 47c771a..ab2b5f8 100644 --- a/tests/quantum_keeper_mt/sc_main.cpp +++ b/tests/quantum_keeper_mt/sc_main.cpp @@ -21,9 +21,9 @@ void ABRThandler(int sig) { longjmp(abrt, 1); } int sc_main(int argc, char* argv[]) { signal(SIGABRT, ABRThandler); auto my_name = util::split(argv[0], '/').back(); - auto level = "3"; // getenv("SCC_TEST_VERBOSE"); - auto log_lvl = level ? static_cast(std::min(strtoul(level, nullptr, 10) + 4, 7UL)) : log::FATAL; - scc::init_logging(LogConfig().logLevel(log_lvl).logAsync(false).msgTypeFieldWidth(35)); + auto level = getenv("SCC_TEST_VERBOSE"); + auto log_lvl = level ? static_cast(std::min(strtoul(level, nullptr, 10), 7UL)) : log::FATAL; + scc::init_logging(LogConfig().logLevel(log_lvl).logAsync(false).msgTypeFieldWidth(35).printSysTime()); LOGGER(DEFAULT)::reporting_level().store(logging::TRACEALL); scc::configurer cfg(""); // create tracer if environment variable SCC_TEST_TRACE is defined diff --git a/tests/quantum_keeper_mt/top_module.h b/tests/quantum_keeper_mt/top_module.h index a19d39a..eba9521 100644 --- a/tests/quantum_keeper_mt/top_module.h +++ b/tests/quantum_keeper_mt/top_module.h @@ -7,7 +7,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -15,6 +17,7 @@ #include #include #include +enum { CLIENT_DELAY = 100, SC_DELAY = 10 }; struct initiator : ::sc_core ::sc_module { tlm_utils::simple_initiator_socket isckt{"isckt"}; @@ -38,7 +41,7 @@ private: sc_core::sc_time thread_exec() { SCCDEBUG(SCMOD) << "starting thread_exec"; for(auto i = 0u; i < 16; ++i) { - std::this_thread::sleep_for(std::chrono::milliseconds(1)); + std::this_thread::sleep_for(std::chrono::milliseconds(CLIENT_DELAY)); if(i && (i % 3) == 0) { tlm::tlm_generic_payload gp; sc_core::sc_time t; @@ -73,6 +76,7 @@ struct top_module : ::sc_core ::sc_module { : sc_core::sc_module(nm) { core.isckt(tsckt); tsckt.register_b_transport(this, &top_module::b_transport); + SC_THREAD(run); } ~top_module() {} @@ -82,5 +86,13 @@ struct top_module : ::sc_core ::sc_module { t += 5_us; gp.set_response_status(tlm::TLM_OK_RESPONSE); } + + void run() { + wait(sc_core::SC_ZERO_TIME); + while(true) { + std::this_thread::sleep_for(std::chrono::milliseconds(SC_DELAY)); + wait(1500_ns); + } + } }; #endif // _TOP_MODULE_H_