From ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Zrounba?= <6691770+clement-z@users.noreply.github.com> Date: Sat, 30 Sep 2023 23:06:01 +0200 Subject: Initial release --- src/devices/time_monitor.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/devices/time_monitor.h (limited to 'src/devices/time_monitor.h') diff --git a/src/devices/time_monitor.h b/src/devices/time_monitor.h new file mode 100644 index 0000000..62d5626 --- /dev/null +++ b/src/devices/time_monitor.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include + +using std::chrono::system_clock; +using std::shared_ptr; +using std::make_shared; + +class TimeMonitor : public sc_module { +public: + double m_poll_period; // in seconds + double m_wallclock_period; // in seconds + + void on_trigger(); + + TimeMonitor(sc_module_name name, double poll_period=100e-12, double wallclock_period = 2) + : sc_module(name), + m_poll_period(poll_period), + m_wallclock_period(wallclock_period) + { + SC_HAS_PROCESS(TimeMonitor); + SC_THREAD(on_trigger); + } +}; -- cgit v1.2.3