This pages describes the UART TX monitor file.
As opposed with the BFM, the monitor is part of the passive eVC. It is to be used not only in the stand-alone unit level environment, but also in the full-chip verification environment.
The monitor uses a scoreboard for data integrity check. It assumes that data at the DUT output will be available after the input serial data collection is completed.
This is to say that the reference model, based on this scoreboard is simple.
When input data collection ends, an entry is added to the scoreboard . When a data byte at the output is ready, a compare method is called. If compare is okay the scoreboard is updated. If not a DUT error is issued.
Note: when a data out is compared, the scoreboard must not be empty. This is shown in the compare method below:
- --data intergrity check
- mon_tx_data_cmp(tx_d_byte : byte) is {
- check that !scbd.is_empty() else
- dut_error("tx_mon_u data output without input ", tx_d_byte);
- check that tx_d_byte == scbd[0] else
- dut_error(
- "tx_mon_u data compare error dut=", tx_d_byte,
- " exp=", scbd[0]
- );
- messagef(NONE, "%s tx_mon_u date compare ok of %x", name, tx_d_byte);
- scbd.delete(0);
- };--mon_tx_data_cmp
The TCM, which collects data from the output is more complex. As opposed the one in the input, which merely collects bytes, this one as to work out a serial to parallel conversion.
Serial data is stored in a list. After collection of eight bits, unpack to byte is done.
The TCM also handles coverage, which is explained in the following page.
Note that the TCM starts its main loop after reset negation.
- mon_tx_data_tcm() @sig.clk_r_ev is {
- var txd_l : list of bit;
- var last_bit : bit;
- var first_bit : bit;
-
- wait true (sig.rst_p$ == 0);
- message(NONE, "tx_mon_u reset wait ended ", name);
- while(TRUE) {
- --wait for data start bit
- wait true (sig.txd$ == 0);
- for i from 0 to 7 do {
- wait [data_wait_cycles];
- txd_l.add(sig.txd$);
- if(i == 7 && has_coverage) then {
- last_bit=sig.txd$;--last bit for coverage
- } else {
- if(i == 0 && has_coverage) then {
- first_bit=sig.txd$;--first bit for coverage
- start cov_first_bit_after_start(first_bit);
- };
- };
- };--for
- --make sure last bit is stop bit
- wait [data_wait_cycles];
- check that sig.txd$ == 1 else
- dut_error("tx_mon_u end bit not 1 ", sig.txd$);
- if(has_coverage) then {
- start cov_stop_bit_start_tcm();
- start cov_last_bit_before_stop(last_bit);
- };
-
- --end bit was okay - check that the output data is okay too.
- if(data_out_reverse_flg) then {
- txd_l=txd_l.reverse();
- };
- var tx_d_byte : byte;
- unpack(packing.low, txd_l, tx_d_byte);
- message(NONE, "tx_mon_u data\n", name) {
- print txd_l using hex;
- print tx_d_byte using hex;
- };--message
- txd_l.clear();
- mon_tx_data_cmp(tx_d_byte);
- };--while
- };--mon_tx_data_tcm
Rate of data transmission may change. This is the case between the unit level TX environment and the combined RX to TX one. The collection is controlled by the switch: data_wait_cycles.
- data_wait_cycles : uint;
- keep soft data_wait_cycles == 15;
15 is the default and is the value for the unit level.
To go to main project: main project page
|