Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00013 #include <systemc>
00014 #include "during.h"
00015 #include "utils/io-lock.h"
00016 
00017 using namespace std;
00018 using namespace sc_core;
00019 
00020 SC_MODULE(A), sc_during
00021 {
00022         void compute() {
00023                 L_COUT << "A 1: " << sc_time_stamp() << endl;
00024                 wait(10, SC_NS);
00025                 L_COUT << "A 2: " << sc_time_stamp() << endl;
00026                 during(10, SC_NS, boost::bind(&A::f, this));
00027                 L_COUT << "A 3: " << sc_time_stamp() << endl;
00028         }
00029         
00030         SC_CTOR(A) {
00031                 SC_THREAD(compute);
00032         }
00033         
00034         void f(void) {
00035                 L_COUT << "A.f()" << endl;
00036         };
00037 };
00038 
00039 SC_MODULE(B), sc_during
00040 {
00041         void compute() {
00042                 wait(1, SC_NS);
00043                 L_COUT << "B 1: " << sc_time_stamp() << endl;
00044                 during(8, SC_NS, boost::bind(&B::f, this));
00045                 L_COUT << "B 2: " << sc_time_stamp() << endl;
00046                 wait(14, SC_NS);
00047                 L_COUT << "B 3: " << sc_time_stamp() << endl;
00048         }
00049         
00050         SC_CTOR(B) {
00051                 SC_THREAD(compute);
00052         }
00053         
00054         void f(void) {
00055                 L_COUT << "B.f()" << endl;
00056         };
00057 };
00058 
00059 int sc_main(int argc, char *argv[])
00060 {
00061         (void)argc; (void)argv;
00062         A a("a");
00063         B b("b");
00064         {
00065                 measure_time t;
00066                 sc_start();
00067         }
00068 
00069         return 0;
00070 }