覆盖所有位的覆盖箱
问题描述:
我只是SystemVerilog的初学者,现在我正在阅读关于覆盖率的内容。所以我对此有疑问。我如何编写覆盖点箱来覆盖信号的所有位?覆盖所有位的覆盖箱
interface allSignals;
logic [31:0] addr;
logic [15:0] len;
bit trigger;
covegroup [email protected];
coverpoint addr; //This generates bins automatically(64 bins by
default) with each bin containing 2^32/64 values
coverpoint addr[0]; //each coverpoint covers 2 bins and 50% coverage
coverpoint addr[1]; //is shown even if the value is not covered in
... //that bin
...
coverpoint addr[31];
coverpoint addr{
bins a0[] = {[0:5000]}; //should write 2^32 values which is
bins a1[] = {[5001:10000]}; //very complex
...
...
}
ad: coverpoint addr{
bins a[100] = ad; //creates 100 bins with 2^32/100 values in
} //each bin
endgroup
signalOne cvr1 = new;
endinterface
我该如何写一个涵盖所有32位“addr”信号的覆盖点。有没有其他更好的方法来做到这一点。
答
您不打算通过尝试访问2 ** 32个地址来收集32位地址的功能覆盖。在具有70ns访问存储器的实际硬件中,需要5分钟。鉴于软件模拟速度通常比以前慢10000倍,那将需要一个月的时间。
大多数人所做的就是寻找每个位从0到1和1到0的转换。即切换覆盖范围。虽然它是possible to model toggle coverage与covergroup
,但大多数工具都具有内置分析功能来为您执行此操作。您需要检查仿真工具的用户手册。
如果您确实需要详尽测试整个4GB地址空间,那么您可能需要调查formal tools而不是模拟。
“覆盖所有32位”是什么意思?每个都是一个/零? –