//this is the main program which is used to instantiate all modules and to bind them
//this also starts the simulation
#include"testbench.h"
#include"or_gate.h"
#include"systemc.h"
#include"monitor.h"
int sc_main(int argc, char *argv[])
{
sc_signal<sc_bit> t_a,t_b,t_c; //signals used to connect all the modules
/*//pointer
or_gate *g1;
g1=new or_gate("g1");
driver *d1;
d1=new driver("d1");
monitor *m1;
m1=new monitor("m1");
// name binding
g1->a(t_a);
g1->b(t_b);
g1->c(t_c);
d1->d_a(t_a);
d1->d_b(t_b);
m1->m_a(t_a);
m1->m_b(t_b);
m1->m_c(t_c);*/
//modules instantiation, not use pointers
or_gate g1("g1");
driver d1("d1");
monitor m1("m1");
//position-binding
//g1(t_a,t_b,t_c);
//d1(t_a,t_b,t_c);
//m1(t_a,t_b,t_c);
g1<<t_a<<t_b<<t_c;
d1<<t_a<<t_b;
m1<<t_a<<t_b<<t_c;
sc_start(100,SC_NS); //starts the simulation and run for 100 ns
return 0; //return on success
}