Closed ShraddhaDevaiya closed 3 years ago
Hi @ShraddhaDevaiya, I believe this issue was fixed in a previous release (either 0.2.9 or 0.3.0). Can you try updating? I tried out your testcase with the latest release and it works for me.
Thanks and Best Regards, Matthew
Hello @mballance , It is working with the latest version of pyvsc. I was trying this example with another small modification. In iff parameter, I have provided one conditon like following:
import vsc
@vsc.covergroup
class my_cg(object):
def __init__(self):
self.with_sample(dict( a=vsc.uint8_t(),b=vsc.uint8_t()))
self.cp1 = vsc.coverpoint(self.a, iff=(self.b == 9), bins={ "a" : vsc.bin_array([], 1, 2, 4), "b" : vsc.bin_array([4], [8,16])})
my_cg_1 = my_cg()
for i in range(8):
my_cg_1.sample(i, 0)
str_report = vsc.get_coverage_report(details=True)
print("Report:\n" + str_report)
and output is like this:
Report:
TYPE my_cg : 42.860000%
CVP cp1 : 42.860000%
Bins:
a[0] : 1
a[1] : 1
a[2] : 1
b[0] : 0
b[1] : 0
b[2] : 0
b[3] : 0
INST my_cg : 42.860000%
CVP cp1 : 42.860000%
Bins:
a[0] : 1
a[1] : 1
a[2] : 1
b[0] : 0
b[1] : 0
b[2] : 0
b[3] : 0
means according to this condtion, if b value is equal to 9, then and then only it should sample the value of a. Here, we are giving b = 0 in this : my_cg_1.sample(i, 0)
, but it is giving same output for any condition. Or is there any other way to provide condition with iff? Can you please take a look into this?
Hello @mballance ,
Have you got a chance to look into this?
Thanks & Regards, Shraddha Devaiya.
My apologies, @ShraddhaDevaiya, I had overlooked this. I've looked into 'iff' conditions on coverpoints and crosses, corrected issues, and added tests. Your testcase now behaves as expected. The updated code is available on GitHub, and has been released with version 0.3.2. Please update and retry, and confirm that the fixes resolve your issue.
Best Regards, Matthew
Hello @mballance , yes now it is working as expected. Thanks for helping.
Hello @mballance , I was trying to run one example using iff parameter in coverpoint. Following is the code for it:
It is giving an error like this:
I am not able to understand the error. It seems that I am missing something with iff usage. Can you please help?