top(sc_module_name name, int size) : sc_module(name) , fifo_inst("Fifo1", size) , prod_inst("Producer1") , cons_inst("Consumer1") { prod_inst.out(fifo_inst); cons_inst.in(fifo_inst); }
top(sc_module_name name) : sc_module(name) { fifo_inst = new fifo("Fifo1"); prod_inst = new producer("Producer1"); prod_inst->out(*fifo_inst); cons_inst = new consumer("Consumer1"); cons_inst->in(*fifo_inst); }