Closed pwiecha closed 4 years ago
Documentation reference.html https://cocotb-coverage.readthedocs.io/en/latest/reference.html CoverPoint example:
>>> @coverage.CoverPoint( # cover (arg/2) < 1...5 (5 bins) ... bins = list(range(1, 5))
should be 4 bins
CoverCross example: 4 bins total, 4x4 - 2 = 14 bins total
https://cocotb-coverage.readthedocs.io/en/latest/examples.html Testbench section
bins = list(range(3,32)) #may be 3 ... 32 bytes Should be 31 bytes, range() is not inclusive
bins = list(range(3,32)) #may be 3 ... 32 bytes
And below that in the TB code:
low_limit = random.randint(3,31) up_limit = random.randint(low_limit,32)
Here I would suggest using randrange(3, 32) and randrange(low_limit, 33) because it is consistent with range() and how indexing works in python and the rest of documentation.
randrange(3, 32)
randrange(low_limit, 33)
I can do that if you approve of these changes.
fixed
Documentation reference.html https://cocotb-coverage.readthedocs.io/en/latest/reference.html CoverPoint example:
should be 4 bins
CoverCross example: 4 bins total, 4x4 - 2 = 14 bins total
https://cocotb-coverage.readthedocs.io/en/latest/examples.html Testbench section
bins = list(range(3,32)) #may be 3 ... 32 bytes
Should be 31 bytes, range() is not inclusiveAnd below that in the TB code:
Here I would suggest using
randrange(3, 32)
andrandrange(low_limit, 33)
because it is consistent with range() and how indexing works in python and the rest of documentation.