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


C++ sc_process_handle类代码示例

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


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

示例1: 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

示例2: control

  void control()
  {
    wait(SC_ZERO_TIME);
    
    count = 1;
    ev.notify();
    wait(10, SC_NS);
    
    count = 2;
    ev.notify();
    t.disable();
    wait(SC_ZERO_TIME);
    
    count = 3;
    ev.notify();
    wait(SC_ZERO_TIME);
    
    count = 4;
    t.enable();
    ev.notify();
    wait(10, SC_NS);

    count = 5;
    t.disable();
    t.reset();
    wait(10, SC_NS);
    
    count = 6;
    t.reset();
    wait(10, SC_NS);
   
    sc_stop();
  }
开发者ID:een5afr-public,项目名称:gem5,代码行数:33,代码来源:disable_enable.cpp

示例3: target

  void target()
  {
    switch (count)
    {
      case 0:
        f0 = 1;
        count = 1;
        next_trigger(10, SC_NS);
        break;

      case 1:
        f1 = 1;
        count = 2;
        target_handle.reset();
        break;

      case 2:
        f2 = 1;
        count = 3;
        target_handle.reset();
        break;

      case 3:
        f3 = 1;
        count = 4;
        break;
    }
  }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:28,代码来源:self_reset_bug.cpp

示例4: 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

示例5: wait

 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;
 }
开发者ID:Max-E,项目名称:SystemC_regressions_multiplied,代码行数:8,代码来源:include_descendants.cpp

示例6: ctrl

 void ctrl()
 {
   ts3.resume();
   
   wait(10, SC_NS);
   ts1.resume();
   ev.notify();
   
   wait(10, SC_NS);
   ts2.resume();
   tr2.sync_reset_off();
   tr4.sync_reset_off();
   
   wait(10, SC_NS);
   td2.enable();
   
   wait(10, SC_NS);
   ev.notify();
   
   wait(10, SC_NS);
   ev.notify();
   td2.disable();
   
   wait(10, SC_NS);
   td4.enable();
   ts4.resume();
   ev.notify();
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:28,代码来源:proc_ctrl_elab.cpp

示例7: wait

 void target3() // Target for throw_it from target2()
 {
   try {
     wait(1, SC_US);
   }
   catch (std::exception ex) {
     sc_assert( t3.valid() );
     sc_assert( !t3.terminated() );
     f6 = 1;
   }
 }
开发者ID:een5afr-public,项目名称:gem5,代码行数:11,代码来源:throw_it.cpp

示例8: target

 void target()
 {
   cout << "Target called at " << sc_time_stamp() << endl;
   if (suspend_target)
     t.suspend();
   if (resume_target)
   {
     t.resume();
     suspend_target = false;
   }
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:11,代码来源:test02.cpp

示例9: start_of_simulation

 void start_of_simulation()
 {
   try {
     t1.throw_it(ex);
   }
   catch (std::exception ex) {
     f1 = 1;
     sc_assert( t1.valid() );
     sc_assert( !t1.terminated() );
   }
 }
开发者ID:een5afr-public,项目名称:gem5,代码行数:11,代码来源:throw_it.cpp

示例10: calling

  void calling()
  {
    wait(15, SC_NS);

    t.sync_reset_on();
    wait(10, SC_NS);

    t.sync_reset_off();
    wait(10, SC_NS);

    t.reset();
    wait(SC_ZERO_TIME);
    
    sc_stop();
  }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:15,代码来源:is_unwinding_bug.cpp

示例11: 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

示例12: calling

  void calling()
  {
    wait(15, SC_NS);
    // Target runs at 10 NS
    
    suspend_target = true;
    wait(10, SC_NS);
    // Target runs at 20 NS and suspends itself
    
    wait(10, SC_NS);
    // Target does not run at 30 NS
    
    suspend_target = false;
    t.resume();
    // Target runs at 35 NS
    
    wait(10, SC_NS);
    // Target runs at 40 NS  

    suspend_target = true;
    resume_target = true;
    wait(10, SC_NS);
    // Target runs at 50 NS  
    
    sc_stop();
  }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:26,代码来源:test02.cpp

示例13: wait

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

    cout << "disable: time = " << sc_time_stamp() << endl;
    h2.disable();
    wait(20, SC_NS);
    cout << "enable: time = " << sc_time_stamp() << endl;
    h2.enable();
    wait(20, SC_NS);
    sc_stop();
  }
开发者ID:een5afr-public,项目名称:gem5,代码行数:18,代码来源:test01.cpp

示例14: 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

示例15: bystander

 void bystander() // Gets reset by victim
 {
   for (;;)
   {
     try {
       wait(ev);
     }
     catch (const sc_unwind_exception& ex) {
       cout << "sc_unwind_exception caught by 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( sc_is_unwinding() );
       
       b2.reset();
       throw ex;
     }
   }
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:20,代码来源:kill_reset.cpp


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