Hi, I am trying to write functional coverage for an internal module in the design. The internal logic uses fsm logic and register values & inputs for state transitions. I want to understand which approach is better here for functional coverage(covergroups) where i want to check all the states & state transitions are covered & also some register values are being covered. I have written a checker for the same module using an fsm. And I also want to cover the properties where state transitions happen based on inputs. Will it be better to use this checker module for both functional coverage and property coverage or create class based coverage for the covergroups ? In general, I want to understand how to make a choice between module based coverage or class based coverage.
Most modern simulators have internal mechanisms for collecting FSM coverage. I recommend understanding what your tools provide and use those features so that you aren’t trying to duplicate effort.
If you write your own, I would think that module based coverage is more portable.