本文整理汇总了C++中sc_process_handle::suspend方法的典型用法代码示例。如果您正苦于以下问题:C++ sc_process_handle::suspend方法的具体用法?C++ sc_process_handle::suspend怎么用?C++ sc_process_handle::suspend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sc_process_handle
的用法示例。
在下文中一共展示了sc_process_handle::suspend方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: 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;
}
示例3: target
void target()
{
cout << "Target called at " << sc_time_stamp() << endl;
if (suspend_target)
t.suspend();
if (resume_target)
{
t.resume();
suspend_target = false;
}
}
示例4: 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();
}
示例5: calling
void calling()
{
wait(SC_ZERO_TIME);
count = 1;
t1.suspend(SC_INCLUDE_DESCENDANTS);
ev.notify(5, SC_NS);
wait(10, SC_NS);
count = 2;
t1.resume(SC_INCLUDE_DESCENDANTS);
wait(10, SC_NS);
count = 3;
t1.disable(SC_INCLUDE_DESCENDANTS);
ev.notify(5, SC_NS);
wait(10, SC_NS);
count = 4;
t1.enable(SC_INCLUDE_DESCENDANTS);
wait(10, SC_NS);
count = 5;
ev.notify();
wait(10, SC_NS);
count = 6;
t1.sync_reset_on(SC_INCLUDE_DESCENDANTS);
wait(10, SC_NS);
count = 7;
ev.notify();
wait(10, SC_NS);
count = 8;
t1.sync_reset_off(SC_INCLUDE_DESCENDANTS);
wait(sc_time(110, SC_NS) - sc_time_stamp());
count = 10;
t4.reset(SC_INCLUDE_DESCENDANTS);
wait(sc_time(210, SC_NS) - sc_time_stamp());
t7.throw_it(ex, SC_INCLUDE_DESCENDANTS);
}
示例6: calling
void calling()
{
wait(SC_ZERO_TIME);
count = 1;
ev.notify(5, SC_NS);
wait(10, SC_NS);
count = 2;
t1.throw_it(ex);
sc_assert( t1.valid() );
sc_assert( !t1.terminated() );
sc_assert(f4);
wait(10, SC_NS);
count = 3;
t4.throw_it(ex); // Throw exception in method process
sc_assert( t4.valid() );
sc_assert( !t4.terminated() );
wait(sc_time(200, SC_NS) - sc_time_stamp());
count = 4;
t1.suspend();
ev.notify(5, SC_NS);
wait(10, SC_NS);
count = 5;
t1.throw_it(ex);
wait(10, SC_NS);
count = 6;
t1.throw_it(ex);
sc_assert( t1.valid() );
sc_assert( !t1.terminated() );
wait(10, SC_NS);
count = 7;
t1.resume();
wait(sc_time(300, SC_NS) - sc_time_stamp());
count = 8;
t1.disable();
ev.notify(5, SC_NS);
wait(10, SC_NS);
count = 9;
t1.throw_it(ex);
wait(10, SC_NS);
count = 10;
t1.throw_it(ex);
wait(10, SC_NS);
count = 11;
t1.enable();
wait(sc_time(400, SC_NS) - sc_time_stamp());
count = 12;
t1.sync_reset_on();
ev.notify(5, SC_NS);
wait(10, SC_NS);
wait(sc_time(400, SC_NS) - sc_time_stamp());
count = 13;
t1.throw_it(ex);
wait(10, SC_NS);
count = 14;
t1.throw_it(ex);
wait(10, SC_NS);
count = 15;
t1.sync_reset_off();
wait(sc_time(500, SC_NS) - sc_time_stamp());
count = 16;
ev.notify();
t1.throw_it(ex);
wait(10, SC_NS);
count = 17;
t1.reset();
wait(sc_time(600, SC_NS) - sc_time_stamp());
count = 18;
t1.disable();
t5.enable();
areset.write(false);
wait(10, SC_NS);
count = 19;
ev.notify();
wait(10, SC_NS);
count = 20;
ev.notify();
wait(10, SC_NS);
count = 21;
areset.write(true);
//.........这里部分代码省略.........
示例7: 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;
//.........这里部分代码省略.........
示例8:
void target_suspend_5()
{
sc_assert( sc_time_stamp() == sc_time(10, SC_NS) );
target_suspend_5_called = true;
ts5.suspend();
}