Recently I came across a situation where I had to write a functional coverage for a 32-bit register of DUT which has a one hot kind of value configured i.e. only one bit can be set at a time. Then first idea that came in my mind was to write a single bin for each bit i.e. 32 bins/coverpoints in total. But that was not a good solution at all if you have 64 bits to be covered.
While reading the System Verilog LRM, I came to below solution.
As this snippet is only for coverage purpose, it won’t check whether only a single bit is getting written. You need to write extra checks which make sure that only single bit is being written at a time.
Hope this will help you.