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

Module : spid_addr_4b
SCORELINECONDTOGGLEFSMBRANCHASSERT
100.00 100.00 100.00 100.00

Source File(s) :
/workspaces/repo/scratch/os_regression_2024_10_14/spi_device_1r1w-sim-vcs/default/sim-vcs/../src/lowrisc_ip_spi_device_0.1/rtl/spid_addr_4b.sv

Module self-instances :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
tb.dut.u_spid_addr_4b 100.00 100.00 100.00 100.00



Module Instance : tb.dut.u_spid_addr_4b

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
100.00 100.00 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
91.90 97.59 100.00 95.00 75.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
95.10 95.20 93.48 97.84 93.55 95.45 dut


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_spi2sys_sync 100.00 100.00 100.00
u_sys2spi_sync 90.23 95.92 100.00 90.00 75.00


Since this is the module's only instance, the coverage report is the same as for the module.
Line Coverage for Module : spid_addr_4b
Line No.TotalCoveredPercent
TOTAL2828100.00
ALWAYS5366100.00
ALWAYS6344100.00
CONT_ASSIGN9211100.00
CONT_ASSIGN9311100.00
ALWAYS11233100.00
ALWAYS12477100.00
ALWAYS13944100.00
CONT_ASSIGN14611100.00
CONT_ASSIGN14711100.00

52 always_ff @(posedge sys_clk_i or negedge sys_rst_ni) begin 53 1/1 if (!sys_rst_ni) begin Tests: T1 T2 T3  54 1/1 sys_fw_new_addr_mode_req <= 1'b0; Tests: T1 T2 T3  55 1/1 end else if (reg2hw_addr_mode_addr_4b_en_qe_i) begin Tests: T1 T2 T3  56 1/1 sys_fw_new_addr_mode_req <= 1'b1; Tests: T4 T7 T8  57 1/1 end else if (sys_fw_new_addr_mode_ack) begin Tests: T1 T2 T3  58 1/1 sys_fw_new_addr_mode_req <= 1'b0; Tests: T4 T7 T8  59 end MISSING_ELSE 60 end 61 62 always_ff @(posedge sys_clk_i or negedge sys_rst_ni) begin 63 1/1 if (!sys_rst_ni) begin Tests: T1 T2 T3  64 1/1 sys_fw_new_addr_mode_data <= 1'b0; Tests: T1 T2 T3  65 1/1 end else if (reg2hw_addr_mode_addr_4b_en_qe_i) begin Tests: T1 T2 T3  66 1/1 sys_fw_new_addr_mode_data <= reg2hw_addr_mode_addr_4b_en_q_i; Tests: T4 T7 T8  67 end MISSING_ELSE 68 end 69 70 // SYS-originated address mode changes must only occur while SPI is inactive. 71 // The SPI flash protocol and hardware view would be violated otherwise. 72 // Thus, the data will always be stable by the time the SPI domain picks it up. 73 prim_sync_reqack_data #( 74 .Width (1) 75 ) u_sys2spi_sync ( 76 .clk_src_i (sys_clk_i), 77 .rst_src_ni (sys_rst_ni), 78 .clk_dst_i (spi_clk_i), 79 .rst_dst_ni (sys_rst_ni), 80 81 .req_chk_i (1'b1), 82 83 .src_req_i (sys_fw_new_addr_mode_req), 84 .src_ack_o (sys_fw_new_addr_mode_ack), 85 .dst_req_o (spi_fw_new_addr_mode_req), 86 .dst_ack_i (spi_fw_new_addr_mode_ack), 87 88 .data_i (sys_fw_new_addr_mode_data), 89 .data_o (spi_fw_new_addr_mode_data) 90 ); 91 92 1/1 assign spi_fw_new_addr_mode_ack = spi_fw_new_addr_mode_req & cmd_sync_pulse_i; Tests: T1 T2 T3  93 1/1 assign hw2reg_addr_mode_pending_d_o = sys_fw_new_addr_mode_req; Tests: T1 T2 T3  94 95 //////////////// 96 // SPI -> SYS // 97 //////////////// 98 // The SPI domain is the source of truth, so keep the SYS domain updated 99 // when a firmware change isn't pending. 100 logic sys_cfg_addr_4b_en; 101 102 prim_flop_2sync #( 103 .Width (1) 104 ) u_spi2sys_sync ( 105 .clk_i (sys_clk_i), 106 .rst_ni (sys_rst_ni), 107 .d_i (spi_cfg_addr_4b_en_o), 108 .q_o (sys_cfg_addr_4b_en) 109 ); 110 111 always_comb begin 112 1/1 if (sys_fw_new_addr_mode_req) begin Tests: T1 T2 T3  113 1/1 hw2reg_addr_mode_addr_4b_en_d_o = sys_fw_new_addr_mode_data; Tests: T4 T7 T8  114 end else begin 115 1/1 hw2reg_addr_mode_addr_4b_en_d_o = sys_cfg_addr_4b_en; Tests: T1 T2 T3  116 end 117 end 118 119 //////////////// 120 // SPI domain // 121 //////////////// 122 logic spi_cfg_addr_4b_en_d, spi_cfg_addr_4b_en_q; 123 always_comb begin 124 1/1 spi_cfg_addr_4b_en_d = spi_cfg_addr_4b_en_q; Tests: T1 T2 T3  125 126 1/1 if (spi_addr_4b_set_i) begin Tests: T1 T2 T3  127 // This event occurs when EN4B command is received 128 1/1 spi_cfg_addr_4b_en_d = 1'b 1; Tests: T21 T43 T48  129 1/1 end else if (spi_addr_4b_clr_i) begin Tests: T1 T2 T3  130 // EX4B command raises the clear event 131 1/1 spi_cfg_addr_4b_en_d = 1'b 0; Tests: T19 T21 T43  132 1/1 end else if (spi_fw_new_addr_mode_req) begin Tests: T1 T2 T3  133 // Update 134 1/1 spi_cfg_addr_4b_en_d = spi_fw_new_addr_mode_data; Tests: T4 T7 T8  135 end MISSING_ELSE 136 end 137 138 always_ff @(posedge spi_clk_i or negedge sys_rst_ni) begin 139 1/1 if (!sys_rst_ni) begin Tests: T1 T2 T3  140 1/1 spi_cfg_addr_4b_en_q <= 1'b 0; Tests: T1 T2 T3  141 1/1 end else if (cmd_sync_pulse_i) begin Tests: T3 T4 T5  142 1/1 spi_cfg_addr_4b_en_q <= spi_cfg_addr_4b_en_d; Tests: T4 T7 T8  143 end MISSING_ELSE 144 end 145 146 1/1 assign spi_cfg_addr_4b_en_o = spi_cfg_addr_4b_en_q; Tests: T1 T2 T3  147 1/1 assign cmd_sync_cfg_addr_4b_en_o = spi_cfg_addr_4b_en_d; Tests: T1 T2 T3 

Cond Coverage for Module : spid_addr_4b
TotalCoveredPercent
Conditions33100.00
Logical33100.00
Non-Logical00
Event00

 LINE       92
 EXPRESSION (spi_fw_new_addr_mode_req & cmd_sync_pulse_i)
             ------------1-----------   --------2-------
-1--2-StatusTests
01CoveredT4,T7,T8
10CoveredT4,T7,T8
11CoveredT4,T7,T8

Branch Coverage for Module : spid_addr_4b
Line No.TotalCoveredPercent
Branches 16 16 100.00
IF 53 4 4 100.00
IF 63 3 3 100.00
IF 112 2 2 100.00
IF 126 4 4 100.00
IF 139 3 3 100.00


53 if (!sys_rst_ni) begin -1- 54 sys_fw_new_addr_mode_req <= 1'b0; ==> 55 end else if (reg2hw_addr_mode_addr_4b_en_qe_i) begin -2- 56 sys_fw_new_addr_mode_req <= 1'b1; ==> 57 end else if (sys_fw_new_addr_mode_ack) begin -3- 58 sys_fw_new_addr_mode_req <= 1'b0; ==> 59 end MISSING_ELSE ==>

Branches:
-1--2--3-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T4,T7,T8
0 0 1 Covered T4,T7,T8
0 0 0 Covered T1,T2,T3


63 if (!sys_rst_ni) begin -1- 64 sys_fw_new_addr_mode_data <= 1'b0; ==> 65 end else if (reg2hw_addr_mode_addr_4b_en_qe_i) begin -2- 66 sys_fw_new_addr_mode_data <= reg2hw_addr_mode_addr_4b_en_q_i; ==> 67 end MISSING_ELSE ==>

Branches:
-1--2-StatusTests
1 - Covered T1,T2,T3
0 1 Covered T4,T7,T8
0 0 Covered T1,T2,T3


112 if (sys_fw_new_addr_mode_req) begin -1- 113 hw2reg_addr_mode_addr_4b_en_d_o = sys_fw_new_addr_mode_data; ==> 114 end else begin 115 hw2reg_addr_mode_addr_4b_en_d_o = sys_cfg_addr_4b_en; ==>

Branches:
-1-StatusTests
1 Covered T4,T7,T8
0 Covered T1,T2,T3


126 if (spi_addr_4b_set_i) begin -1- 127 // This event occurs when EN4B command is received 128 spi_cfg_addr_4b_en_d = 1'b 1; ==> 129 end else if (spi_addr_4b_clr_i) begin -2- 130 // EX4B command raises the clear event 131 spi_cfg_addr_4b_en_d = 1'b 0; ==> 132 end else if (spi_fw_new_addr_mode_req) begin -3- 133 // Update 134 spi_cfg_addr_4b_en_d = spi_fw_new_addr_mode_data; ==> 135 end MISSING_ELSE ==>

Branches:
-1--2--3-StatusTests
1 - - Covered T21,T43,T48
0 1 - Covered T19,T21,T43
0 0 1 Covered T4,T7,T8
0 0 0 Covered T1,T2,T3


139 if (!sys_rst_ni) begin -1- 140 spi_cfg_addr_4b_en_q <= 1'b 0; ==> 141 end else if (cmd_sync_pulse_i) begin -2- 142 spi_cfg_addr_4b_en_q <= spi_cfg_addr_4b_en_d; ==> 143 end MISSING_ELSE ==>

Branches:
-1--2-StatusTests
1 - Covered T1,T2,T3
0 1 Covered T4,T7,T8
0 0 Covered T3,T4,T5

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