This pages describes the coverage part of UART TX.
In large and complex eVC(s), the coverage is done in a separate unit. This is a small self study specman project, so the coverage part is collected in the monitor.
Another, non usual issue is where the coverage collection is done. I selected to do it in the full chip (combined RX and TX environment) only.
The coverage targets for this simple case are:
- Value of first bit.
- Value of last bit.
- Stop bit length, measured in clock cycles.
Coverage collection is enabled by a switch:
has_coverage : bool;
keep soft has_coverage == FALSE;
This is switch is referred a few times in the code like:
if(has_coverage) then {
start cov_stop_bit_start_tcm();
start cov_last_bit_before_stop(last_bit);
};
...
cov_last_bit_before_stop(last_bit : bit) @sig.clk_r_ev is {};--coverage
cov_first_bit_after_start(first_bit : bit) @sig.clk_r_ev is {};--coverage
cov_stop_bit_start_tcm() @sig.clk_r_ev is {};--coverage
run() is also {
start mon_tx_data_tcm();
start mon_tx_data_load_tcm();
};
};--unit uart_tx_monitor_u
--coverage
extend TRUE'has_coverage uart_tx_monitor_u {
--measures the number of cycles of a stop bit
event cov_stop_bit_ev;
...
cover cov_stop_bit_ev is {
item cov_stop_bit_len;
};
};
Note: cov_last_bit_before_stop is declared empty. If coverage switch is not set, the this empty declaration holds. Otherwise it is overwritten.
To go to main project: main project page
|