面向对象编程的高级技巧
/*===========================================================
//简单的transaction类
class Transaction;
bit [31:0] addr, crc,data[8];
Statistics stats;
static int count = 0;
int id;
function new;
stats = new();
id = count++;
endfunction
function Transaction copy;
copy new();
copy.addr = addr; //填入数值
copy.crc = crc;
copy.data = data;
copy.stats = stats.copy(); //调用St