本文整理汇总了C++中sc_event类的典型用法代码示例。如果您正苦于以下问题:C++ sc_event类的具体用法?C++ sc_event怎么用?C++ sc_event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了sc_event类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: add_static_event
//------------------------------------------------------------------------------
//"sc_process_b::add_static_event"
//
// This method adds an event to the list of static events, and sets the
// event up to call back this process when it fires.
//------------------------------------------------------------------------------
void sc_process_b::add_static_event( const sc_event& e )
{
sc_method_handle method_h; // This process as a method.
sc_thread_handle thread_h; // This process as a thread.
// CHECK TO SEE IF WE ARE ALREADY REGISTERED WITH THE EVENT:
for( int i = m_static_events.size() - 1; i >= 0; -- i ) {
if( &e == m_static_events[i] ) {
return;
}
}
// REMEMBER THE EVENT AND THEN REGISTER OUR OBJECT INSTANCE WITH IT:
m_static_events.push_back( &e );
switch ( m_process_kind )
{
case SC_THREAD_PROC_:
case SC_CTHREAD_PROC_:
thread_h = SCAST<sc_thread_handle>( this );
e.add_static( thread_h );
break;
case SC_METHOD_PROC_:
method_h = SCAST<sc_method_handle>( this );
e.add_static( method_h );
break;
default:
assert( false );
break;
}
}
开发者ID:pombredanne,项目名称:metamorphosys-desktop,代码行数:40,代码来源:sc_process.cpp
示例2: round_robin
int round_robin(const char *str, sc_event& receive, sc_event& send, int cnt)
{
while (--cnt >= 0)
{
wait(receive);
cout << "Round robin thread " << str <<
" at time " << sc_time_stamp() << endl;
wait(10, SC_NS);
send.notify();
}
return 0;
}
开发者ID:joelbarca,项目名称:nirgam,代码行数:13,代码来源:forkjoin.cpp
示例3: 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
示例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: 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
示例6: schedule_events_while_paused
void schedule_events_while_paused()
{
sig4.write(4);
immed_event.notify();
delta_event.notify(SC_ZERO_TIME);
// Should be able to instantiate an sc_object while paused
mut = new sc_mutex("mut");
sem = new sc_semaphore("sem", 1);
}
开发者ID:een5afr-public,项目名称:gem5,代码行数:10,代码来源:sc_pause.cpp
示例7: f
void f()
{
while(true)
{
e2.notify(sc_time(1,sc_ns));
wait(e2);
e3.notify(sc_time(10,sc_ns));
wait(e3);
}
}
开发者ID:een5afr-public,项目名称:gem5,代码行数:12,代码来源:test01.cpp
示例8: getmsg
void getmsg() {
if (m<max) {
wait(msg_event);
msg = (++m) * 11 + 5;
msg_event.notify();
}
}
开发者ID:marcelosousa,项目名称:llvmvf,代码行数:7,代码来源:indexer.cpp
示例9: write
virtual void write(sc_uint<8> data)
{
if (data == 255)
eop.notify(0, SC_MS);
else
write_buf.write(data);
}
开发者ID:Yonka,项目名称:sc,代码行数:7,代码来源:main.cpp
示例10: topEntry
void topEntry() {
while(true) {
x = x*2;
if (x>5){
wait(1, SC_NS);
}
v++;
wait(1, SC_NS);
w++;
y = y + 1;
for (int i = 0; i<10; i++) {
x++;
if (x>3){
x = y-2;
wait(1, SC_NS);
}
}
x = x *2;
oev.notify(1, SC_NS);
wait(ev);
y = x-2;
f(x, y);
out_port.write(y);
wait(4, SC_NS);
}
}
开发者ID:eyck,项目名称:systemc-clang,代码行数:29,代码来源:new.hpp
示例11:
void f3() {
while(true) {
global = 4;
wait(15, SC_NS);
e1.notify();
}
}
开发者ID:eyck,项目名称:systemc-clang,代码行数:7,代码来源:test3.cpp
示例12: send_byte
void send_byte()
{
out_port->write(x);
send.notify(5, SC_NS);
wait();
// cout << "send " << x << '\n';
}
开发者ID:Yonka,项目名称:sc,代码行数:7,代码来源:main.cpp
示例13: gen
void gen()
{
for (;;)
{
wait(10, SC_NS);
ev.notify();
}
}
开发者ID:ansonn,项目名称:esl_systemc,代码行数:8,代码来源:odds_and_ends.cpp
示例14: ticker
void ticker()
{
for (;;)
{
wait(10, SC_NS);
ev.notify();
}
}
开发者ID:ansonn,项目名称:esl_systemc,代码行数:8,代码来源:test02.cpp
示例15: before_end_of_elaboration
void before_end_of_elaboration()
{
cout << "sc_get_status() == " << hex << sc_get_status() << " before_end_of_elaboration in " << name() << endl;
sc_assert( sc_get_status() == SC_BEFORE_END_OF_ELABORATION );
sc_assert( sc_is_running() == false );
sig1.write(1);
timed_event.notify(1234, SC_NS);
sc_pause(); // Should be ignored
}
开发者ID:een5afr-public,项目名称:gem5,代码行数:9,代码来源:sc_pause.cpp
示例16: 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);
}
开发者ID:Max-E,项目名称:SystemC_regressions_multiplied,代码行数:44,代码来源:include_descendants.cpp
示例17: T
void T() {
if(m>0 && max > 0)
wait(20,SC_NS);
if (m<max+1) {
msg_event.notify();
wait(msg_event);
h = hash(msg);
while (table[h] != 0) {
h = (h+1) % size;
}
table[h] = msg;
}
}
开发者ID:marcelosousa,项目名称:llvmvf,代码行数:13,代码来源:indexer.cpp
示例18: 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
示例19: target_method
void target_method()
{
switch (count)
{
case 19: f20=1; break;
case 21: f21=1; break;
case 23: f22=1; break;
case 25: f23=1; break;
case 26: f24=1; break;
case 28: f25=1; break;
case 30: f26=1; break;
default: sc_assert(false); break;
}
target_awoke_event.notify();
}
开发者ID:ansonn,项目名称:esl_systemc,代码行数:15,代码来源:proc_ctrl_immed.cpp
示例20: wait
void f1() {
while(true) {
wait(SC_ZERO_TIME);
cout<<"TimeStamp: " <<sc_time_stamp();
for (int i = 0 ; i<10; i++) {
x[i] = i;
}
wait(1, SC_NS);
cout<<"\nTimeStamp wait(1, SC_NS): " <<sc_time_stamp();
e1.notify();
cout<<"\nTimeStamp e1.notify(): " <<sc_time_stamp();
wait(e3);
cout<<"\nTimeStamp wait(e3): " <<sc_time_stamp();
sc_stop();
}
}
开发者ID:eyck,项目名称:systemc-clang,代码行数:16,代码来源:dispersedEvent1.cpp
注:本文中的sc_event类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论