Manmohan
You can specify illegal_bins as a default bin, if you want to flag an error. However you have to give it a name. So in your example, it would look like:
coverpoint check{
bins check_value[] ={3'b001,3,b010,3,b100};
illegal_bins bad_stuff = default;
}
There are a couple of things to note though:
- Illegal bins aren't taken account of in the coverage figures (which is usually what you want anyway). Although the number of times the bin is hit is counted and can be queried. - You might want to think carefully about mixing checks and coverage.
This last point is a matter of methodology. Sometimes it's convenient and makes sense to do checks in the functional coverage, e.g. maybe illegal states in FSMs. Other times putting checks in the coverage leaves them open to being turned off when coverage isn't switched on, or being burried in non obvious parts of the design.
BTW, I don't know if the example above was representative of what you want to do, but there's some sneaky things you can do with functions in coverage defintions, e.g.
cp1 : coverpoint $onehot(check) { illegal_bins more_bad_stuff = default; }
Jason -- jason.sprott@verilab.com www.verilab.com
|