コード例 #1
0
 void target1()
 {
   sc_assert(count == 0);
   ch2 = sc_spawn(sc_bind(&Top::child2, this));
   ch3 = sc_spawn(sc_bind(&Top::child3, this));
   wait(ch2.terminated_event() & ch3.terminated_event());
   f5 = 1;
 }
コード例 #2
0
 void child9()
 {
   gch12 = sc_spawn(sc_bind(&Top::grandchild12, this));
   gch13 = sc_spawn(sc_bind(&Top::grandchild13, this));
   try {
     wait(20, SC_NS);
   }
   catch (std::exception e) {
     f14 = 1;
     sc_assert( sc_time_stamp() == sc_time(210, SC_NS) );
   }
   wait(gch12.terminated_event() & gch13.terminated_event());
 }
コード例 #3
0
 void child8()
 {
   gch10 = sc_spawn(sc_bind(&Top::grandchild10, this));
   gch11 = sc_spawn(sc_bind(&Top::grandchild11, this));
   try {
     wait(20, SC_NS);
   }
   catch (std::exception e) {
     f13 = 1;
     sc_assert( sc_time_stamp() == sc_time(210, SC_NS) );
   }
   wait(gch10.terminated_event() & gch11.terminated_event());
 }
コード例 #4
0
 void target7()
 {
   wait(200, SC_NS);
   count = 11;
   ch8 = sc_spawn(sc_bind(&Top::child8, this));
   ch9 = sc_spawn(sc_bind(&Top::child9, this));
   try {
     wait(20, SC_NS);
   }
   catch (std::exception e) {
     sc_assert( sc_time_stamp() == sc_time(210, SC_NS) );
   }
   wait(ch8.terminated_event() & ch9.terminated_event());
   sc_assert( sc_time_stamp() == sc_time(214, SC_NS) );
   f12 = 1;
 }
コード例 #5
0
 void target4()
 {
   if (count == 0)
   {
     wait(100, SC_NS);
     count = 9;
     ch5 = sc_spawn(sc_bind(&Top::child5, this));
     ch6 = sc_spawn(sc_bind(&Top::child6, this));
   }
   else // Hard reset
   {
     sc_assert( sc_time_stamp() == sc_time(110, SC_NS) );
     f11 = 1;
   }
   wait(ch5.terminated_event() & ch6.terminated_event());
   f6 = 1;
 }
コード例 #6
0
  void T1()
  {
    wait(1, SC_NS);
    t2a = sc_spawn(sc_bind(&Top::T2, this));
    t2b = sc_spawn(sc_bind(&Top::T2, this));
    wait(1, SC_NS);
    sc_assert( t2a.valid() );
    sc_assert( t2b.valid() );
    
    std::vector<sc_object*> children = t1.get_child_objects();
    sc_assert( children.size() == 2);
    
    sc_event_and_list and_list = t2a.terminated_event() & t2b.terminated_event();
    wait( and_list );

    sc_assert( t2a.valid() );
    sc_assert( t2a.terminated() );
    sc_assert( t2b.valid() );
    sc_assert( t2b.terminated() );
    sc_assert( sc_time_stamp() == sc_time(3, SC_NS) );
  }