Example #1
0
File: main.cpp Project: Yonka/sc
 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';
 }
Example #2
0
    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);
      }
    }
Example #3
0
File: main.cpp Project: Yonka/sc
 void read_port2()
 {
     fct_port2->fct();
 }
Example #4
0
	void pushed (int id){
		wait(busdelay);
		controlport->pushed(id);					
	}