Previous Section Next Section

10.5 Cross Coverage Items

Cross coverage items provide a cross product (matrix) of two or more previously declared basic items. It is possible to create a cross of any number of basic or transition items declared in the same coverage group. A cross can be created either from e code or from the coverage user interface of Specman Elite. The syntax for cross coverage items is as follows:

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

The coverage options for transition coverage items are very similar to the options described in Table 10-3 for basic coverage items. However, the ranges option is not available with cross coverage items. Example 10-6 shows the usage of transition coverage items for covering a DUT state machine.

Example 10-6 Cross Coverage Items
Example of cross coverage items.
A cross can be done from
- basic coverage items
- transition items
<'
type cpu_opcode: [ADD, SUB];
type cpu_reg: [reg0, reg1, reg2];
struct inst {
    opcode: cpu_opcode;
    op1: cpu_reg;
    event inst_driven;

    cover inst_driven is {
        item opcode; //Basic coverage item
        item op1; //Basic coverage item
        cross opcode, op1; //Cross between op1 and opcode
                          //Covers eight possible combinations of
                          //cpu_opcode and cpu_reg

    };
    run() is also {
        emit inst_driven;
    };
};
'>
Previous Section Next Section