Open KasperHesse opened 9 months ago
HI @KasperHesse
I am not sure if this construct would be supported by the constraint solver. I think you should not use iterable objects as a random variables. For doing what you expect, you could use pre/post_randomize()
functions.
https://cocotb-coverage.readthedocs.io/en/latest/tutorials.html#randomization-order-and-performance-issues
As stated: I want to randomize the contents of a list, applying constraints to each element of the list. The length of the list is not known ahead of time, so I need to pass that as an argument.
Let's say, as an example, that all list elements are in
range(10)
, and that an element's value should not equal adjacent elements in the list. My attempt at doing this would look as followsRunning the above returns
0 1 2 3 4
. However, at further investigation, I've found that the value passed tocon_list
in thelist
argument is the domain for the given entry ofCCList.list
. As such, the constraints don't actually seem to affect the relationship between the values in the list, which I what I want.What is the proper way to do this with cocotb-coverage?