Skip to content

Commit 6aa7b78

Browse files
robertszczepanskitmichalak
authored andcommitted
Add covergroup for FSM state transition and bus events
1 parent dfa2bde commit 6aa7b78

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/ctrl/i3c_target_fsm.sv

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ module i3c_target_fsm #(
661661
assign event_target_nack_o = !nack_transaction_q && nack_transaction_d;
662662

663663
`ifndef SYNTHESIS
664+
`ifndef VERILATOR
664665
property cover_known_addr_ack;
665666
@(posedge clk_i)
666667
(
@@ -684,5 +685,32 @@ module i3c_target_fsm #(
684685
covprop_unknown_addr_nack: cover property (cover_unknown_addr_nack);
685686

686687
covprop_valid_addr: cover property (@(posedge clk_i) ($rose(bus_addr_valid)));
688+
689+
covergroup cg_bus_event_fsm_transitions @(posedge clk_i);
690+
FsmState: coverpoint state_q {
691+
bins valid_start_trans =
692+
(Idle => RxFByte);
693+
bins valid_rstart_trans =
694+
(RxPWriteData, TxPReadData, TxPReadTbit, Wait => RxFByte),
695+
(RxSByte => RxSByteRepeated);
696+
bins valid_stop_trans =
697+
(RxFByte, CheckFByte, TxAckFByte, RxSByte, RxSByteRepeated, CheckSByte, TxAckSByte,
698+
RxPWriteData, RxPWriteTbit, TxPReadData, TxPReadTbit, Wait, DoIBI, DoneIBI, DoCCC,
699+
DoneCCC, DoHotJoin, DoRstAction, DoHdrExit => Idle);
700+
}
701+
BusStartEvent: coverpoint bus_start_det_i {
702+
bins start_detected = {1'b1};
703+
}
704+
BusRStartEvent: coverpoint bus_rstart_det_i {
705+
bins rstart_detected = {1'b1};
706+
}
707+
BusStopEvent: coverpoint bus_stop_det_i {
708+
bins stop_detected = {1'b1};
709+
}
710+
711+
endgroup : cg_bus_event_fsm_transitions
712+
713+
cg_bus_event_fsm_transitions cg_bus_event_fsm_trans = new();
714+
`endif
687715
`endif
688716
endmodule : i3c_target_fsm

0 commit comments

Comments
 (0)