当前位置: 首页>>代码示例>>C++>>正文


C++ sc_process_handle::kill方法代码示例

本文整理汇总了C++中sc_process_handle::kill方法的典型用法代码示例。如果您正苦于以下问题:C++ sc_process_handle::kill方法的具体用法?C++ sc_process_handle::kill怎么用?C++ sc_process_handle::kill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sc_process_handle的用法示例。


在下文中一共展示了sc_process_handle::kill方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ctrl

 void ctrl()
 {
   count = 1;
   ph = sc_spawn(sc_bind(&Top::parent_proc, this));
   wait(10, SC_NS);
   
   count = 2;
   ph.reset(SC_INCLUDE_DESCENDANTS);
   wait(10, SC_NS);
   
   count = 3;
   ev.notify();
   wait(10, SC_NS);
   
   count = 4;
   ph.suspend(SC_INCLUDE_DESCENDANTS);
   wait(10, SC_NS);
   
   count = 5;
   ev.notify();
   wait(10, SC_NS);
   
   count = 6;
   ph.resume(SC_INCLUDE_DESCENDANTS);
   wait(10, SC_NS);
   
   count = 7;
   ph.kill(SC_INCLUDE_DESCENDANTS);
   wait(10, SC_NS);
 }
开发者ID:Max-E,项目名称:SystemC_regressions_multiplied,代码行数:30,代码来源:child_proc_control.cpp

示例2: calling

  void calling()
  {
    wait(15, SC_NS);
    // Target runs at time 10 NS due to notification
    sc_assert( count == 1 );

    wait(10, SC_NS);
    // Target runs again at time 20 NS due to notification
    sc_assert( count == 2 );

    t.reset();
    // Target reset immediately at time 25 NS
    sc_assert( count == 0 );

    wait(10, SC_NS);
    // Target runs again at time 30 NS due to notification
    sc_assert( count == 1 );

    t.kill();
    sc_assert( !killing_over );
    killing_over = true;

    // Target killed immediately at time 35 NS
    sc_assert( t.terminated() ); 
    sc_assert( k.terminated() );

    sc_stop();
  }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:28,代码来源:test05.cpp

示例3: wait

  void T1()
  {
    wait(25, SC_NS);
    cout << "suspend at " << sc_time_stamp() << endl;
    h2.suspend();
    wait(20, SC_NS);
    cout << "resume at " << sc_time_stamp() << endl;
    h2.resume();
    wait(20, SC_NS);

    cout << "disable at " << sc_time_stamp() << endl;
    h2.disable();
    wait(20, SC_NS);
    cout << "enable at " << sc_time_stamp() << endl;
    h2.enable();
    wait(20, SC_NS);
    
    h2.reset();
    wait(20, SC_NS);
    
    h2.kill();
    wait(20, SC_NS);

    sc_pause();
    wait(50, SC_NS);
    sc_stop();
    end_of_T1 = true;
  }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:28,代码来源:odds_and_ends.cpp

示例4: target

 void target()
 {
   cout << "Target called/reset at " << sc_time_stamp() << endl;
   count = 0;
   for (;;)
   {
     try {
       wait(ev);
       cout << "Target awoke at " << sc_time_stamp() << endl;
       ++count;
     }
     catch (const sc_unwind_exception& ex) {
       cout << "sc_unwind_exception caught by target" << endl;
       if (count == 2)
         sc_assert( ex.is_reset() );
       else if (count == 1)
       {
         sc_assert( !ex.is_reset() );
         sc_assert( !killing_over );
         k.kill();
       }
       else
         sc_assert( false );
       throw ex;
     }
   }
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:27,代码来源:test05.cpp

示例5: target

  void target()
  {
    bomb local_obj(target_handle);

    wait(10, SC_NS);
    
    f0 = 1;
    target_handle.kill();
  }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:9,代码来源:overkill_bug.cpp

示例6: second_bystander

 void second_bystander() // Gets reset by bystander
 {
   for (;;)
   {
     try {
       wait(ev);
     }
     catch (const sc_unwind_exception& ex) {
       cout << "sc_unwind_exception caught by second_bystander" << endl;
       sc_assert( sc_time_stamp() == sc_time(35, SC_NS) );
       sc_assert( ex.is_reset() == true );
       sc_assert( !killing_over );
       sc_assert( v.is_unwinding() ); // sic
       sc_assert( b.is_unwinding() ); // sic
       sc_assert( sc_is_unwinding() );
       
       b3.kill();
       throw ex;
     }
   }
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:21,代码来源:kill_reset.cpp

示例7: calling

  void calling()
  {
    wait(15, SC_NS);
    // Target runs at time 10 NS due to notification
    sc_assert( count == 1 );
    // The victim awakes every 1ns
    sc_assert( sc_time_to_pending_activity() <= sc_time(1, SC_NS) );
 
    wait(10, SC_NS);
    // Target runs again at time 20 NS due to notification
    sc_assert( count == 2 );
    
    t.reset();
    // Target reset immediately at time 25 NS
    sc_assert( count == 0 );
 
    wait(10, SC_NS);
    // Target runs again at time 30 NS due to notification
    sc_assert( count == 1 );
    
    t.kill();
    sc_assert( !killing_over );
    killing_over = true;
    
    // Target killed immediately at time 35 NS
    if (t.valid())
      sc_assert( t.terminated() );
    if (k.valid())
      sc_assert( k.terminated() );
    if (v.valid())
      sc_assert( v.terminated() );
    sc_assert( b.valid() && !b.terminated() );
    sc_assert( b2.valid() && !b2.terminated() );
    if (b3.valid())
      sc_assert( b3.terminated() );
      
    sc_stop();
  }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:38,代码来源:kill_reset.cpp

示例8: ticker

 void ticker()
 {
   for (;;)
   {
     try {
       wait(10, SC_NS);
       ev.notify();
       sc_assert( !sc_is_unwinding() );
     }
     catch (const sc_unwind_exception& ex)
     {
       // ticker process killed by target
       cout << "sc_unwind_exception caught by ticker" << endl;
       sc_assert( !ex.is_reset() );
       sc_assert( count == 1 );
       sc_assert( !killing_over );
       sc_assert( t.is_unwinding() );
       sc_assert( sc_is_unwinding() );
      
       v.kill();
       throw ex;
     }
   }
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:24,代码来源:kill_reset.cpp

示例9:

 ~bomb()
 {
   h.kill();  // Aborts !!!!!!
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:4,代码来源:overkill_bug.cpp

示例10: ctrl

  void ctrl()
  {
    wait(SC_ZERO_TIME);
    sc_assert( sc_delta_count() == 1 );
    
    count = 1;
    ev.notify();
    wait(target_awoke_event);
    
    count = 2;
    ev.notify();
    t.suspend();
    yield();
    
    count = 2;
    t.resume();
    wait(target_awoke_event);

    count = 3;
    ev.notify();
    t.disable();
    wait(target_awoke_event);
    
    count = 4;
    ev.notify();
    yield();

    count = 5;
    t.enable();
    yield();

    count = 6;
    ev.notify();
    wait(target_awoke_event);
    
    count = 7;
    t.suspend();
    ev.notify();
    yield();
    
    count = 8;
    t.resume();
    wait(target_awoke_event);
    
    count = 9;
    reset_count = 9;
    t.sync_reset_on();
    ev.notify();
    wait(target_awoke_event);
    
    count = 10;
    reset_count = 10;
    ev.notify();
    wait(target_awoke_event);

    count = 11;
    t.sync_reset_off();
    ev.notify();
    wait(target_awoke_event);
    
    count = 12;
    t.resume();
    t.enable();
    t.sync_reset_off();
    yield();
    
    count = 13;
    ev.notify();
    wait(target_awoke_event);
     
    count = 14;
    reset_count = 14;
    t.reset();
    
    count = 15;
    ev.notify();
    wait(target_awoke_event);
    
    count = 16;
    reset_count = 16;
    t.reset();
    
    count = 17;
    t.throw_it(ex);

    count = 18;
    t.kill();
    yield();
    
    count = 19;
    m.enable();
    ev.notify();
    wait(target_awoke_event);
        
    count = 20;
    ev.notify();
    m.suspend();
    yield();
    
    count = 21;
//.........这里部分代码省略.........
开发者ID:ansonn,项目名称:esl_systemc,代码行数:101,代码来源:proc_ctrl_immed.cpp


注:本文中的sc_process_handle::kill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。