summaryrefslogtreecommitdiff
path: root/src/systemc/tests/systemc/compliance_1666/test106/test106.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/tests/systemc/compliance_1666/test106/test106.cpp')
-rw-r--r--src/systemc/tests/systemc/compliance_1666/test106/test106.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/systemc/tests/systemc/compliance_1666/test106/test106.cpp b/src/systemc/tests/systemc/compliance_1666/test106/test106.cpp
new file mode 100644
index 000000000..68c52d5a2
--- /dev/null
+++ b/src/systemc/tests/systemc/compliance_1666/test106/test106.cpp
@@ -0,0 +1,50 @@
+#include <systemc>
+
+using sc_core::sc_delta_count;
+using sc_core::sc_is_running;
+using sc_core::SC_ZERO_TIME;
+using sc_core::sc_start;
+using sc_core::sc_event;
+using sc_core::SC_NS;
+using std::cout;
+using std::endl;
+
+// D.1 6) sc_delta_count()
+
+SC_MODULE(M)
+{
+ SC_CTOR(M)
+ {
+ SC_THREAD(T);
+ }
+ void T()
+ {
+ cout << "T() " << sc_is_running() << " " << sc_delta_count() << endl;
+ wait(10, SC_NS);
+ cout << "T() " << sc_is_running() << " " << sc_delta_count() << endl;
+ wait(10, SC_NS);
+ cout << "T() " << sc_is_running() << " " << sc_delta_count() << endl;
+ wait(10, SC_NS);
+ cout << "T() " << sc_is_running() << " " << sc_delta_count() << endl;
+ }
+};
+
+SC_MODULE(Top)
+{
+ M *m;
+ SC_CTOR(Top)
+ {
+ m = new M("m");
+ }
+};
+
+int sc_main(int argc, char* argv[])
+{
+ sc_assert(sc_delta_count() == 0);
+
+ Top top("top");
+ sc_start();
+
+ cout << endl << "Success" << endl;
+ return 0;
+}