Hi Ajeetha,
I had started a reply right away and thought I had finished, but apparently forgot to submit it.
TCover in OSVVM is does transition coverage. You will need to name your something different.
It is ok to use the existing data structure for TCover to record the last value. I think your check is off a little as yours currently will find 0 to 0 and 1 to 1 as well as the edges. Perhaps you want:
`vhdl
procedure ToggleCover (ID : CoverageIDType; A : integer) is
constant CoverID : integer := ID.ID;
begin
— Check if both previous and current values are either 0 or 1
if (CovStructPtr(CoverID).TCoverValuePtr.all(CovStructPtr(CoverID).BinValLength – 1) = 0 and A = 1) or
(CovStructPtr(CoverID).TCoverValuePtr.all(CovStructPtr(CoverID).BinValLength – 1) = 1 and A = 0) then
`
I think it would be good to take a step back and see what additional sort of things we may want to add and figure out how the architect them all in. For example, I need some cover counters on rising or falling edge events.
Something will need to initialize the bin associated with counting the toggle, rising, or falling events.
Best Regards,
Jim