fvutils / pyvsc

Python packages providing a library for Verification Stimulus and Coverage
https://fvutils.github.io/pyvsc
Apache License 2.0
113 stars 26 forks source link

Issue with wildcardbin array #104

Closed aneels3 closed 3 years ago

aneels3 commented 3 years ago

Hi @mballance I was trying the wildcard example which is in the documentation. I have modified the example as per my use case.

import vsc

@vsc.covergroup
class cg(object):

    def __init__(self):
        self.with_sample(
            dict(a=vsc.bit_t(8)))

        self.cp_a = vsc.coverpoint(lambda: self.a[7:0], bins=dict(
            a=vsc.wildcard_bin_array([], "0b1011011x", "0b0x101010")
            ))

obj1 = cg()

I am getting the below error

Traceback (most recent call last):
  File "wildcard.py", line 14, in <module>
    obj1 = cg()
  File "/home/anil/.local/lib/python3.6/site-packages/vsc/coverage.py", line 308, in __init__
    super().__init__(*args, **kwargs)
  File "wildcard.py", line 11, in __init__
    a=vsc.wildcard_bin_array([], "0b1011011x", "0b0x101010")
  File "/home/anil/.local/lib/python3.6/site-packages/vsc/coverage.py", line 521, in __init__
    self.range_l[i][1] = self.range_l[i+1][1]
TypeError: 'tuple' object does not support item assignment

How can I specify the different scenarios in a single wildcard_bin_array()?

Thanks and Regards, Anil

aneels3 commented 3 years ago

Closing this duplicate issue.