Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00014 #include <systemc>
00015 #include "during.h"
00016 #include <iostream>
00017 
00018 using namespace std;
00019 using namespace sc_core;
00020 
00021 
00022 void debug(string s) {
00023   cout << sc_time_stamp() 
00024        << ": " << s << endl;
00025 }
00026 
00027 SC_MODULE(A), sc_during
00028 {
00029   void compute() {
00030     wait(5, SC_MS);
00031     during(5, SC_MS,
00032            boost::bind(&A::f, this));
00033     debug("done");
00034   }
00035   
00036   SC_CTOR(A) {
00037     SC_THREAD(compute);
00038   }
00039   
00040   void f(void) {
00041     debug("before");
00042     extra_time(5, SC_MS);
00043     debug("after");
00044   };
00045 };
00046 
00047 int sc_main(int, char **) {
00048         A a("a");
00049         sc_start();
00050         return 0;
00051 }