Skip to content

Commit bbc658e

Browse files
KinzaQamarrswarbrick
authored andcommitted
[rom_ctrl, dv] Removal of a signal to cover cond coverage hole
rom_ctrl coverage report shows a coverage hole for the conditional statement as 110 not covered. The description below explains why we can't cover the case counter_lnt and !kmac_rom_vld_o Starting with counter_lnt = 1 means that we get the last address of a non top word. counter_lnt is delayed by a cycle through last_nontop_d in rom_ctrl_counter.sv. Next is kmac_rom_vld_o which also delayed by a cycle through kmac_rom_vld_d. The kmac_rom_vld_d signal depends on counter_read_req which goes immediately high after reset. Then checker fsm state should be in state ReadingLow and !counter_lnt meaning we haven't reached to the top. Now assuming that we are out of reset, first request to the ROM has been sent, checker fsm is sending nontop data to KMAC and we still haven't reached to the top; makes kmac_rom_vld_d go high. But when we reach to the last address of the nontop data, we get counter_lnt go high and kmac_rom_vld_d go low. Since kmac_rom_vld_o delayed through kmac_rom_vld_d, we get counter_lnt with kmac_rom_vld_o. Signed-off-by: Kinza Qamar <kqzaman@lowrisc.org>
1 parent a772741 commit bbc658e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hw/ip/rom_ctrl/rtl/rom_ctrl_fsm.sv

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ module rom_ctrl_fsm
145145
ReadingLow: begin
146146
// Switch to ReadingHigh when counter_lnt is true and kmac_rom_rdy_i & kmac_rom_vld_o
147147
// (implying that the transaction went through)
148-
if (counter_lnt && kmac_rom_rdy_i && kmac_rom_vld_o) begin
148+
//
149+
// If counter_lnt is true then we requested the last non-top word from the ROM on the last
150+
// cycle and the response will be available now. This gets taken if kmac_rom_rdy_i.
151+
if (counter_lnt && kmac_rom_rdy_i) begin
149152
state_d = ReadingHigh;
150153
end
151154
end
@@ -311,4 +314,6 @@ module rom_ctrl_fsm
311314

312315
assign alert_o = fsm_alert | checker_alert | unexpected_counter_change;
313316

317+
`ASSERT(CounterLntImpliesKmacRomVldO_A, counter_lnt -> kmac_rom_vld_o)
318+
314319
endmodule

0 commit comments

Comments
 (0)