void printer() { while (write_buf.nb_read(tmp_byte)) { if (port_is_ready) { out_port->write(tmp_byte); cout << this->basename() << " send " << tmp_byte << " at " <<sc_time_stamp() << "\n"; port_is_ready = false; } } cout << '\n'; }
void main() { const char *str = "Visit www.accellera.org and see what SystemC can do for you today!\n"; const char *p = str; int total = 100000; while (true) { int i = 1 + int(19.0 * rand() / RAND_MAX); // 1 <= i <= 19 while (--i >= 0) { out->write(*p++); if (!*p) p = str; -- total; } if (total <= 0) break; wait(1000, SC_NS); } }
void read_port2() { fct_port2->fct(); }
void pushed (int id){ wait(busdelay); controlport->pushed(id); }