本文整理汇总了C++中sc_process_handle::valid方法的典型用法代码示例。如果您正苦于以下问题:C++ sc_process_handle::valid方法的具体用法?C++ sc_process_handle::valid怎么用?C++ sc_process_handle::valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sc_process_handle
的用法示例。
在下文中一共展示了sc_process_handle::valid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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() );
}
}
示例2: 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;
}
}
示例3: wait
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) );
}
示例4: 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();
}
示例5: 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);
//.........这里部分代码省略.........