Intelligent TEMPORAL Coverage with OSVVM

Why OSVVM™? Forums OSVVM Intelligent TEMPORAL Coverage with OSVVM


Viewing 1 post (of 1 total)
  • Author
  • #1232
    Dave Ansell

    Intelligent TEMPORAL Coverage with OSVVM

    OSVVM is so flexible that it CAN DO Temporal Coverage with the Existing Packages.

    What this code fragment was intended for was Temporal Coverage of a RANDOM Phase Shift between Groups of Packets.

    The variation in RELATIVE ARRIVAL TIMES tests whether there are circumstances in which the System Receiving the Pkts is too BUSY to handle handle them

    Actual Stimulus is provided by 2 Packet Generators whose Phase Shift between their Start Times is determined by TRANSACTION Times obtained
    RandCovPoint Intelligent CrossCoverage.

    The number of ManHours required to do this in UVM/SystemVerilog is probably quite LARGE.
    Using OSVVM it took LESS than ONE Hour to Think about it, Plan it & DO IT.

    The SMALL code fragment below shows how simple this can be with OSVVM.

    ARCHITECTURE tc1 OF pkt_start_temporal_cov_tb IS

    Stim: process

    — CksPerPkt x CksPerPkt Cross Split into PktStartXBins & PktStartYBins
    — Add Cross Bins for CORNER cases
    svPktSTime.AddCross(GenBin(0), GenBin(0));
    svPktSTime.AddCross(GenBin(0), GenBin(CksPerPkt));
    svPktSTime.AddCross(GenBin(CksPerPkt), GenBin(0));
    svPktSTime.AddCross(GenBin(CksPerPkt), GenBin(CksPerPkt));
    — Add CORNER case Cross Bins for Starting at End of Header & 1Ck Before & After

    Cov_NOT_DONE := TRUE; — FALSE when simulation is complete
    wait until rising_edge(Ck);

    CovPt_Lp: while Cov_NOT_DONE AND (NOW < 3 ms) loop — Loop til Coverage DONE or TIMEOUT
     wait until rising_edge(Ck);
     (StrtPktX, StrtPktY) := svPktSTime.RandCovPoint; — Get Rand Pkt Start Time Vals

     — Calc Start Time of Last Pkt of 2ndGrp in CovPoint
     LastPktStrt := (Maximum(StrtPktX, StrtPktY)) + ((PktGrpSiz-1)*(CksPerPkt+PktGap));
     End2ndGrp   := LastPktStrt + CksPerPkt; — End Time of Last Pkt of 2ndGrp in CovPoint
     CovPntCkCnt := 0; — Reset Progress Timer for this CovPoint

     PGrp_Lp: LOOP — This Whole Loop Does an Rnd OffSet Group of Pkts for PktGenX & Y
       IF (CovPntCkCnt = StrtPktX) THEN RunPktGenX(RunON); END IF; — TRANSACTION Run is ON
       IF (CovPntCkCnt = StrtPktY) THEN RunPktGenY(RunON); END IF; — TRANSACTION Run is ON
       wait until rising_edge(Ck);
       CovPntCkCnt := CovPntCkCnt+1; — Inc Progress Timer for this CovPoint
       IF (CovPntCkCnt = LastPktStrt) THEN RunPktGenX(RunOFF); END IF; — FINISH Curnt Pkt
       IF (CovPntCkCnt = LastPktStrt) THEN RunPktGenY(RunOFF); END IF; — FINISH Curnt Pkt
       DunPGrp_Lp: EXIT PGrp_Lp WHEN (CovPntCkCnt=End2ndGrp); — Reached End of Last Pkt 2ndGrp
     END LOOP PGrp_Lp;

     svPktSTime.ICover( (StrtPktX, StrtPktY) );
     — Quit While Loop when All Start Pkt Times Required by svPktSTime have been COVERED
     Cov_NOT_DONE := NOT svPktSTime.isCovered;
     NumBinsDone := NumBinsDone + 1;
    end loop CovPt_Lp;
    end process Stim;

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.