Code Browser Pages:
| // by gopi@testbench.in `ifndef COV_CLASS `define COV_CLASS class cov ; DA_e DA_t ; TAG_e TAG_t ; TYPE_e TYPE_t ; LENGTH_e LENGTH_t; TIME_e TIME_t ; LENERR_e LENERR_t; integer length; integer Pkt_No; covergroup Ehernet_Cov ; DA_n : coverpoint DA_t {option.weight = 0; } TAG_n : coverpoint TAG_t {option.weight = 0; } TYPE_n : coverpoint TYPE_t {option.weight = 0; } LENGTH_n: coverpoint LENGTH_t {option.weight = 0; } TIME_n : coverpoint TIME_t {option.weight = 0; } LENERR_n: coverpoint LENERR_t {option.weight = 0; } ALL_JUMBO_c : cross DA_n,TAG_n,LENERR_n,TYPE_n { ignore_bins foo = binsof(TYPE_n) intersect { LENGTH,PAUSE,CNTRL } ; } ALL_LENGTH_c : cross DA_n,TAG_n,LENGTH_n,LENERR_n,TYPE_n { ignore_bins foo = binsof(TYPE_n) intersect { JUMBO,PAUSE,CNTRL } ; } ALL_PAUSE_c : cross DA_n,TAG_n,TIME_n,LENERR_n,TYPE_n { ignore_bins foo = binsof(TYPE_n) intersect { JUMBO,LENGTH,CNTRL } ; } ALL_CNTRL_c : cross DA_n,TAG_n,LENERR_n,TYPE_n { ignore_bins foo = binsof(TYPE_n) intersect { JUMBO,LENGTH,PAUSE } ; } endgroup function new(); Ehernet_Cov = new(); endfunction task sample(packet p); DA_t = p.DA_t ; TAG_t = p.TAG_t ; TYPE_t = p.TYPE_t ; LENGTH_t = p.LENGTH_t ; TIME_t = p.TIME_t ; LENERR_t = p.LENERR_t ; length = p.length ; Pkt_No = p.Pkt_No ; Ehernet_Cov.sample(); endtask endclass `endif |