aboutsummaryrefslogtreecommitdiff
path: root/src/devices/time_monitor.h
diff options
context:
space:
mode:
authorClément Zrounba <6691770+clement-z@users.noreply.github.com>2023-09-30 23:06:01 +0200
committerClément Zrounba <6691770+clement-z@users.noreply.github.com>2023-09-30 23:26:46 +0200
commitff9b8bb838ecdfbfc1dc81038fcf3b2a87636982 (patch)
tree21f27be782ce11c6d00b96ce100a2bff88141b2e /src/devices/time_monitor.h
downloadspecs-ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982.tar.gz
specs-ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982.zip
Initial release
Diffstat (limited to 'src/devices/time_monitor.h')
-rw-r--r--src/devices/time_monitor.h26
1 files changed, 26 insertions, 0 deletions
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 <systemc.h>
+#include <chrono>
+#include <iostream>
+
+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);
+ }
+};