#include "systemc.h"
#include "master_bca.h"
#include "slave_bca.h"
#include "reset_bca.h"

int reset_bca::count = 0;

sc_trace_file *trace_file2 = NULL;


int sc_main(int argc, char* argv[]) {
   sc_link_mp<int> chn;
   sc_signal<int> rst;

   sc_time dftime(1.0,sc_ns);
   sc_set_default_time_unit(dftime);

   sc_time ctime(5.0,sc_ns);
   sc_clock clock("clock",ctime);

   reset_bca r1("reset_bca");
   r1.clk(clock);
   r1.rstp(rst);

   //master block
   master_bca m1("master_bca");
   m1.dat1(chn);
   m1.clk(clock);
   m1.rstp(rst);

   //slave block
   slave_bca s1("slave_bca");
   s1.dat2(chn);
   s1.clk(clock);
   s1.rstp(rst);

   sc_time stime(-1);
   sc_initialize();
   
   //<TRACE>
   trace_file2 = sc_create_vcd_trace_file("trace_bus_port_2");

   sc_trace(trace_file2,clock,"Clock");      
   sc_trace(trace_file2,s1.dat2->req,"BusRqst");   
   sc_trace(trace_file2,s1.dat2->ack,"BusAck");
   //</TRACE>      

   sc_start(stime);
   sc_close_vcd_trace_file(trace_file2);

   return(0);

};

