//control file to connect and run three ports

#include "systemc.h"
#include "send.h"
#include "channel.h"
#include "receive.h"

// Packet elements to be Transmitted
int send_::pkt[10] = {1,2,3,4,5,6,7,8,9,10};

int sc_main(int argc, char* argv[]) 
{
   //instantiate
   send_ s1("send");
   channel c1("channel");
   receive r1("receive");
   sc_link_mp<int > send_data;
   sc_link_mp<int > rcv_data;
   sc_time dut(1.0, sc_ns);
   sc_set_default_time_unit(dut);

   //create clock
   sc_time ctime(5.0, sc_ns);
   sc_clock clock("clock",ctime);
      
   //connect clocks to modules
   s1.clk(clock);
   c1.clk(clock);
   
   //connect ports to channels
   s1.in_p1(send_data);
   c1.in_p2(send_data);
   c1.out_p2(rcv_data);
   r1.out_p1(rcv_data);

   //simulation parameters
   sc_time tim(200.0, sc_ns);
   sc_start(tim);
   
   return(0);
};
