quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Sample Event Definitions

A sampling event expression must be specified in the coverage group definition. This sampling event is used for all instantiations of a coverage definition. The sampling event expression defines when to update the bins. Coverage objects can be triggered on clock edges, signal edges, variable changes, sync events and OVA events, and completions of user defined tasks. The default behavior of sampling events is to sample the coverage object in a synchronous fashion (that is, The coverage object is sampled at the end of the simulation cycle after all Vera processing that can change variables is complete). Also, the coverage object is sampled at most once per simulation cycle even if the sampling event triggers more than once, unless the async attribute is used for the sample event.

   

space.gif

There are many ways to sample a event as in below list.

   

space.gif

  • Clock and Signal Edges : Coverage objects can be sampled on clock or signal edges as per the synchronization command. When the specified edge occurs, the object is sampled.
  • Variable Changes : Coverage objects can be sampled when variables change value using the wait_var() system task. When the value of a variable change occurs, the object is sampled.
  • Sync Events : Coverage objects can be sampled on sync events. When the sync is unblocked, the object is triggered.
  • OVA Events : Coverage objects can be sampled on OVA events. When the OVA event occurs in the DUT, the Wait() member task on the OVA object unblocks.
  • General Task Calls : If a coverage group needs an elaborate triggering mechanism, the sampling event can be a task call.
  • Async Behavior : Optionally, the async attribute can be used with the sample event specification to gather coverage information immediately.
   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example
   

space.gif


  1 // Interface definition
  2 interface ifc {
  3   input clk CLOCK;
  4 }
  5 // Coverage class
  6 class coverage_sample_events {
  7   integer wv;
  8   event   se;
  9   bit     a;
 10   // Wait var as sample event
 11   coverage_group c1 {
 12     sample_event = wait_var (wv);
 13     sample a;
 14   }
 15   // sync event as sample event
 16   coverage_group c2 {
 17     sample_event = sync(ALL,se);
 18     sample a;
 19   }
 20   // sync event with async as sample event
 21   coverage_group c3 {
 22     sample_event = sync(ALL,se) async;
 23     sample a;
 24   }
 25   // CLOCK as sample event
 26   coverage_group c4 {
 27     sample_event = @ (posedge CLOCK);
 28     sample a;
 29   }
 30   // Interface signal as sample event
 31   coverage_group c5 {
 32     sample_event = @ (posedge ifc.clk);
 33     sample a;
 34   }
 35   // wait var on parameter as sample event
 36   coverage_group c6 (var integer wv_i) {
 37     sample_event = wait_var (wv_i);
 38     sample a;
 39   }
 40   // Constructor due to c6 needing a parameter
 41   task new () {
 42     c6 = new(wv);
 43     wv = 0;
 44   }
 45   // task to update coverage
 46   task update_coverage(bit b) {
 47     a = b;
 48     trigger(se);
 49     wv ++;
 50   }
 51 
 52 }
 53 // Program block
 54 program test {
 55   coverage_sample_events cov = new();
 56   bit b;
 57   repeat (2) {
 58     b = random();
 59     printf ("Value of b %b\n",b);
 60     cov.update_coverage(b);
 61     @ (posedge CLOCK);
 62   }
 63 }
You could download file coverage_sample_events.vr here
   

space.gif

  ../images/main/bullet_star_pink.gif Simulation log
   

space.gif

 Testbench Group List
 
 SCORE  WEIGHT GOAL   NAME                             
                                                       
   0.00 1      100    test::coverage_sample_events::c5 
                                                       
  50.00 1      100    test::coverage_sample_events::c4 
                                                       
 100.00 1      100    test::coverage_sample_events::c3 
                                                       
 100.00 1      100    test::coverage_sample_events::c2 
                                                       
 100.00 1      100    test::coverage_sample_events::c1 
                                                       
 100.00 1      100    test::coverage_sample_events::c6 
                                                       
 
   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com