Using TCover to model bit transitions

Why OSVVM™? Forums OSVVM Using TCover to model bit transitions

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2651

    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

    #2653
    Jim Lewis
    Member

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.