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 Defining Cross Coverage Items
   

space.gif

Cross items are combinations of items from the same coverage group. The cross coverage construct is used to define cross items.

   

space.gif

Syntax

   

space.gif

cross item-name-1, item-name-2, ... [using coverage-item-option, ...]
   

space.gif

Where

   

space.gif

item-name-1, item-name-2, ...

Each item name must be one of the following.

The name of an item defined previously in the current coverage group

The name of a transition item defined previously in the current coverage group

The name of a cross item defined previously in the current coverage group

coverage-item- option

An option for the cross item.

   

space.gif

   

space.gif

Options

   

space.gif

Option

Description

at_least=num

The minimum number of samples for each bucket of the item. Anything less than num is considered a hole.

ignore=item-bool-exp

Define values that are to be completely ignored. They do not appear in the statistics at all. The expression is a Boolean expression that can contain a coverage item name and constants.

illegal=item-bool-exp

Define values that are illegal. An illegal value causes a DUT error. If the check_illegal_immediately coverage configuration option is FALSE, the DUT error occurs during the check_test phase of the test. If that configuration option is TRUE, the DUT error occurs immediately (on the fly). Note that checking illegal values immediately has a significant negative impact on Specman performance.

name=label

Specifies a name for a cross coverage item. No white spaces are allowed in the label. The default is cross__item-a__item-b

no_collect=bool

When no_collect[=TRUE], this coverage item is not displayed in coverage reports and is not saved in the coverage files.

text=string

A text description for this coverage item. This can only be a quoted string, not a variable or expression. In the ASCII coverage report the text is shown along with the item name at the top of the coverage information for the item. In the Show Coverage GUI, the text is shown for each item.

weight=uint

Specifies the weight of the current item relative to other items in the same coverage group. It is a non-negative integer with a default of 1.

when=bool-exp

The item is sampled only when bool-exp is TRUE. The bool-exp is evaluated in the context of the parent struct.

   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example
   

space.gif


  1 <'
  2 type cpu_opcode: [ADD, SUB, OR, AND, JMP, LABEL]; 
  3 type cpu_reg: [reg0, reg1, reg2, reg3]; 
  4 
  5 struct inst { 
  6     opcode: cpu_opcode; 
  7     op1: cpu_reg; 
  8     op2: byte;
  9     event info; 
 10     event data_change; 
 11     event inst_driven; 
 12     cover data_change using no_collect is { 
 13         item data: uint(bits:16) = op2;
 14     }; 
 15     cover info is { 
 16         item opcode using per_instance, ignore = (opcode == ADD); 
 17     }; 
 18     cover inst_driven is { 
 19         item opcode; 
 20         item op1 using at_least=2;
 21         cross opcode, op1;
 22     };
 23 
 24     post_generate() is also {
 25       emit info; 
 26       emit data_change; 
 27       emit inst_driven; 
 28     };
 29 }; 
 30 
 31 extend sys {
 32   inst : inst;
 33   run() is also {
 34     for {var i: uint = 0; i < 10 ; i = i + 1} do {
 35       gen inst;
 36       print inst;
 37     };
 38   };
 39 };
 40 '>
You could download file coverage4.e here
   

space.gif

  ../images/main/bullet_star_pink.gif Simulation Output
   

space.gif

  inst = inst-@0: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         ADD
1	op1:                            reg3
2	op2:                            59
  inst = inst-@1: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         OR
1	op1:                            reg3
2	op2:                            90
  inst = inst-@2: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         SUB
1	op1:                            reg3
2	op2:                            188
  inst = inst-@3: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         JMP
1	op1:                            reg3
2	op2:                            97
  inst = inst-@4: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         OR
1	op1:                            reg1
2	op2:                            105
  inst = inst-@5: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         LABEL
1	op1:                            reg2
2	op2:                            4
  inst = inst-@6: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         SUB
1	op1:                            reg1
2	op2:                            14
  inst = inst-@7: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         LABEL
1	op1:                            reg3
2	op2:                            204
  inst = inst-@8: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         JMP
1	op1:                            reg2
2	op2:                            170
  inst = inst-@9: inst   of unit: sys 
	----------------------------------------------	@coverage4
0	opcode:                         LABEL
1	op1:                            reg0
2	op2:                            250
Wrote 1 cover_struct to coverage4_1.ecov
   

space.gif

  ../images/main/bullet_star_pink.gif Coverage
   

space.gif

 Cover group: inst.info
 ======================
 
 Grade: 0.80  Weight: 1
 
 ** opcode **
 Samples: 10  Tests: 1  Grade: 0.80  Weight: 1
 
 grade    goal   samples  tests    %t    opcode
 ------------------------------------------------
  1.00       1         2     1     20    SUB
  1.00       1         3     1     30    OR
  0.00       1         0     0      0    AND
  1.00       1         2     1     20    JMP
  1.00       1         3     1     30    LABEL
 
 
 
 Cover group: inst.inst_driven
 =============================
 
 Grade: 0.71  Weight: 1
 
 ** opcode **
 Samples: 11  Tests: 1  Grade: 0.83  Weight: 1
 
 grade    goal   samples  tests    %t    opcode
 ------------------------------------------------
  1.00       1         1     1      9    ADD
  1.00       1         2     1     18    SUB
  1.00       1         3     1     27    OR
  0.00       1         0     0      0    AND
  1.00       1         2     1     18    JMP
  1.00       1         3     1     27    LABEL
 
 
 ** op1 **
 Samples: 11  Tests: 1  Grade: 0.88  Weight: 1
 
 grade    goal   samples  tests    %t    op1
 ------------------------------------------------
  0.50       2         1     1      9    reg0
  1.00       2         2     1     18    reg1
  1.00       2         2     1     18    reg2
  1.00       2         6     1     55    reg3
 
 
 ** cross__opcode__op1 **
 Samples: 11  Tests: 1  Grade: 0.42  Weight: 1
 
 grade    goal   samples  tests   %p/%t  opcode/op1
 ------------------------------------------------------
  0.25       -         1     1     9/9   ADD
  0.00       1         0     0     0/0   ADD/reg0
  0.00       1         0     0     0/0   ADD/reg1
  0.00       1         0     0     0/0   ADD/reg2
  1.00       1         1     1   100/9   ADD/reg3
  0.50       -         2     1    18/18  SUB
  0.00       1         0     0     0/0   SUB/reg0
  1.00       1         1     1    50/9   SUB/reg1
  0.00       1         0     0     0/0   SUB/reg2
  1.00       1         1     1    50/9   SUB/reg3
  0.50       -         3     1    27/27  OR
  0.00       1         0     0     0/0   OR/reg0
  1.00       1         1     1    33/9   OR/reg1
  0.00       1         0     0     0/0   OR/reg2
  1.00       1         2     1    67/18  OR/reg3
  0.00       -         0     0     0/0   AND
  0.50       -         2     1    18/18  JMP
  0.00       1         0     0     0/0   JMP/reg0
  0.00       1         0     0     0/0   JMP/reg1
  1.00       1         1     1    50/9   JMP/reg2
  1.00       1         1     1    50/9   JMP/reg3
  0.75       -         3     1    27/27  LABEL
  1.00       1         1     1    33/9   LABEL/reg0
  0.00       1         0     0     0/0   LABEL/reg1
  1.00       1         1     1    33/9   LABEL/reg2
  1.00       1         1     1    33/9   LABEL/reg3
   

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