Skip to content

Commit 8170cf5

Browse files
committed
[tlul,rtl] Explicitly zero some integrity bits from tlul_adapter_reg
The existing behaviour of the tlul_rsp_intg_gen was to add rsp/data integrity bits if their generation was enabled and pass through the input integrity bits if not. In some instantiations (in tlul_adapter_reg and tlul_adapter_dmi), these bits are actually always zero. One consequence is missing coverage in DV simulations. The problem is that e.g. the rsp_intg signal is driven with a continuous assignment: assign rsp_intg = tl_i.d_user.rsp_intg; But the right hand side is zero, so constant and the assignment is not marked as covered. This commit adds a UserInIsZero parameter. If this is true then we know the input d_user signal is zero and thus can wire the variable directly to zero. This removes the cover point but will not change RTL behaviour at all. Signed-off-by: Rupert Swarbrick <[email protected]>
1 parent 7843a57 commit 8170cf5

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

hw/ip/tlul/rtl/tlul_adapter_dmi.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ module tlul_adapter_dmi
115115
// outgoing integrity generation
116116
tlul_rsp_intg_gen #(
117117
.EnableRspIntgGen(EnableRspIntgGen),
118-
.EnableDataIntgGen(EnableDataIntgGen)
118+
.EnableDataIntgGen(EnableDataIntgGen),
119+
.UserInIsZero(1'b1)
119120
) u_rsp_intg_gen (
120121
.tl_i(tl_d2h_o_pre),
121122
.tl_o(tl_d2h_o)

hw/ip/tlul/rtl/tlul_adapter_reg.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ module tlul_adapter_reg
166166
// outgoing integrity generation
167167
tlul_rsp_intg_gen #(
168168
.EnableRspIntgGen(EnableRspIntgGen),
169-
.EnableDataIntgGen(EnableDataIntgGen)
169+
.EnableDataIntgGen(EnableDataIntgGen),
170+
.UserInIsZero(1'b1)
170171
) u_rsp_intg_gen (
171172
.tl_i(tl_o_pre),
172173
.tl_o(tl_o)

hw/ip/tlul/rtl/tlul_rsp_intg_gen.sv

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,27 @@
44

55
`include "prim_assert.sv"
66

7-
/**
8-
* Tile-Link UL response integrity generator
9-
*/
7+
/*
8+
9+
Tile-Link UL response integrity generator
10+
11+
This generates integrity bits that get stored in the rsp_intg and data_intg fields of tl_o.d_user.
12+
13+
If EnableRspIntgGen is true then the rsp_intg field is generated from the opcode, d_size and
14+
d_error fields of the response (extracted with tlul_pkg::extract_d2h_rsp_intg). If it is false then
15+
the rsp_intg field either comes from the same field in the tl_i input (if UserInIsZero is false) or
16+
is wired to zero (if UserInIsZero is true).
17+
18+
If EnableDataIntgGen is true then the data_intg field is generated from the d_data field of the
19+
response. If it is false then the rsp_intg field either comes from the same field in the tl_i input
20+
(if UserInIsZero is false) or is wired to zero (if UserInIsZero is true).
21+
22+
*/
1023

1124
module tlul_rsp_intg_gen import tlul_pkg::*; #(
1225
parameter bit EnableRspIntgGen = 1'b1,
13-
parameter bit EnableDataIntgGen = 1'b1
26+
parameter bit EnableDataIntgGen = 1'b1,
27+
parameter bit UserInIsZero = 1'b0
1428
) (
1529
// TL-UL interface
1630
input tl_d2h_t tl_i,
@@ -28,6 +42,8 @@ module tlul_rsp_intg_gen import tlul_pkg::*; #(
2842
.data_i(D2HRspMaxWidth'(rsp)),
2943
.data_o({rsp_intg, unused_payload})
3044
);
45+
end else if (UserInIsZero) begin : gen_zero_rsp_intg
46+
assign rsp_intg = 0;
3147
end else begin : gen_passthrough_rsp_intg
3248
assign rsp_intg = tl_i.d_user.rsp_intg;
3349
end
@@ -39,6 +55,8 @@ module tlul_rsp_intg_gen import tlul_pkg::*; #(
3955
.data_i(DataMaxWidth'(tl_i.d_data)),
4056
.data_intg_o({data_intg, unused_data})
4157
);
58+
end else if (UserInIsZero) begin : gen_zero_data_intg
59+
assign data_intg = 0;
4260
end else begin : gen_passthrough_data_intg
4361
assign data_intg = tl_i.d_user.data_intg;
4462
end

0 commit comments

Comments
 (0)