求助:sv中randomize使用问题
时间:10-02
整理:3721RD
点击:
class Transaction;
rand bit port_0;
rand bit port_1;
covergroup CovPort @(posedge clk);
port_0:coverpoint port_0;
port_1:coverpoint port_1;
cross port_0,port_1;
endgroup
初始化时钟……
intial begin
Transaction tr;
tr=new();
while(1) begin
@(posedge clk);
tr.randomize();
tr.CovPort.sample();
…
然后,ncsim:null pointer dereference
每次模拟到一个时钟上升沿就停止!哪位大神帮看看,不胜感激!
rand bit port_0;
rand bit port_1;
covergroup CovPort @(posedge clk);
port_0:coverpoint port_0;
port_1:coverpoint port_1;
cross port_0,port_1;
endgroup
初始化时钟……
intial begin
Transaction tr;
tr=new();
while(1) begin
@(posedge clk);
tr.randomize();
tr.CovPort.sample();
…
然后,ncsim:null pointer dereference
每次模拟到一个时钟上升沿就停止!哪位大神帮看看,不胜感激!
function coverage 为什么要放到transaction里面做呢,这样收集的覆盖率有说服力吗?
赞一个
请确认该CovPort是否在你的transaction的构造函数中new()了