在SystemVerilog随机化验证中class packet;rand bit x;rand bit 10 y;constraint c xyX==0- y==0y0endclass那么随机得到几种求解组合值 A3B8C4D5
根据约束条件,当x等于0时,y只能等于0,否则y必须大于0。因此可以列出以下可能的组合值:
- x=0, y=0
- x=1, y=2
- x=1, y=1
- x=1, y=0
因此答案为C. 4。
原文地址: https://www.cveoy.top/t/topic/bk3c 著作权归作者所有。请勿转载和采集!