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 Variables and Scope

Coverage information can be specified for any OpenVera variable or interface signal that is in the scope of a coverage_group's domain. This means that not all variables being monitored need to be passed in as arguments to the coverage_group.

   

space.gif

Some of the variables that can used inside a coverage_group are

   

space.gif

  • Variables declared in current class
  • Variables declared in base class
  • Variables declared in program block
  • Variables declared in another class, instantiated in current class
  • Inout and Output ports of a interface
  • Sample parameters to coverage_group
   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example : Variables and Scope : Vera File

  1 // Interface declaration
  2 interface top {
  3   input  clk CLOCK;
  4   input  [3:0] data PSAMPLE;
  5 }
  6 
  7 // Coverage class declaration
  8 class coverage_explicit {
  9   bit [3:0] value;
 10   event     now;
 11 
 12   coverage_group something (sample bit [2:0] param) {
 13      sample_event = sync(ALL,now);
 14      // Sample program block variable
 15      sample v;
 16      // Sample class variable
 17      sample value;
 18      // Sample interface signal
 19      sample top.data;
 20      // Sample coverage group parameter
 21      sample param;
 22      // We can sample base class or member of another class
 23    
 24   }
 25 
 26   task new (bit [2:0] param) {
 27     something = new (param);
 28   }
 29 
 30   task update_coverage (bit [3:0] value) {
 31      this.value = value;
 32      trigger(now);
 33   }
 34 }
 35 // Program block declaration
 36 program test {
 37   coverage_explicit cov = new(10);
 38   bit [3:0] v; 
 39   repeat (10) {
 40     v = random();
 41     printf("Value is %d\n",v);
 42     cov.update_coverage(v);
 43     delay(1);
 44   }
 45 }    
You could download file coverage_interface.vr here
   

space.gif

  ../images/main/bullet_star_pink.gif Example : Variables and Scope : HDL File

  1 module tb();
  2 
  3 
  4 reg [3:0] data;
  5 reg       clk;
  6 
  7 initial begin
  8   clk  = 0;
  9   data = 0;
 10 end
 11 
 12 always  #5  clk = ~clk;
 13 
 14 test vshell (
 15  .SystemClock (clk),
 16  .\top.clk    (clk),
 17  .\top.data   (data)
 18 );
 19 
 20 endmodule
You could download file coverage_interface.v here
   

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