I am adding support for bit vector functional/toggle coverage using OSVVM. I have basic every-bit cover working (Will be glad to share a prototype if anyone is willing to review). Now, the next step is to ensure each bit really transitioned from 0 to 1 and 1 to 0. I tried using TCover and by reading the implementation it looks like it would capture all transitions (x to 1, z to x etc.) and not just 0->1. I believe one fix could be to update/overload TCover as below:
procedure TCover (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 or
CovStructPtr(CoverID).TCoverValuePtr.all(CovStructPtr(CoverID).BinValLength - 1) = 1) and
(A = 0 or A = 1) then
Other approach could be to add a condition prior to calling TCover – any inputs/thoughts?
Thanks
Ajeetha