针对vector写coverpoint的问题
时间:12-12
整理:3721RD
点击:
假设PraxisDmaRxService是一个8bits的vector,我想写它的coverage model,规则是:
1. PraxisDmaRxService = 8'b0000_0001, 8'b0000_1101等任何值都是合法的;
2. 并不关心PraxisDmaRxService = each specific value, however, more care if each PraxisDmaRxService[x] bit has been hit.
所以我用下面的写法了:
PraxisDmaRxService_0 : coverpoint PraxisDmaRxService[0];
PraxisDmaRxService_1 : coverpoint PraxisDmaRxService[1];
PraxisDmaRxService_2 : coverpoint PraxisDmaRxService[2];
PraxisDmaRxService_3 : coverpoint PraxisDmaRxService[3];
PraxisDmaRxService_4 : coverpoint PraxisDmaRxService[4];
PraxisDmaRxService_5 : coverpoint PraxisDmaRxService[5];
PraxisDmaRxService_6 : coverpoint PraxisDmaRxService[6];
PraxisDmaRxService_7 : coverpoint PraxisDmaRxService[7];
但想知道有没有其它更简略的写法,因为要测的模块实在有太多类似的property了。
谢
1. PraxisDmaRxService = 8'b0000_0001, 8'b0000_1101等任何值都是合法的;
2. 并不关心PraxisDmaRxService = each specific value, however, more care if each PraxisDmaRxService[x] bit has been hit.
所以我用下面的写法了:
PraxisDmaRxService_0 : coverpoint PraxisDmaRxService[0];
PraxisDmaRxService_1 : coverpoint PraxisDmaRxService[1];
PraxisDmaRxService_2 : coverpoint PraxisDmaRxService[2];
PraxisDmaRxService_3 : coverpoint PraxisDmaRxService[3];
PraxisDmaRxService_4 : coverpoint PraxisDmaRxService[4];
PraxisDmaRxService_5 : coverpoint PraxisDmaRxService[5];
PraxisDmaRxService_6 : coverpoint PraxisDmaRxService[6];
PraxisDmaRxService_7 : coverpoint PraxisDmaRxService[7];
但想知道有没有其它更简略的写法,因为要测的模块实在有太多类似的property了。
谢
我觉得你的写法就挺好的。
如果只是为了写法简洁一些,而不考虑程序消耗的话,我觉得用$clog2应该可以实现。