updates quantum_keeper_mt test
Some checks failed
SCC Test/pipeline/head There was a failure building this commit

This commit is contained in:
2025-11-08 20:11:36 +01:00
parent e20fbf0d28
commit a8c1295c73
3 changed files with 17 additions and 5 deletions

View File

@@ -7,7 +7,9 @@
#include <scc/async_thread.h>
#include <scc/report.h>
#include <sysc/kernel/sc_initializer_function.h>
#include <sysc/kernel/sc_module.h>
#include <sysc/kernel/sc_simcontext.h>
#include <sysc/kernel/sc_time.h>
#include <thread>
#include <tlm/scc/quantum_keeper.h>
#include <tlm>
@@ -15,6 +17,7 @@
#include <tlm_utils/simple_initiator_socket.h>
#include <tlm_utils/simple_target_socket.h>
#include <util/logging.h>
enum { CLIENT_DELAY = 100, SC_DELAY = 10 };
struct initiator : ::sc_core ::sc_module {
tlm_utils::simple_initiator_socket<initiator, scc::LT> 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_