updates quantum_keeper_mt test
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
Some checks failed
SCC Test/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -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<scc::log>(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<scc::log>(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
|
||||
|
||||
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user