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 m_bad_state

To specify multiple bad states, you can use the m_bad_state declaration.

   

space.gif

The syntax is:

   

space.gif

m_bad_state error_bin_name (exp1:exp2);

   

space.gif

When you use the m_bad_state declaration, Vera creates a bin for each value in the range. If you don't specify a bin name, Vera uses the same implicit naming conventions as with m_state.

   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example
   

space.gif


  1 class coverage_m_bad_state {
  2   bit [3:0] value;
  3   event     now;
  4 
  5   coverage_group something {
  6      sample_event = sync(ALL,now);
  7      sample value {
  8        state AB_0 (0:7);
  9        state AB_1 (8:12);
 10        m_bad_state AB_BAD (13:15);
 11      }
 12   }
 13 
 14   task update_coverage (bit [3:0] value) {
 15      this.value = value;
 16      trigger(now);
 17   }
 18 }
 19 
 20 
 21 
 22 program test {
 23   coverage_m_bad_state cov = new();
 24   bit [3:0] v; 
 25   repeat (10) {
 26     v = urandom__range(12,0);
 27     printf("Value is %d\n",v);
 28     cov.update_coverage(v);
 29     delay(1);
 30   }
 31   // This should cause verification error
 32   v = 15;
 33   printf("Value is %d\n",v);
 34   cov.update_coverage(v);
 35   delay(1);
 36 }    
You could download file coverage_m_bad_state.vr here
   

space.gif

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

space.gif

 Value is  1
 Value is  4
 Value is  4
 Value is  2
 Value is  0
 Value is  3
 Value is 12
 Value is  1
 Value is 10
 Value is  7
 Value is 15
 VERIFICATION ERROR (VERA FUNCTIONAL COVERAGE): 
 Illegal State  coverage_m_bad_state::something:cov.value.AB_BAD = 0xf
  (coverage_m_bad_state.vr, line 7)
   

space.gif

  ../images/main/bullet_star_pink.gif Coverage Report
   

space.gif

 Group : test::coverage_m_bad_state::something
 
 ====================================================
 Group : test::coverage_m_bad_state::something
 ====================================================
 Score   Weight  Goal    
 100.00  1       100     
 
 
 
 
 ====================================================
 
 Samples for Group : test::coverage_m_bad_state::something
 
 
 
 Variable Expected Covered Percent Goal Weight 
                                               
 Total    2        2       100.00              
                                               
 value    2        2       100.00  100  1      
                                               
 
 
 ====================================================
 
 Summary for variable value
 
 
                   Expected Covered Percent 
                                            
 User Defined Bins 2        2       100.00  
                                            
 
 
 User Defined Bins for value
 
 
 Excluded/Illegal bins
 
 name   count          
                      
 AB_BAD 1     illegal 
                      
 
 
 Covered bins
 
 name count at least  
                     
 AB_1 2     1        
                     
 AB_0 8     1        
                     
 
 
   

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