Module Definition
dashboard | hierarchy | modlist | groups | tests | asserts



Module Instance : tb.dut.u_io_meas.u_meas

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
93.33 100.00 100.00 100.00 100.00 66.67


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
94.29 100.00 100.00 100.00 100.00 71.43


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
94.44 100.00 83.33 100.00 u_io_meas


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
ack_sync 100.00 100.00 100.00
gen_clk_timeout_chk.u_timeout_ref_to_clk 87.50 100.00 100.00 100.00 50.00
u_ref_meas_en_sync 100.00 100.00 100.00
u_sync_ref 100.00 100.00 100.00 100.00 100.00



Module Instance : tb.dut.u_io_div2_meas.u_meas

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
93.33 100.00 100.00 100.00 100.00 66.67


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
94.29 100.00 100.00 100.00 100.00 71.43


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
94.44 100.00 83.33 100.00 u_io_div2_meas


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
ack_sync 100.00 100.00 100.00
gen_clk_timeout_chk.u_timeout_ref_to_clk 87.50 100.00 100.00 100.00 50.00
u_ref_meas_en_sync 100.00 100.00 100.00
u_sync_ref 100.00 100.00 100.00 100.00 100.00



Module Instance : tb.dut.u_io_div4_meas.u_meas

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
93.33 100.00 100.00 100.00 100.00 66.67


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
94.29 100.00 100.00 100.00 100.00 71.43


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
94.44 100.00 83.33 100.00 u_io_div4_meas


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
ack_sync 100.00 100.00 100.00
gen_clk_timeout_chk.u_timeout_ref_to_clk 87.50 100.00 100.00 100.00 50.00
u_ref_meas_en_sync 100.00 100.00 100.00
u_sync_ref 100.00 100.00 100.00 100.00 100.00



Module Instance : tb.dut.u_main_meas.u_meas

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
93.33 100.00 100.00 100.00 100.00 66.67


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
94.29 100.00 100.00 100.00 100.00 71.43


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
94.44 100.00 83.33 100.00 u_main_meas


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
ack_sync 100.00 100.00 100.00
gen_clk_timeout_chk.u_timeout_ref_to_clk 87.50 100.00 100.00 100.00 50.00
u_ref_meas_en_sync 100.00 100.00 100.00
u_sync_ref 100.00 100.00 100.00 100.00 100.00



Module Instance : tb.dut.u_usb_meas.u_meas

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
93.33 100.00 100.00 100.00 100.00 66.67


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
94.29 100.00 100.00 100.00 100.00 71.43


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
94.44 100.00 83.33 100.00 u_usb_meas


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
ack_sync 100.00 100.00 100.00
gen_clk_timeout_chk.u_timeout_ref_to_clk 87.50 100.00 100.00 100.00 50.00
u_ref_meas_en_sync 100.00 100.00 100.00
u_sync_ref 100.00 100.00 100.00 100.00 100.00

Line Coverage for Module : prim_clock_meas
Line No.TotalCoveredPercent
TOTAL3232100.00
ALWAYS8833100.00
ALWAYS1001212100.00
CONT_ASSIGN16311100.00
ALWAYS1831313100.00
CONT_ASSIGN19911100.00
CONT_ASSIGN20011100.00
CONT_ASSIGN20111100.00

87 always_ff @(posedge clk_i or negedge rst_ni) begin 88 1/1 if (!rst_ni) begin Tests: T4 T5 T6  89 1/1 state_q <= StDisable; Tests: T4 T5 T6  90 end else begin 91 1/1 state_q <= state_d; Tests: T4 T5 T6  92 end 93 end 94 95 // The following fsm sequence ensures that even if the source 96 // side changes the enable too quickly, the measurement controls 97 // remain consistent. 98 logic cnt_en; 99 always_comb begin 100 1/1 state_d = state_q; Tests: T1 T2 T3  101 1/1 cnt_en = '0; Tests: T1 T2 T3  102 103 1/1 unique case (state_q) Tests: T1 T2 T3  104 105 StDisable: begin 106 1/1 if (en_i) begin Tests: T1 T2 T3  107 1/1 state_d = StEnabling; Tests: T1 T2 T3  108 end MISSING_ELSE 109 end 110 111 StEnabling: begin 112 1/1 if (en_ref_sync) begin Tests: T1 T2 T3  113 1/1 state_d = StEnable; Tests: T1 T2 T3  114 end MISSING_ELSE 115 end 116 117 StEnable: begin 118 1/1 cnt_en = 1'b1; Tests: T1 T2 T3  119 1/1 if (!en_i) begin Tests: T1 T2 T3  120 1/1 state_d = StDisabling; Tests: T1 T2 T3  121 end MISSING_ELSE 122 end 123 124 StDisabling: begin 125 1/1 if (!en_ref_sync) begin Tests: T1 T2 T3  126 1/1 state_d = StDisable; Tests: T1 T3 T34  127 end MISSING_ELSE 128 end 129 130 //VCS coverage off 131 // pragma coverage off 132 default:; 133 //VCS coverage on 134 // pragma coverage on 135 136 endcase // unique case (state_q) 137 end 138 139 ////////////////////////// 140 // Input Clock Logic 141 ////////////////////////// 142 143 logic valid_ref; 144 logic valid; 145 // The valid pulse causes the count to reset and start counting again 146 // for each reference cycle. 147 // The count obtained during the last reference cycle is used 148 // to measure how fast/slow the input clock is. 149 prim_pulse_sync u_sync_ref ( 150 .clk_src_i(clk_ref_i), 151 .rst_src_ni(rst_ref_ni), 152 .src_pulse_i(ref_en), 153 .clk_dst_i(clk_i), 154 .rst_dst_ni(rst_ni), 155 .dst_pulse_o(valid_ref) 156 ); 157 158 159 if (RefCnt == 1) begin : gen_degenerate_case 160 // if reference count is one, cnt_ref is always 0. 161 // So there is no need to maintain a counter, and 162 // valid just becomes valid_ref 163 1/1 assign valid = valid_ref; Tests: T1 T2 T3  164 end else begin : gen_normal_case 165 logic [RefCntWidth-1:0] cnt_ref; 166 assign valid = valid_ref & (int'(cnt_ref) == RefCnt - 1); 167 always_ff @(posedge clk_i or negedge rst_ni) begin 168 if (!rst_ni) begin 169 cnt_ref <= '0; 170 end else if (!cnt_en && |cnt_ref) begin 171 cnt_ref <= '0; 172 end else if (cnt_en && valid) begin 173 cnt_ref <= '0; 174 end else if (cnt_en && valid_ref) begin 175 cnt_ref <= cnt_ref + 1'b1; 176 end 177 end 178 end 179 180 logic cnt_ovfl; 181 logic [CntWidth-1:0] cnt; 182 always_ff @(posedge clk_i or negedge rst_ni) begin 183 1/1 if (!rst_ni) begin Tests: T4 T5 T6  184 1/1 cnt <= '0; Tests: T4 T5 T6  185 1/1 cnt_ovfl <= '0; Tests: T4 T5 T6  186 1/1 end else if (!cnt_en && |cnt) begin Tests: T4 T5 T6  187 1/1 cnt <= '0; Tests: T1 T2 T3  188 1/1 cnt_ovfl <= '0; Tests: T1 T2 T3  189 1/1 end else if (valid_o) begin Tests: T4 T5 T6  190 1/1 cnt <= '0; Tests: T1 T3 T34  191 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  192 1/1 end else if (cnt_ovfl) begin Tests: T4 T5 T6  193 1/1 cnt <= '{default: '1}; Tests: T3 T7 T8  194 1/1 end else if (cnt_en) begin Tests: T4 T5 T6  195 1/1 {cnt_ovfl, cnt} <= cnt + 1'b1; Tests: T1 T2 T3  196 end MISSING_ELSE 197 end 198 199 1/1 assign valid_o = valid & |cnt; Tests: T1 T2 T3  200 1/1 assign fast_o = valid_o & ((cnt > max_cnt) | cnt_ovfl); Tests: T1 T2 T3  201 1/1 assign slow_o = valid_o & (cnt < min_cnt); Tests: T1 T2 T3 

Cond Coverage for Module : prim_clock_meas
TotalCoveredPercent
Conditions1515100.00
Logical1515100.00
Non-Logical00
Event00

 LINE       186
 EXPRESSION (((!cnt_en)) && ((|cnt)))
             -----1-----    ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT4,T5,T6
11CoveredT1,T2,T3

 LINE       199
 EXPRESSION (valid & ((|cnt)))
             --1--   ----2---
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT1,T2,T3
11CoveredT1,T3,T34

 LINE       200
 EXPRESSION (valid_o & ((cnt > max_cnt) | cnt_ovfl))
             ---1---   --------------2-------------
-1--2-StatusTests
01CoveredT3,T34,T7
10CoveredT1,T3,T34
11CoveredT3,T34,T7

 LINE       200
 SUB-EXPRESSION ((cnt > max_cnt) | cnt_ovfl)
                 -------1-------   ----2---
-1--2-StatusTests
00CoveredT4,T5,T6
01CoveredT3,T7,T8
10CoveredT3,T34,T7

 LINE       201
 EXPRESSION (valid_o & (cnt < min_cnt))
             ---1---   -------2-------
-1--2-StatusTests
01CoveredT4,T5,T6
10CoveredT1,T3,T34
11CoveredT3,T34,T8

FSM Coverage for Module : prim_clock_meas
Summary for FSM :: state_q
TotalCoveredPercent
States 4 4 100.00 (Not included in score)
Transitions 4 4 100.00
Sequences 0 0

State, Transition and Sequence Details for FSM :: state_q
statesLine No.CoveredTests
StDisable 126 Covered T4,T5,T6
StDisabling 120 Covered T1,T2,T3
StEnable 113 Covered T1,T2,T3
StEnabling 107 Covered T1,T2,T3


transitionsLine No.CoveredTests
StDisable->StEnabling 107 Covered T1,T2,T3
StDisabling->StDisable 126 Covered T1,T2,T3
StEnable->StDisabling 120 Covered T1,T2,T3
StEnabling->StEnable 113 Covered T1,T2,T3



Branch Coverage for Module : prim_clock_meas
Line No.TotalCoveredPercent
Branches 16 16 100.00
IF 88 2 2 100.00
CASE 103 8 8 100.00
IF 183 6 6 100.00


88 if (!rst_ni) begin -1- 89 state_q <= StDisable; ==> 90 end else begin 91 state_q <= state_d; ==>

Branches:
-1-StatusTests
1 Covered T4,T5,T6
0 Covered T4,T5,T6


103 unique case (state_q) -1- 104 105 StDisable: begin 106 if (en_i) begin -2- 107 state_d = StEnabling; ==> 108 end MISSING_ELSE ==> 109 end 110 111 StEnabling: begin 112 if (en_ref_sync) begin -3- 113 state_d = StEnable; ==> 114 end MISSING_ELSE ==> 115 end 116 117 StEnable: begin 118 cnt_en = 1'b1; 119 if (!en_i) begin -4- 120 state_d = StDisabling; ==> 121 end MISSING_ELSE ==> 122 end 123 124 StDisabling: begin 125 if (!en_ref_sync) begin -5- 126 state_d = StDisable; ==> 127 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
StDisable 1 - - - Covered T1,T2,T3
StDisable 0 - - - Covered T1,T2,T3
StEnabling - 1 - - Covered T1,T2,T3
StEnabling - 0 - - Covered T1,T2,T3
StEnable - - 1 - Covered T1,T2,T3
StEnable - - 0 - Covered T1,T3,T34
StDisabling - - - 1 Covered T1,T3,T34
StDisabling - - - 0 Covered T1,T2,T3


183 if (!rst_ni) begin -1- 184 cnt <= '0; ==> 185 cnt_ovfl <= '0; 186 end else if (!cnt_en && |cnt) begin -2- 187 cnt <= '0; ==> 188 cnt_ovfl <= '0; 189 end else if (valid_o) begin -3- 190 cnt <= '0; ==> 191 cnt_ovfl <= '0; 192 end else if (cnt_ovfl) begin -4- 193 cnt <= '{default: '1}; ==> 194 end else if (cnt_en) begin -5- 195 {cnt_ovfl, cnt} <= cnt + 1'b1; ==> 196 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
1 - - - - Covered T4,T5,T6
0 1 - - - Covered T1,T2,T3
0 0 1 - - Covered T1,T3,T34
0 0 0 1 - Covered T3,T7,T8
0 0 0 0 1 Covered T1,T2,T3
0 0 0 0 0 Covered T4,T5,T6


Assert Coverage for Module : prim_clock_meas
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 3 3 100.00 2 66.67
Cover properties 0 0 0
Cover sequences 0 0 0
Total 3 3 100.00 2 66.67




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
MaxWidth_A 274806697 0 0 0
RefCntVal_A 3940 3940 0 0
gen_timeout_assert.ClkRatios_A 3940 3940 0 0


MaxWidth_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 274806697 0 0 0

RefCntVal_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 3940 3940 0 0
T4 5 5 0 0
T5 5 5 0 0
T6 5 5 0 0
T27 5 5 0 0
T28 5 5 0 0
T29 5 5 0 0
T30 5 5 0 0
T31 5 5 0 0
T32 5 5 0 0
T33 5 5 0 0

gen_timeout_assert.ClkRatios_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 3940 3940 0 0
T4 5 5 0 0
T5 5 5 0 0
T6 5 5 0 0
T27 5 5 0 0
T28 5 5 0 0
T29 5 5 0 0
T30 5 5 0 0
T31 5 5 0 0
T32 5 5 0 0
T33 5 5 0 0

Line Coverage for Instance : tb.dut.u_io_meas.u_meas
Line No.TotalCoveredPercent
TOTAL3232100.00
ALWAYS8833100.00
ALWAYS1001212100.00
CONT_ASSIGN16311100.00
ALWAYS1831313100.00
CONT_ASSIGN19911100.00
CONT_ASSIGN20011100.00
CONT_ASSIGN20111100.00

87 always_ff @(posedge clk_i or negedge rst_ni) begin 88 1/1 if (!rst_ni) begin Tests: T4 T5 T6  89 1/1 state_q <= StDisable; Tests: T4 T5 T6  90 end else begin 91 1/1 state_q <= state_d; Tests: T4 T5 T6  92 end 93 end 94 95 // The following fsm sequence ensures that even if the source 96 // side changes the enable too quickly, the measurement controls 97 // remain consistent. 98 logic cnt_en; 99 always_comb begin 100 1/1 state_d = state_q; Tests: T1 T2 T3  101 1/1 cnt_en = '0; Tests: T1 T2 T3  102 103 1/1 unique case (state_q) Tests: T1 T2 T3  104 105 StDisable: begin 106 1/1 if (en_i) begin Tests: T1 T2 T3  107 1/1 state_d = StEnabling; Tests: T1 T2 T3  108 end MISSING_ELSE 109 end 110 111 StEnabling: begin 112 1/1 if (en_ref_sync) begin Tests: T1 T2 T3  113 1/1 state_d = StEnable; Tests: T1 T2 T3  114 end MISSING_ELSE 115 end 116 117 StEnable: begin 118 1/1 cnt_en = 1'b1; Tests: T1 T2 T3  119 1/1 if (!en_i) begin Tests: T1 T2 T3  120 1/1 state_d = StDisabling; Tests: T1 T2 T3  121 end MISSING_ELSE 122 end 123 124 StDisabling: begin 125 1/1 if (!en_ref_sync) begin Tests: T1 T2 T3  126 1/1 state_d = StDisable; Tests: T1 T3 T34  127 end MISSING_ELSE 128 end 129 130 //VCS coverage off 131 // pragma coverage off 132 default:; 133 //VCS coverage on 134 // pragma coverage on 135 136 endcase // unique case (state_q) 137 end 138 139 ////////////////////////// 140 // Input Clock Logic 141 ////////////////////////// 142 143 logic valid_ref; 144 logic valid; 145 // The valid pulse causes the count to reset and start counting again 146 // for each reference cycle. 147 // The count obtained during the last reference cycle is used 148 // to measure how fast/slow the input clock is. 149 prim_pulse_sync u_sync_ref ( 150 .clk_src_i(clk_ref_i), 151 .rst_src_ni(rst_ref_ni), 152 .src_pulse_i(ref_en), 153 .clk_dst_i(clk_i), 154 .rst_dst_ni(rst_ni), 155 .dst_pulse_o(valid_ref) 156 ); 157 158 159 if (RefCnt == 1) begin : gen_degenerate_case 160 // if reference count is one, cnt_ref is always 0. 161 // So there is no need to maintain a counter, and 162 // valid just becomes valid_ref 163 1/1 assign valid = valid_ref; Tests: T1 T2 T3  164 end else begin : gen_normal_case 165 logic [RefCntWidth-1:0] cnt_ref; 166 assign valid = valid_ref & (int'(cnt_ref) == RefCnt - 1); 167 always_ff @(posedge clk_i or negedge rst_ni) begin 168 if (!rst_ni) begin 169 cnt_ref <= '0; 170 end else if (!cnt_en && |cnt_ref) begin 171 cnt_ref <= '0; 172 end else if (cnt_en && valid) begin 173 cnt_ref <= '0; 174 end else if (cnt_en && valid_ref) begin 175 cnt_ref <= cnt_ref + 1'b1; 176 end 177 end 178 end 179 180 logic cnt_ovfl; 181 logic [CntWidth-1:0] cnt; 182 always_ff @(posedge clk_i or negedge rst_ni) begin 183 1/1 if (!rst_ni) begin Tests: T4 T5 T6  184 1/1 cnt <= '0; Tests: T4 T5 T6  185 1/1 cnt_ovfl <= '0; Tests: T4 T5 T6  186 1/1 end else if (!cnt_en && |cnt) begin Tests: T4 T5 T6  187 1/1 cnt <= '0; Tests: T1 T2 T3  188 1/1 cnt_ovfl <= '0; Tests: T1 T2 T3  189 1/1 end else if (valid_o) begin Tests: T4 T5 T6  190 1/1 cnt <= '0; Tests: T1 T3 T34  191 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  192 1/1 end else if (cnt_ovfl) begin Tests: T4 T5 T6  193 1/1 cnt <= '{default: '1}; Tests: T8 T11 T12  194 1/1 end else if (cnt_en) begin Tests: T4 T5 T6  195 1/1 {cnt_ovfl, cnt} <= cnt + 1'b1; Tests: T1 T2 T3  196 end MISSING_ELSE 197 end 198 199 1/1 assign valid_o = valid & |cnt; Tests: T1 T2 T3  200 1/1 assign fast_o = valid_o & ((cnt > max_cnt) | cnt_ovfl); Tests: T1 T2 T3  201 1/1 assign slow_o = valid_o & (cnt < min_cnt); Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.u_io_meas.u_meas
TotalCoveredPercent
Conditions1515100.00
Logical1515100.00
Non-Logical00
Event00

 LINE       186
 EXPRESSION (((!cnt_en)) && ((|cnt)))
             -----1-----    ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT4,T5,T6
11CoveredT1,T2,T3

 LINE       199
 EXPRESSION (valid & ((|cnt)))
             --1--   ----2---
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT1,T2,T3
11CoveredT1,T3,T34

 LINE       200
 EXPRESSION (valid_o & ((cnt > max_cnt) | cnt_ovfl))
             ---1---   --------------2-------------
-1--2-StatusTests
01CoveredT3,T7,T8
10CoveredT1,T3,T34
11CoveredT8,T11,T12

 LINE       200
 SUB-EXPRESSION ((cnt > max_cnt) | cnt_ovfl)
                 -------1-------   ----2---
-1--2-StatusTests
00CoveredT4,T5,T6
01CoveredT8,T11,T12
10CoveredT3,T7,T8

 LINE       201
 EXPRESSION (valid_o & (cnt < min_cnt))
             ---1---   -------2-------
-1--2-StatusTests
01CoveredT4,T5,T6
10CoveredT1,T3,T34
11CoveredT34,T8,T12

FSM Coverage for Instance : tb.dut.u_io_meas.u_meas
Summary for FSM :: state_q
TotalCoveredPercent
States 4 4 100.00 (Not included in score)
Transitions 4 4 100.00
Sequences 0 0

State, Transition and Sequence Details for FSM :: state_q
statesLine No.CoveredTests
StDisable 126 Covered T4,T5,T6
StDisabling 120 Covered T1,T2,T3
StEnable 113 Covered T1,T2,T3
StEnabling 107 Covered T1,T2,T3


transitionsLine No.CoveredTests
StDisable->StEnabling 107 Covered T1,T2,T3
StDisabling->StDisable 126 Covered T1,T2,T3
StEnable->StDisabling 120 Covered T1,T2,T3
StEnabling->StEnable 113 Covered T1,T2,T3



Branch Coverage for Instance : tb.dut.u_io_meas.u_meas
Line No.TotalCoveredPercent
Branches 16 16 100.00
IF 88 2 2 100.00
CASE 103 8 8 100.00
IF 183 6 6 100.00


88 if (!rst_ni) begin -1- 89 state_q <= StDisable; ==> 90 end else begin 91 state_q <= state_d; ==>

Branches:
-1-StatusTests
1 Covered T4,T5,T6
0 Covered T4,T5,T6


103 unique case (state_q) -1- 104 105 StDisable: begin 106 if (en_i) begin -2- 107 state_d = StEnabling; ==> 108 end MISSING_ELSE ==> 109 end 110 111 StEnabling: begin 112 if (en_ref_sync) begin -3- 113 state_d = StEnable; ==> 114 end MISSING_ELSE ==> 115 end 116 117 StEnable: begin 118 cnt_en = 1'b1; 119 if (!en_i) begin -4- 120 state_d = StDisabling; ==> 121 end MISSING_ELSE ==> 122 end 123 124 StDisabling: begin 125 if (!en_ref_sync) begin -5- 126 state_d = StDisable; ==> 127 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
StDisable 1 - - - Covered T1,T2,T3
StDisable 0 - - - Covered T1,T2,T3
StEnabling - 1 - - Covered T1,T2,T3
StEnabling - 0 - - Covered T1,T2,T3
StEnable - - 1 - Covered T1,T2,T3
StEnable - - 0 - Covered T1,T3,T34
StDisabling - - - 1 Covered T1,T3,T34
StDisabling - - - 0 Covered T1,T2,T3


183 if (!rst_ni) begin -1- 184 cnt <= '0; ==> 185 cnt_ovfl <= '0; 186 end else if (!cnt_en && |cnt) begin -2- 187 cnt <= '0; ==> 188 cnt_ovfl <= '0; 189 end else if (valid_o) begin -3- 190 cnt <= '0; ==> 191 cnt_ovfl <= '0; 192 end else if (cnt_ovfl) begin -4- 193 cnt <= '{default: '1}; ==> 194 end else if (cnt_en) begin -5- 195 {cnt_ovfl, cnt} <= cnt + 1'b1; ==> 196 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
1 - - - - Covered T4,T5,T6
0 1 - - - Covered T1,T2,T3
0 0 1 - - Covered T1,T3,T34
0 0 0 1 - Covered T8,T11,T12
0 0 0 0 1 Covered T1,T2,T3
0 0 0 0 0 Covered T4,T5,T6


Assert Coverage for Instance : tb.dut.u_io_meas.u_meas
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 3 3 100.00 2 66.67
Cover properties 0 0 0
Cover sequences 0 0 0
Total 3 3 100.00 2 66.67




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
MaxWidth_A 81234049 0 0 0
RefCntVal_A 788 788 0 0
gen_timeout_assert.ClkRatios_A 788 788 0 0


MaxWidth_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 81234049 0 0 0

RefCntVal_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

gen_timeout_assert.ClkRatios_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

Line Coverage for Instance : tb.dut.u_io_div2_meas.u_meas
Line No.TotalCoveredPercent
TOTAL3232100.00
ALWAYS8833100.00
ALWAYS1001212100.00
CONT_ASSIGN16311100.00
ALWAYS1831313100.00
CONT_ASSIGN19911100.00
CONT_ASSIGN20011100.00
CONT_ASSIGN20111100.00

87 always_ff @(posedge clk_i or negedge rst_ni) begin 88 1/1 if (!rst_ni) begin Tests: T4 T5 T6  89 1/1 state_q <= StDisable; Tests: T4 T5 T6  90 end else begin 91 1/1 state_q <= state_d; Tests: T4 T5 T6  92 end 93 end 94 95 // The following fsm sequence ensures that even if the source 96 // side changes the enable too quickly, the measurement controls 97 // remain consistent. 98 logic cnt_en; 99 always_comb begin 100 1/1 state_d = state_q; Tests: T1 T2 T3  101 1/1 cnt_en = '0; Tests: T1 T2 T3  102 103 1/1 unique case (state_q) Tests: T1 T2 T3  104 105 StDisable: begin 106 1/1 if (en_i) begin Tests: T1 T2 T3  107 1/1 state_d = StEnabling; Tests: T1 T2 T3  108 end MISSING_ELSE 109 end 110 111 StEnabling: begin 112 1/1 if (en_ref_sync) begin Tests: T1 T2 T3  113 1/1 state_d = StEnable; Tests: T1 T3 T34  114 end MISSING_ELSE 115 end 116 117 StEnable: begin 118 1/1 cnt_en = 1'b1; Tests: T1 T3 T34  119 1/1 if (!en_i) begin Tests: T1 T3 T34  120 1/1 state_d = StDisabling; Tests: T1 T3 T34  121 end MISSING_ELSE 122 end 123 124 StDisabling: begin 125 1/1 if (!en_ref_sync) begin Tests: T1 T3 T34  126 1/1 state_d = StDisable; Tests: T1 T3 T34  127 end MISSING_ELSE 128 end 129 130 //VCS coverage off 131 // pragma coverage off 132 default:; 133 //VCS coverage on 134 // pragma coverage on 135 136 endcase // unique case (state_q) 137 end 138 139 ////////////////////////// 140 // Input Clock Logic 141 ////////////////////////// 142 143 logic valid_ref; 144 logic valid; 145 // The valid pulse causes the count to reset and start counting again 146 // for each reference cycle. 147 // The count obtained during the last reference cycle is used 148 // to measure how fast/slow the input clock is. 149 prim_pulse_sync u_sync_ref ( 150 .clk_src_i(clk_ref_i), 151 .rst_src_ni(rst_ref_ni), 152 .src_pulse_i(ref_en), 153 .clk_dst_i(clk_i), 154 .rst_dst_ni(rst_ni), 155 .dst_pulse_o(valid_ref) 156 ); 157 158 159 if (RefCnt == 1) begin : gen_degenerate_case 160 // if reference count is one, cnt_ref is always 0. 161 // So there is no need to maintain a counter, and 162 // valid just becomes valid_ref 163 1/1 assign valid = valid_ref; Tests: T1 T3 T34  164 end else begin : gen_normal_case 165 logic [RefCntWidth-1:0] cnt_ref; 166 assign valid = valid_ref & (int'(cnt_ref) == RefCnt - 1); 167 always_ff @(posedge clk_i or negedge rst_ni) begin 168 if (!rst_ni) begin 169 cnt_ref <= '0; 170 end else if (!cnt_en && |cnt_ref) begin 171 cnt_ref <= '0; 172 end else if (cnt_en && valid) begin 173 cnt_ref <= '0; 174 end else if (cnt_en && valid_ref) begin 175 cnt_ref <= cnt_ref + 1'b1; 176 end 177 end 178 end 179 180 logic cnt_ovfl; 181 logic [CntWidth-1:0] cnt; 182 always_ff @(posedge clk_i or negedge rst_ni) begin 183 1/1 if (!rst_ni) begin Tests: T4 T5 T6  184 1/1 cnt <= '0; Tests: T4 T5 T6  185 1/1 cnt_ovfl <= '0; Tests: T4 T5 T6  186 1/1 end else if (!cnt_en && |cnt) begin Tests: T4 T5 T6  187 1/1 cnt <= '0; Tests: T1 T3 T34  188 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  189 1/1 end else if (valid_o) begin Tests: T4 T5 T6  190 1/1 cnt <= '0; Tests: T1 T3 T34  191 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  192 1/1 end else if (cnt_ovfl) begin Tests: T4 T5 T6  193 1/1 cnt <= '{default: '1}; Tests: T8 T10 T11  194 1/1 end else if (cnt_en) begin Tests: T4 T5 T6  195 1/1 {cnt_ovfl, cnt} <= cnt + 1'b1; Tests: T1 T3 T34  196 end MISSING_ELSE 197 end 198 199 1/1 assign valid_o = valid & |cnt; Tests: T1 T3 T34  200 1/1 assign fast_o = valid_o & ((cnt > max_cnt) | cnt_ovfl); Tests: T1 T2 T3  201 1/1 assign slow_o = valid_o & (cnt < min_cnt); Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.u_io_div2_meas.u_meas
TotalCoveredPercent
Conditions1515100.00
Logical1515100.00
Non-Logical00
Event00

 LINE       186
 EXPRESSION (((!cnt_en)) && ((|cnt)))
             -----1-----    ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT4,T5,T6
11CoveredT1,T3,T34

 LINE       199
 EXPRESSION (valid & ((|cnt)))
             --1--   ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT1,T3,T34
11CoveredT1,T3,T34

 LINE       200
 EXPRESSION (valid_o & ((cnt > max_cnt) | cnt_ovfl))
             ---1---   --------------2-------------
-1--2-StatusTests
01CoveredT8,T10,T11
10CoveredT1,T3,T34
11CoveredT8,T10,T11

 LINE       200
 SUB-EXPRESSION ((cnt > max_cnt) | cnt_ovfl)
                 -------1-------   ----2---
-1--2-StatusTests
00CoveredT4,T5,T6
01CoveredT8,T10,T11
10CoveredT8,T10,T11

 LINE       201
 EXPRESSION (valid_o & (cnt < min_cnt))
             ---1---   -------2-------
-1--2-StatusTests
01CoveredT4,T5,T6
10CoveredT1,T3,T34
11CoveredT34,T11,T35

FSM Coverage for Instance : tb.dut.u_io_div2_meas.u_meas
Summary for FSM :: state_q
TotalCoveredPercent
States 4 4 100.00 (Not included in score)
Transitions 4 4 100.00
Sequences 0 0

State, Transition and Sequence Details for FSM :: state_q
statesLine No.CoveredTests
StDisable 126 Covered T4,T5,T6
StDisabling 120 Covered T1,T3,T34
StEnable 113 Covered T1,T3,T34
StEnabling 107 Covered T1,T2,T3


transitionsLine No.CoveredTests
StDisable->StEnabling 107 Covered T1,T2,T3
StDisabling->StDisable 126 Covered T1,T3,T34
StEnable->StDisabling 120 Covered T1,T3,T34
StEnabling->StEnable 113 Covered T1,T3,T34



Branch Coverage for Instance : tb.dut.u_io_div2_meas.u_meas
Line No.TotalCoveredPercent
Branches 16 16 100.00
IF 88 2 2 100.00
CASE 103 8 8 100.00
IF 183 6 6 100.00


88 if (!rst_ni) begin -1- 89 state_q <= StDisable; ==> 90 end else begin 91 state_q <= state_d; ==>

Branches:
-1-StatusTests
1 Covered T4,T5,T6
0 Covered T4,T5,T6


103 unique case (state_q) -1- 104 105 StDisable: begin 106 if (en_i) begin -2- 107 state_d = StEnabling; ==> 108 end MISSING_ELSE ==> 109 end 110 111 StEnabling: begin 112 if (en_ref_sync) begin -3- 113 state_d = StEnable; ==> 114 end MISSING_ELSE ==> 115 end 116 117 StEnable: begin 118 cnt_en = 1'b1; 119 if (!en_i) begin -4- 120 state_d = StDisabling; ==> 121 end MISSING_ELSE ==> 122 end 123 124 StDisabling: begin 125 if (!en_ref_sync) begin -5- 126 state_d = StDisable; ==> 127 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
StDisable 1 - - - Covered T1,T2,T3
StDisable 0 - - - Covered T1,T2,T3
StEnabling - 1 - - Covered T1,T3,T34
StEnabling - 0 - - Covered T1,T2,T3
StEnable - - 1 - Covered T1,T3,T34
StEnable - - 0 - Covered T1,T3,T34
StDisabling - - - 1 Covered T1,T3,T34
StDisabling - - - 0 Covered T1,T3,T34


183 if (!rst_ni) begin -1- 184 cnt <= '0; ==> 185 cnt_ovfl <= '0; 186 end else if (!cnt_en && |cnt) begin -2- 187 cnt <= '0; ==> 188 cnt_ovfl <= '0; 189 end else if (valid_o) begin -3- 190 cnt <= '0; ==> 191 cnt_ovfl <= '0; 192 end else if (cnt_ovfl) begin -4- 193 cnt <= '{default: '1}; ==> 194 end else if (cnt_en) begin -5- 195 {cnt_ovfl, cnt} <= cnt + 1'b1; ==> 196 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
1 - - - - Covered T4,T5,T6
0 1 - - - Covered T1,T3,T34
0 0 1 - - Covered T1,T3,T34
0 0 0 1 - Covered T8,T10,T11
0 0 0 0 1 Covered T1,T3,T34
0 0 0 0 0 Covered T4,T5,T6


Assert Coverage for Instance : tb.dut.u_io_div2_meas.u_meas
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 3 3 100.00 2 66.67
Cover properties 0 0 0
Cover sequences 0 0 0
Total 3 3 100.00 2 66.67




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
MaxWidth_A 39845802 0 0 0
RefCntVal_A 788 788 0 0
gen_timeout_assert.ClkRatios_A 788 788 0 0


MaxWidth_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 39845802 0 0 0

RefCntVal_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

gen_timeout_assert.ClkRatios_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

Line Coverage for Instance : tb.dut.u_io_div4_meas.u_meas
Line No.TotalCoveredPercent
TOTAL3232100.00
ALWAYS8833100.00
ALWAYS1001212100.00
CONT_ASSIGN16311100.00
ALWAYS1831313100.00
CONT_ASSIGN19911100.00
CONT_ASSIGN20011100.00
CONT_ASSIGN20111100.00

87 always_ff @(posedge clk_i or negedge rst_ni) begin 88 1/1 if (!rst_ni) begin Tests: T4 T5 T6  89 1/1 state_q <= StDisable; Tests: T4 T5 T6  90 end else begin 91 1/1 state_q <= state_d; Tests: T4 T5 T6  92 end 93 end 94 95 // The following fsm sequence ensures that even if the source 96 // side changes the enable too quickly, the measurement controls 97 // remain consistent. 98 logic cnt_en; 99 always_comb begin 100 1/1 state_d = state_q; Tests: T1 T2 T3  101 1/1 cnt_en = '0; Tests: T1 T2 T3  102 103 1/1 unique case (state_q) Tests: T1 T2 T3  104 105 StDisable: begin 106 1/1 if (en_i) begin Tests: T1 T2 T3  107 1/1 state_d = StEnabling; Tests: T1 T2 T3  108 end MISSING_ELSE 109 end 110 111 StEnabling: begin 112 1/1 if (en_ref_sync) begin Tests: T1 T2 T3  113 1/1 state_d = StEnable; Tests: T1 T2 T3  114 end MISSING_ELSE 115 end 116 117 StEnable: begin 118 1/1 cnt_en = 1'b1; Tests: T1 T3 T34  119 1/1 if (!en_i) begin Tests: T1 T3 T34  120 1/1 state_d = StDisabling; Tests: T1 T3 T34  121 end MISSING_ELSE 122 end 123 124 StDisabling: begin 125 1/1 if (!en_ref_sync) begin Tests: T1 T3 T34  126 1/1 state_d = StDisable; Tests: T1 T3 T34  127 end MISSING_ELSE 128 end 129 130 //VCS coverage off 131 // pragma coverage off 132 default:; 133 //VCS coverage on 134 // pragma coverage on 135 136 endcase // unique case (state_q) 137 end 138 139 ////////////////////////// 140 // Input Clock Logic 141 ////////////////////////// 142 143 logic valid_ref; 144 logic valid; 145 // The valid pulse causes the count to reset and start counting again 146 // for each reference cycle. 147 // The count obtained during the last reference cycle is used 148 // to measure how fast/slow the input clock is. 149 prim_pulse_sync u_sync_ref ( 150 .clk_src_i(clk_ref_i), 151 .rst_src_ni(rst_ref_ni), 152 .src_pulse_i(ref_en), 153 .clk_dst_i(clk_i), 154 .rst_dst_ni(rst_ni), 155 .dst_pulse_o(valid_ref) 156 ); 157 158 159 if (RefCnt == 1) begin : gen_degenerate_case 160 // if reference count is one, cnt_ref is always 0. 161 // So there is no need to maintain a counter, and 162 // valid just becomes valid_ref 163 1/1 assign valid = valid_ref; Tests: T1 T3 T34  164 end else begin : gen_normal_case 165 logic [RefCntWidth-1:0] cnt_ref; 166 assign valid = valid_ref & (int'(cnt_ref) == RefCnt - 1); 167 always_ff @(posedge clk_i or negedge rst_ni) begin 168 if (!rst_ni) begin 169 cnt_ref <= '0; 170 end else if (!cnt_en && |cnt_ref) begin 171 cnt_ref <= '0; 172 end else if (cnt_en && valid) begin 173 cnt_ref <= '0; 174 end else if (cnt_en && valid_ref) begin 175 cnt_ref <= cnt_ref + 1'b1; 176 end 177 end 178 end 179 180 logic cnt_ovfl; 181 logic [CntWidth-1:0] cnt; 182 always_ff @(posedge clk_i or negedge rst_ni) begin 183 1/1 if (!rst_ni) begin Tests: T4 T5 T6  184 1/1 cnt <= '0; Tests: T4 T5 T6  185 1/1 cnt_ovfl <= '0; Tests: T4 T5 T6  186 1/1 end else if (!cnt_en && |cnt) begin Tests: T4 T5 T6  187 1/1 cnt <= '0; Tests: T1 T3 T34  188 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  189 1/1 end else if (valid_o) begin Tests: T4 T5 T6  190 1/1 cnt <= '0; Tests: T1 T3 T34  191 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  192 1/1 end else if (cnt_ovfl) begin Tests: T4 T5 T6  193 1/1 cnt <= '{default: '1}; Tests: T3 T7 T12  194 1/1 end else if (cnt_en) begin Tests: T4 T5 T6  195 1/1 {cnt_ovfl, cnt} <= cnt + 1'b1; Tests: T1 T3 T34  196 end MISSING_ELSE 197 end 198 199 1/1 assign valid_o = valid & |cnt; Tests: T1 T3 T34  200 1/1 assign fast_o = valid_o & ((cnt > max_cnt) | cnt_ovfl); Tests: T1 T2 T3  201 1/1 assign slow_o = valid_o & (cnt < min_cnt); Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.u_io_div4_meas.u_meas
TotalCoveredPercent
Conditions1515100.00
Logical1515100.00
Non-Logical00
Event00

 LINE       186
 EXPRESSION (((!cnt_en)) && ((|cnt)))
             -----1-----    ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT4,T5,T6
11CoveredT1,T3,T34

 LINE       199
 EXPRESSION (valid & ((|cnt)))
             --1--   ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT1,T3,T34
11CoveredT1,T3,T34

 LINE       200
 EXPRESSION (valid_o & ((cnt > max_cnt) | cnt_ovfl))
             ---1---   --------------2-------------
-1--2-StatusTests
01CoveredT3,T34,T7
10CoveredT1,T3,T34
11CoveredT3,T34,T7

 LINE       200
 SUB-EXPRESSION ((cnt > max_cnt) | cnt_ovfl)
                 -------1-------   ----2---
-1--2-StatusTests
00CoveredT4,T5,T6
01CoveredT3,T7,T12
10CoveredT3,T34,T7

 LINE       201
 EXPRESSION (valid_o & (cnt < min_cnt))
             ---1---   -------2-------
-1--2-StatusTests
01CoveredT4,T5,T6
10CoveredT1,T3,T34
11CoveredT3,T8,T11

FSM Coverage for Instance : tb.dut.u_io_div4_meas.u_meas
Summary for FSM :: state_q
TotalCoveredPercent
States 4 4 100.00 (Not included in score)
Transitions 4 4 100.00
Sequences 0 0

State, Transition and Sequence Details for FSM :: state_q
statesLine No.CoveredTests
StDisable 126 Covered T4,T5,T6
StDisabling 120 Covered T1,T3,T34
StEnable 113 Covered T1,T3,T34
StEnabling 107 Covered T1,T2,T3


transitionsLine No.CoveredTests
StDisable->StEnabling 107 Covered T1,T2,T3
StDisabling->StDisable 126 Covered T1,T3,T34
StEnable->StDisabling 120 Covered T1,T3,T34
StEnabling->StEnable 113 Covered T1,T3,T34



Branch Coverage for Instance : tb.dut.u_io_div4_meas.u_meas
Line No.TotalCoveredPercent
Branches 16 16 100.00
IF 88 2 2 100.00
CASE 103 8 8 100.00
IF 183 6 6 100.00


88 if (!rst_ni) begin -1- 89 state_q <= StDisable; ==> 90 end else begin 91 state_q <= state_d; ==>

Branches:
-1-StatusTests
1 Covered T4,T5,T6
0 Covered T4,T5,T6


103 unique case (state_q) -1- 104 105 StDisable: begin 106 if (en_i) begin -2- 107 state_d = StEnabling; ==> 108 end MISSING_ELSE ==> 109 end 110 111 StEnabling: begin 112 if (en_ref_sync) begin -3- 113 state_d = StEnable; ==> 114 end MISSING_ELSE ==> 115 end 116 117 StEnable: begin 118 cnt_en = 1'b1; 119 if (!en_i) begin -4- 120 state_d = StDisabling; ==> 121 end MISSING_ELSE ==> 122 end 123 124 StDisabling: begin 125 if (!en_ref_sync) begin -5- 126 state_d = StDisable; ==> 127 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
StDisable 1 - - - Covered T1,T2,T3
StDisable 0 - - - Covered T1,T2,T3
StEnabling - 1 - - Covered T1,T2,T3
StEnabling - 0 - - Covered T1,T2,T3
StEnable - - 1 - Covered T1,T3,T34
StEnable - - 0 - Covered T1,T3,T34
StDisabling - - - 1 Covered T1,T3,T34
StDisabling - - - 0 Covered T1,T3,T34


183 if (!rst_ni) begin -1- 184 cnt <= '0; ==> 185 cnt_ovfl <= '0; 186 end else if (!cnt_en && |cnt) begin -2- 187 cnt <= '0; ==> 188 cnt_ovfl <= '0; 189 end else if (valid_o) begin -3- 190 cnt <= '0; ==> 191 cnt_ovfl <= '0; 192 end else if (cnt_ovfl) begin -4- 193 cnt <= '{default: '1}; ==> 194 end else if (cnt_en) begin -5- 195 {cnt_ovfl, cnt} <= cnt + 1'b1; ==> 196 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
1 - - - - Covered T4,T5,T6
0 1 - - - Covered T1,T3,T34
0 0 1 - - Covered T1,T3,T34
0 0 0 1 - Covered T3,T7,T12
0 0 0 0 1 Covered T1,T3,T34
0 0 0 0 0 Covered T4,T5,T6


Assert Coverage for Instance : tb.dut.u_io_div4_meas.u_meas
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 3 3 100.00 2 66.67
Cover properties 0 0 0
Cover sequences 0 0 0
Total 3 3 100.00 2 66.67




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
MaxWidth_A 19922488 0 0 0
RefCntVal_A 788 788 0 0
gen_timeout_assert.ClkRatios_A 788 788 0 0


MaxWidth_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 19922488 0 0 0

RefCntVal_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

gen_timeout_assert.ClkRatios_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

Line Coverage for Instance : tb.dut.u_main_meas.u_meas
Line No.TotalCoveredPercent
TOTAL3232100.00
ALWAYS8833100.00
ALWAYS1001212100.00
CONT_ASSIGN16311100.00
ALWAYS1831313100.00
CONT_ASSIGN19911100.00
CONT_ASSIGN20011100.00
CONT_ASSIGN20111100.00

87 always_ff @(posedge clk_i or negedge rst_ni) begin 88 1/1 if (!rst_ni) begin Tests: T4 T5 T6  89 1/1 state_q <= StDisable; Tests: T4 T5 T6  90 end else begin 91 1/1 state_q <= state_d; Tests: T4 T5 T6  92 end 93 end 94 95 // The following fsm sequence ensures that even if the source 96 // side changes the enable too quickly, the measurement controls 97 // remain consistent. 98 logic cnt_en; 99 always_comb begin 100 1/1 state_d = state_q; Tests: T1 T2 T3  101 1/1 cnt_en = '0; Tests: T1 T2 T3  102 103 1/1 unique case (state_q) Tests: T1 T2 T3  104 105 StDisable: begin 106 1/1 if (en_i) begin Tests: T1 T2 T3  107 1/1 state_d = StEnabling; Tests: T1 T2 T3  108 end MISSING_ELSE 109 end 110 111 StEnabling: begin 112 1/1 if (en_ref_sync) begin Tests: T1 T2 T3  113 1/1 state_d = StEnable; Tests: T1 T3 T34  114 end MISSING_ELSE 115 end 116 117 StEnable: begin 118 1/1 cnt_en = 1'b1; Tests: T1 T3 T34  119 1/1 if (!en_i) begin Tests: T1 T3 T34  120 1/1 state_d = StDisabling; Tests: T1 T3 T34  121 end MISSING_ELSE 122 end 123 124 StDisabling: begin 125 1/1 if (!en_ref_sync) begin Tests: T1 T3 T34  126 1/1 state_d = StDisable; Tests: T1 T3 T34  127 end MISSING_ELSE 128 end 129 130 //VCS coverage off 131 // pragma coverage off 132 default:; 133 //VCS coverage on 134 // pragma coverage on 135 136 endcase // unique case (state_q) 137 end 138 139 ////////////////////////// 140 // Input Clock Logic 141 ////////////////////////// 142 143 logic valid_ref; 144 logic valid; 145 // The valid pulse causes the count to reset and start counting again 146 // for each reference cycle. 147 // The count obtained during the last reference cycle is used 148 // to measure how fast/slow the input clock is. 149 prim_pulse_sync u_sync_ref ( 150 .clk_src_i(clk_ref_i), 151 .rst_src_ni(rst_ref_ni), 152 .src_pulse_i(ref_en), 153 .clk_dst_i(clk_i), 154 .rst_dst_ni(rst_ni), 155 .dst_pulse_o(valid_ref) 156 ); 157 158 159 if (RefCnt == 1) begin : gen_degenerate_case 160 // if reference count is one, cnt_ref is always 0. 161 // So there is no need to maintain a counter, and 162 // valid just becomes valid_ref 163 1/1 assign valid = valid_ref; Tests: T1 T3 T34  164 end else begin : gen_normal_case 165 logic [RefCntWidth-1:0] cnt_ref; 166 assign valid = valid_ref & (int'(cnt_ref) == RefCnt - 1); 167 always_ff @(posedge clk_i or negedge rst_ni) begin 168 if (!rst_ni) begin 169 cnt_ref <= '0; 170 end else if (!cnt_en && |cnt_ref) begin 171 cnt_ref <= '0; 172 end else if (cnt_en && valid) begin 173 cnt_ref <= '0; 174 end else if (cnt_en && valid_ref) begin 175 cnt_ref <= cnt_ref + 1'b1; 176 end 177 end 178 end 179 180 logic cnt_ovfl; 181 logic [CntWidth-1:0] cnt; 182 always_ff @(posedge clk_i or negedge rst_ni) begin 183 1/1 if (!rst_ni) begin Tests: T4 T5 T6  184 1/1 cnt <= '0; Tests: T4 T5 T6  185 1/1 cnt_ovfl <= '0; Tests: T4 T5 T6  186 1/1 end else if (!cnt_en && |cnt) begin Tests: T4 T5 T6  187 1/1 cnt <= '0; Tests: T1 T3 T34  188 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  189 1/1 end else if (valid_o) begin Tests: T4 T5 T6  190 1/1 cnt <= '0; Tests: T1 T3 T34  191 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  192 1/1 end else if (cnt_ovfl) begin Tests: T4 T5 T6  193 1/1 cnt <= '{default: '1}; Tests: T7 T35 T12  194 1/1 end else if (cnt_en) begin Tests: T4 T5 T6  195 1/1 {cnt_ovfl, cnt} <= cnt + 1'b1; Tests: T1 T3 T34  196 end MISSING_ELSE 197 end 198 199 1/1 assign valid_o = valid & |cnt; Tests: T1 T3 T34  200 1/1 assign fast_o = valid_o & ((cnt > max_cnt) | cnt_ovfl); Tests: T1 T2 T3  201 1/1 assign slow_o = valid_o & (cnt < min_cnt); Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.u_main_meas.u_meas
TotalCoveredPercent
Conditions1515100.00
Logical1515100.00
Non-Logical00
Event00

 LINE       186
 EXPRESSION (((!cnt_en)) && ((|cnt)))
             -----1-----    ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT4,T5,T6
11CoveredT1,T3,T34

 LINE       199
 EXPRESSION (valid & ((|cnt)))
             --1--   ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT1,T3,T34
11CoveredT1,T3,T34

 LINE       200
 EXPRESSION (valid_o & ((cnt > max_cnt) | cnt_ovfl))
             ---1---   --------------2-------------
-1--2-StatusTests
01CoveredT7,T8,T10
10CoveredT1,T3,T34
11CoveredT7,T35,T12

 LINE       200
 SUB-EXPRESSION ((cnt > max_cnt) | cnt_ovfl)
                 -------1-------   ----2---
-1--2-StatusTests
00CoveredT4,T5,T6
01CoveredT7,T35,T12
10CoveredT7,T8,T10

 LINE       201
 EXPRESSION (valid_o & (cnt < min_cnt))
             ---1---   -------2-------
-1--2-StatusTests
01CoveredT4,T5,T6
10CoveredT1,T3,T34
11CoveredT3,T11,T12

FSM Coverage for Instance : tb.dut.u_main_meas.u_meas
Summary for FSM :: state_q
TotalCoveredPercent
States 4 4 100.00 (Not included in score)
Transitions 4 4 100.00
Sequences 0 0

State, Transition and Sequence Details for FSM :: state_q
statesLine No.CoveredTests
StDisable 126 Covered T4,T5,T6
StDisabling 120 Covered T1,T3,T34
StEnable 113 Covered T1,T3,T34
StEnabling 107 Covered T1,T2,T3


transitionsLine No.CoveredTests
StDisable->StEnabling 107 Covered T1,T2,T3
StDisabling->StDisable 126 Covered T1,T3,T34
StEnable->StDisabling 120 Covered T1,T3,T34
StEnabling->StEnable 113 Covered T1,T3,T34



Branch Coverage for Instance : tb.dut.u_main_meas.u_meas
Line No.TotalCoveredPercent
Branches 16 16 100.00
IF 88 2 2 100.00
CASE 103 8 8 100.00
IF 183 6 6 100.00


88 if (!rst_ni) begin -1- 89 state_q <= StDisable; ==> 90 end else begin 91 state_q <= state_d; ==>

Branches:
-1-StatusTests
1 Covered T4,T5,T6
0 Covered T4,T5,T6


103 unique case (state_q) -1- 104 105 StDisable: begin 106 if (en_i) begin -2- 107 state_d = StEnabling; ==> 108 end MISSING_ELSE ==> 109 end 110 111 StEnabling: begin 112 if (en_ref_sync) begin -3- 113 state_d = StEnable; ==> 114 end MISSING_ELSE ==> 115 end 116 117 StEnable: begin 118 cnt_en = 1'b1; 119 if (!en_i) begin -4- 120 state_d = StDisabling; ==> 121 end MISSING_ELSE ==> 122 end 123 124 StDisabling: begin 125 if (!en_ref_sync) begin -5- 126 state_d = StDisable; ==> 127 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
StDisable 1 - - - Covered T1,T2,T3
StDisable 0 - - - Covered T1,T2,T3
StEnabling - 1 - - Covered T1,T3,T34
StEnabling - 0 - - Covered T1,T2,T3
StEnable - - 1 - Covered T1,T3,T34
StEnable - - 0 - Covered T1,T3,T34
StDisabling - - - 1 Covered T1,T3,T34
StDisabling - - - 0 Covered T1,T3,T34


183 if (!rst_ni) begin -1- 184 cnt <= '0; ==> 185 cnt_ovfl <= '0; 186 end else if (!cnt_en && |cnt) begin -2- 187 cnt <= '0; ==> 188 cnt_ovfl <= '0; 189 end else if (valid_o) begin -3- 190 cnt <= '0; ==> 191 cnt_ovfl <= '0; 192 end else if (cnt_ovfl) begin -4- 193 cnt <= '{default: '1}; ==> 194 end else if (cnt_en) begin -5- 195 {cnt_ovfl, cnt} <= cnt + 1'b1; ==> 196 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
1 - - - - Covered T4,T5,T6
0 1 - - - Covered T1,T3,T34
0 0 1 - - Covered T1,T3,T34
0 0 0 1 - Covered T7,T35,T12
0 0 0 0 1 Covered T1,T3,T34
0 0 0 0 0 Covered T4,T5,T6


Assert Coverage for Instance : tb.dut.u_main_meas.u_meas
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 3 3 100.00 2 66.67
Cover properties 0 0 0
Cover sequences 0 0 0
Total 3 3 100.00 2 66.67




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
MaxWidth_A 90389067 0 0 0
RefCntVal_A 788 788 0 0
gen_timeout_assert.ClkRatios_A 788 788 0 0


MaxWidth_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 90389067 0 0 0

RefCntVal_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

gen_timeout_assert.ClkRatios_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

Line Coverage for Instance : tb.dut.u_usb_meas.u_meas
Line No.TotalCoveredPercent
TOTAL3232100.00
ALWAYS8833100.00
ALWAYS1001212100.00
CONT_ASSIGN16311100.00
ALWAYS1831313100.00
CONT_ASSIGN19911100.00
CONT_ASSIGN20011100.00
CONT_ASSIGN20111100.00

87 always_ff @(posedge clk_i or negedge rst_ni) begin 88 1/1 if (!rst_ni) begin Tests: T4 T5 T6  89 1/1 state_q <= StDisable; Tests: T4 T5 T6  90 end else begin 91 1/1 state_q <= state_d; Tests: T4 T5 T6  92 end 93 end 94 95 // The following fsm sequence ensures that even if the source 96 // side changes the enable too quickly, the measurement controls 97 // remain consistent. 98 logic cnt_en; 99 always_comb begin 100 1/1 state_d = state_q; Tests: T1 T2 T3  101 1/1 cnt_en = '0; Tests: T1 T2 T3  102 103 1/1 unique case (state_q) Tests: T1 T2 T3  104 105 StDisable: begin 106 1/1 if (en_i) begin Tests: T1 T2 T3  107 1/1 state_d = StEnabling; Tests: T1 T2 T3  108 end MISSING_ELSE 109 end 110 111 StEnabling: begin 112 1/1 if (en_ref_sync) begin Tests: T1 T2 T3  113 1/1 state_d = StEnable; Tests: T1 T3 T34  114 end MISSING_ELSE 115 end 116 117 StEnable: begin 118 1/1 cnt_en = 1'b1; Tests: T1 T3 T34  119 1/1 if (!en_i) begin Tests: T1 T3 T34  120 1/1 state_d = StDisabling; Tests: T1 T3 T34  121 end MISSING_ELSE 122 end 123 124 StDisabling: begin 125 1/1 if (!en_ref_sync) begin Tests: T1 T3 T34  126 1/1 state_d = StDisable; Tests: T1 T3 T34  127 end MISSING_ELSE 128 end 129 130 //VCS coverage off 131 // pragma coverage off 132 default:; 133 //VCS coverage on 134 // pragma coverage on 135 136 endcase // unique case (state_q) 137 end 138 139 ////////////////////////// 140 // Input Clock Logic 141 ////////////////////////// 142 143 logic valid_ref; 144 logic valid; 145 // The valid pulse causes the count to reset and start counting again 146 // for each reference cycle. 147 // The count obtained during the last reference cycle is used 148 // to measure how fast/slow the input clock is. 149 prim_pulse_sync u_sync_ref ( 150 .clk_src_i(clk_ref_i), 151 .rst_src_ni(rst_ref_ni), 152 .src_pulse_i(ref_en), 153 .clk_dst_i(clk_i), 154 .rst_dst_ni(rst_ni), 155 .dst_pulse_o(valid_ref) 156 ); 157 158 159 if (RefCnt == 1) begin : gen_degenerate_case 160 // if reference count is one, cnt_ref is always 0. 161 // So there is no need to maintain a counter, and 162 // valid just becomes valid_ref 163 1/1 assign valid = valid_ref; Tests: T1 T3 T34  164 end else begin : gen_normal_case 165 logic [RefCntWidth-1:0] cnt_ref; 166 assign valid = valid_ref & (int'(cnt_ref) == RefCnt - 1); 167 always_ff @(posedge clk_i or negedge rst_ni) begin 168 if (!rst_ni) begin 169 cnt_ref <= '0; 170 end else if (!cnt_en && |cnt_ref) begin 171 cnt_ref <= '0; 172 end else if (cnt_en && valid) begin 173 cnt_ref <= '0; 174 end else if (cnt_en && valid_ref) begin 175 cnt_ref <= cnt_ref + 1'b1; 176 end 177 end 178 end 179 180 logic cnt_ovfl; 181 logic [CntWidth-1:0] cnt; 182 always_ff @(posedge clk_i or negedge rst_ni) begin 183 1/1 if (!rst_ni) begin Tests: T4 T5 T6  184 1/1 cnt <= '0; Tests: T4 T5 T6  185 1/1 cnt_ovfl <= '0; Tests: T4 T5 T6  186 1/1 end else if (!cnt_en && |cnt) begin Tests: T4 T5 T6  187 1/1 cnt <= '0; Tests: T1 T3 T34  188 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  189 1/1 end else if (valid_o) begin Tests: T4 T5 T6  190 1/1 cnt <= '0; Tests: T1 T3 T34  191 1/1 cnt_ovfl <= '0; Tests: T1 T3 T34  192 1/1 end else if (cnt_ovfl) begin Tests: T4 T5 T6  193 1/1 cnt <= '{default: '1}; Tests: T3 T8 T10  194 1/1 end else if (cnt_en) begin Tests: T4 T5 T6  195 1/1 {cnt_ovfl, cnt} <= cnt + 1'b1; Tests: T1 T3 T34  196 end MISSING_ELSE 197 end 198 199 1/1 assign valid_o = valid & |cnt; Tests: T1 T3 T34  200 1/1 assign fast_o = valid_o & ((cnt > max_cnt) | cnt_ovfl); Tests: T1 T2 T3  201 1/1 assign slow_o = valid_o & (cnt < min_cnt); Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.u_usb_meas.u_meas
TotalCoveredPercent
Conditions1515100.00
Logical1515100.00
Non-Logical00
Event00

 LINE       186
 EXPRESSION (((!cnt_en)) && ((|cnt)))
             -----1-----    ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT4,T5,T6
11CoveredT1,T3,T34

 LINE       199
 EXPRESSION (valid & ((|cnt)))
             --1--   ----2---
-1--2-StatusTests
01CoveredT1,T3,T34
10CoveredT1,T3,T34
11CoveredT1,T3,T34

 LINE       200
 EXPRESSION (valid_o & ((cnt > max_cnt) | cnt_ovfl))
             ---1---   --------------2-------------
-1--2-StatusTests
01CoveredT3,T34,T8
10CoveredT1,T3,T34
11CoveredT3,T34,T8

 LINE       200
 SUB-EXPRESSION ((cnt > max_cnt) | cnt_ovfl)
                 -------1-------   ----2---
-1--2-StatusTests
00CoveredT4,T5,T6
01CoveredT3,T8,T10
10CoveredT3,T34,T8

 LINE       201
 EXPRESSION (valid_o & (cnt < min_cnt))
             ---1---   -------2-------
-1--2-StatusTests
01CoveredT4,T5,T6
10CoveredT1,T3,T34
11CoveredT7,T11,T35

FSM Coverage for Instance : tb.dut.u_usb_meas.u_meas
Summary for FSM :: state_q
TotalCoveredPercent
States 4 4 100.00 (Not included in score)
Transitions 4 4 100.00
Sequences 0 0

State, Transition and Sequence Details for FSM :: state_q
statesLine No.CoveredTests
StDisable 126 Covered T4,T5,T6
StDisabling 120 Covered T1,T3,T34
StEnable 113 Covered T1,T3,T34
StEnabling 107 Covered T1,T2,T3


transitionsLine No.CoveredTests
StDisable->StEnabling 107 Covered T1,T2,T3
StDisabling->StDisable 126 Covered T1,T3,T34
StEnable->StDisabling 120 Covered T1,T3,T34
StEnabling->StEnable 113 Covered T1,T3,T34



Branch Coverage for Instance : tb.dut.u_usb_meas.u_meas
Line No.TotalCoveredPercent
Branches 16 16 100.00
IF 88 2 2 100.00
CASE 103 8 8 100.00
IF 183 6 6 100.00


88 if (!rst_ni) begin -1- 89 state_q <= StDisable; ==> 90 end else begin 91 state_q <= state_d; ==>

Branches:
-1-StatusTests
1 Covered T4,T5,T6
0 Covered T4,T5,T6


103 unique case (state_q) -1- 104 105 StDisable: begin 106 if (en_i) begin -2- 107 state_d = StEnabling; ==> 108 end MISSING_ELSE ==> 109 end 110 111 StEnabling: begin 112 if (en_ref_sync) begin -3- 113 state_d = StEnable; ==> 114 end MISSING_ELSE ==> 115 end 116 117 StEnable: begin 118 cnt_en = 1'b1; 119 if (!en_i) begin -4- 120 state_d = StDisabling; ==> 121 end MISSING_ELSE ==> 122 end 123 124 StDisabling: begin 125 if (!en_ref_sync) begin -5- 126 state_d = StDisable; ==> 127 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
StDisable 1 - - - Covered T1,T2,T3
StDisable 0 - - - Covered T1,T2,T3
StEnabling - 1 - - Covered T1,T3,T34
StEnabling - 0 - - Covered T1,T2,T3
StEnable - - 1 - Covered T1,T3,T34
StEnable - - 0 - Covered T1,T3,T34
StDisabling - - - 1 Covered T1,T3,T34
StDisabling - - - 0 Covered T1,T3,T34


183 if (!rst_ni) begin -1- 184 cnt <= '0; ==> 185 cnt_ovfl <= '0; 186 end else if (!cnt_en && |cnt) begin -2- 187 cnt <= '0; ==> 188 cnt_ovfl <= '0; 189 end else if (valid_o) begin -3- 190 cnt <= '0; ==> 191 cnt_ovfl <= '0; 192 end else if (cnt_ovfl) begin -4- 193 cnt <= '{default: '1}; ==> 194 end else if (cnt_en) begin -5- 195 {cnt_ovfl, cnt} <= cnt + 1'b1; ==> 196 end MISSING_ELSE ==>

Branches:
-1--2--3--4--5-StatusTests
1 - - - - Covered T4,T5,T6
0 1 - - - Covered T1,T3,T34
0 0 1 - - Covered T1,T3,T34
0 0 0 1 - Covered T3,T8,T10
0 0 0 0 1 Covered T1,T3,T34
0 0 0 0 0 Covered T4,T5,T6


Assert Coverage for Instance : tb.dut.u_usb_meas.u_meas
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 3 3 100.00 2 66.67
Cover properties 0 0 0
Cover sequences 0 0 0
Total 3 3 100.00 2 66.67




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
MaxWidth_A 43415291 0 0 0
RefCntVal_A 788 788 0 0
gen_timeout_assert.ClkRatios_A 788 788 0 0


MaxWidth_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 43415291 0 0 0

RefCntVal_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

gen_timeout_assert.ClkRatios_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 788 788 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T27 1 1 0 0
T28 1 1 0 0
T29 1 1 0 0
T30 1 1 0 0
T31 1 1 0 0
T32 1 1 0 0
T33 1 1 0 0

0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%