I would like to understand,How is the number of bins decided for a given coverpoint.
Lets say there are 128 address locations for a given coverpoint “address”.
While writing coverage,how do you make sure x number of bins needs to be created and it covers the required features ?
In reply to RKCH:
coverpoint address;
//By default max 64 bins are created.
/*
auto[0] = 0,1 ## for addr = 0 and 1
auto[1] = 2,3 ## for addr = 2 and 3
....
auto[62] = 124,125 ## for addr = 124 and 125
auto[63] = 126,127 ## for addr = 126 and 127
*/
you can change the max bin value. If you want to create separate bin for each of address value.
coverpoint address {option.auto_bin_max=128;};
/*
auto[0] = 0 ## for addr = 0
auto[1] = 1 ## for addr = 1
....
auto[126] = 126 ## for addr = 126
auto[127] = 127 ## for addr = 127
*/
In reply to Rahulkumar Patel:
In reply to RKCH:
coverpoint address;
//By default max 64 bins are created.
/*
auto[0] = 0,1 ## for addr = 0 and 1
auto[1] = 2,3 ## for addr = 2 and 3
....
auto[62] = 124,125 ## for addr = 124 and 125
auto[63] = 126,127 ## for addr = 126 and 127
*/
you can change the max bin value. If you want to create separate bin for each of address value.
coverpoint address {option.auto_bin_max=128;};
/*
auto[0] = 0 ## for addr = 0
auto[1] = 1 ## for addr = 1
....
auto[126] = 126 ## for addr = 126
auto[127] = 127 ## for addr = 127
*/
This you explained the implementation in code,but what I need to understand,why 128 bins required? if 64bins then why so? What is the criteria for having a certain number of bins count for a given feature coverage?
In reply to RKCH:
It’s depend on application. So if you need to cover/exercise all the possible address then create 128 bins otherwise 64/32/16 bins are enough.
Let consider having 32 bit address, so 2^32 possible bins but it’s difficult to cover all 2^32 bins. so we divide the address range into few bins. Creating separate bin for each address and covering it won’t add any value in verification.