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:
2
scc
2
scc
Submodule scc updated: f3961745af...9e1b18db3f
@@ -21,9 +21,9 @@ void ABRThandler(int sig) { longjmp(abrt, 1); }
|
|||||||
int sc_main(int argc, char* argv[]) {
|
int sc_main(int argc, char* argv[]) {
|
||||||
signal(SIGABRT, ABRThandler);
|
signal(SIGABRT, ABRThandler);
|
||||||
auto my_name = util::split(argv[0], '/').back();
|
auto my_name = util::split(argv[0], '/').back();
|
||||||
auto level = "3"; // getenv("SCC_TEST_VERBOSE");
|
auto level = getenv("SCC_TEST_VERBOSE");
|
||||||
auto log_lvl = level ? static_cast<scc::log>(std::min(strtoul(level, nullptr, 10) + 4, 7UL)) : log::FATAL;
|
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));
|
scc::init_logging(LogConfig().logLevel(log_lvl).logAsync(false).msgTypeFieldWidth(35).printSysTime());
|
||||||
LOGGER(DEFAULT)::reporting_level().store(logging::TRACEALL);
|
LOGGER(DEFAULT)::reporting_level().store(logging::TRACEALL);
|
||||||
scc::configurer cfg("");
|
scc::configurer cfg("");
|
||||||
// create tracer if environment variable SCC_TEST_TRACE is defined
|
// create tracer if environment variable SCC_TEST_TRACE is defined
|
||||||
|
|||||||
@@ -7,7 +7,9 @@
|
|||||||
#include <scc/async_thread.h>
|
#include <scc/async_thread.h>
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
#include <sysc/kernel/sc_initializer_function.h>
|
#include <sysc/kernel/sc_initializer_function.h>
|
||||||
|
#include <sysc/kernel/sc_module.h>
|
||||||
#include <sysc/kernel/sc_simcontext.h>
|
#include <sysc/kernel/sc_simcontext.h>
|
||||||
|
#include <sysc/kernel/sc_time.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <tlm/scc/quantum_keeper.h>
|
#include <tlm/scc/quantum_keeper.h>
|
||||||
#include <tlm>
|
#include <tlm>
|
||||||
@@ -15,6 +17,7 @@
|
|||||||
#include <tlm_utils/simple_initiator_socket.h>
|
#include <tlm_utils/simple_initiator_socket.h>
|
||||||
#include <tlm_utils/simple_target_socket.h>
|
#include <tlm_utils/simple_target_socket.h>
|
||||||
#include <util/logging.h>
|
#include <util/logging.h>
|
||||||
|
enum { CLIENT_DELAY = 100, SC_DELAY = 10 };
|
||||||
|
|
||||||
struct initiator : ::sc_core ::sc_module {
|
struct initiator : ::sc_core ::sc_module {
|
||||||
tlm_utils::simple_initiator_socket<initiator, scc::LT> isckt{"isckt"};
|
tlm_utils::simple_initiator_socket<initiator, scc::LT> isckt{"isckt"};
|
||||||
@@ -38,7 +41,7 @@ private:
|
|||||||
sc_core::sc_time thread_exec() {
|
sc_core::sc_time thread_exec() {
|
||||||
SCCDEBUG(SCMOD) << "starting thread_exec";
|
SCCDEBUG(SCMOD) << "starting thread_exec";
|
||||||
for(auto i = 0u; i < 16; ++i) {
|
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) {
|
if(i && (i % 3) == 0) {
|
||||||
tlm::tlm_generic_payload gp;
|
tlm::tlm_generic_payload gp;
|
||||||
sc_core::sc_time t;
|
sc_core::sc_time t;
|
||||||
@@ -73,6 +76,7 @@ struct top_module : ::sc_core ::sc_module {
|
|||||||
: sc_core::sc_module(nm) {
|
: sc_core::sc_module(nm) {
|
||||||
core.isckt(tsckt);
|
core.isckt(tsckt);
|
||||||
tsckt.register_b_transport(this, &top_module::b_transport);
|
tsckt.register_b_transport(this, &top_module::b_transport);
|
||||||
|
SC_THREAD(run);
|
||||||
}
|
}
|
||||||
|
|
||||||
~top_module() {}
|
~top_module() {}
|
||||||
@@ -82,5 +86,13 @@ struct top_module : ::sc_core ::sc_module {
|
|||||||
t += 5_us;
|
t += 5_us;
|
||||||
gp.set_response_status(tlm::TLM_OK_RESPONSE);
|
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_
|
#endif // _TOP_MODULE_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user