• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sc_process_handle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


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


示例17: victim

 void victim()
 {
   try {
     while (true)
     {
       wait(1, SC_NS);
       sc_assert( !sc_is_unwinding() );
     }
   }
   catch (const sc_unwind_exception& ex)
   {
     cout << "sc_unwind_exception caught by victim" << endl;
     sc_assert( sc_time_stamp() == sc_time(35, SC_NS) );
     sc_assert( ex.is_reset() == false );
     sc_assert( !killing_over );
     sc_assert( v.is_unwinding() );
     sc_assert( sc_is_unwinding() );
     
     b.reset();
     throw ex;
   }
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:22,代码来源:kill_reset.cpp


示例18: third_bystander

  void third_bystander() // Gets killed by second bystander
  {
    for (;;)
    {
      try {
        wait(ev);
      }
      catch (const sc_unwind_exception& ex) {
        cout << "sc_unwind_exception caught by third_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( b2.is_unwinding() ); // sic
        sc_assert( sc_is_unwinding() );

        third_bystander_knocked_over = true;
        throw ex;
      }
    }
  }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:22,代码来源:kill_reset.cpp


示例19: calling

 void calling()
 {
   wait(15, SC_NS);
   // Target runs at time 10 NS due to notification
   
   t.sync_reset_on();
   // Target does not run at time 15 NS 
   
   wait(10, SC_NS);
   // Target is reset at time 20 NS due to notification 
   
   wait(10, SC_NS);
   // Target is reset again at time 30 NS due to notification 
   
   t.sync_reset_off();
   // Target does not run at time 35 NS 
   
   wait(10, SC_NS);
   // Target runs at time 40 NS due to notification
   
   sc_stop();
 }
开发者ID:ansonn,项目名称:esl_systemc,代码行数:22,代码来源:test04.cpp


示例20: 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);
   
    if (!strcmp (name(), "top0"))
    {
        wait(20, SC_NS);
        sc_stop();
    }
  }
开发者ID:Max-E,项目名称:SystemC_regressions_multiplied,代码行数:37,代码来源:proc_ctrl.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ scalarField类代码示例发布时间:2022-05-31
下一篇:
C++ sc_event类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap