Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00013 #include <systemc>
00014 #include "during.h"
00015 #include <boost/bind.hpp>
00016 #include "utils/io-lock.h"
00017
00018 using namespace std;
00019 using namespace sc_core;
00020
00021 SC_MODULE(A), sc_during
00022 {
00023 void compute() {
00024 L_COUT << "A 1: " << sc_time_stamp() << endl;
00025 wait(10, SC_NS);
00026 L_COUT << "A 2: " << sc_time_stamp() << endl;
00027 during(10, SC_NS, boost::bind(&A::f, this));
00028 L_COUT << "A 3: " << sc_time_stamp() << endl;
00029 }
00030
00031 SC_CTOR(A) {
00032 SC_THREAD(compute);
00033 }
00034
00035 void f() {
00036 L_COUT << "A.f()" << endl;
00037 };
00038 };
00039
00040 int sc_main(int argc, char *argv[])
00041 {
00042 (void)argc; (void)argv;
00043 A a("a");
00044 L_COUT << "elaboration done, start simulation" << endl;
00045 {
00046 measure_time t;
00047 sc_start();
00048 }
00049 L_COUT << "Simulation terminated. Terminating threads" << endl;
00050 return 0;
00051 }