Skip to content

Commit 8085ffe

Browse files
committed
[dv/push_pull] Make sure that ack_o is always reset
This commit ensures that the ack_o signal is de-asserted when the interface is reset under all conditions. A similar condition already exists for the valid/ready mode of the interface. Signed-off-by: Florian Glaser <[email protected]>
1 parent 1f7db17 commit 8085ffe

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

hw/dv/sv/push_pull_agent/push_pull_driver_lib.sv

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ class push_host_driver #(
133133
`CB.valid_int <= 1'b0;
134134
if (!cfg.hold_h_data_until_next_req) `CB.h_data_int <= 'x;,
135135
wait (cfg.in_reset);)
136-
// In case there is race condition between the logic above and reset_signals task.
137-
// We always set the valid_int again to 0 to make sure the data comes out of reset is not
138-
// valid.
139-
if (cfg.in_reset) `CB.valid_int <= '0;
136+
// In case there is a race condition between the logic above and the reset_signals task, we make
137+
// sure that the reset also de-asserts the valid signal. It can otherwise get stuck high during
138+
// reset and erroneously flag data as valid upon exiting reset.
139+
if (cfg.in_reset) `CB.valid_int <= 1'b0;
140140
endtask
141141

142142
`undef CB
@@ -179,6 +179,10 @@ class pull_host_driver #(
179179
end
180180
if (!cfg.hold_h_data_until_next_req) `CB.h_data_int <= 'x;,
181181
wait (cfg.in_reset);)
182+
// In case there is a race condition between the logic above and the reset_signals task, we make
183+
// sure that the reset also de-asserts the request signal. It can otherwise get stuck high
184+
// during reset and emit an erroneous request upon exiting reset.
185+
if (cfg.in_reset) `CB.req_int <= 1'b0;
182186
endtask
183187

184188
`undef CB
@@ -216,6 +220,10 @@ class push_device_driver #(
216220
`CB.ready_int <= 1'b0;
217221
if (!cfg.hold_d_data_until_next_req) `CB.d_data_int <= 'x;,
218222
wait (cfg.in_reset);)
223+
// In case there is a race condition between the logic above and the reset_signals task, we make
224+
// sure that the reset also de-asserts the ready signal. It can otherwise get stuck high during
225+
// reset and erroneously accept data upon exiting reset.
226+
if (cfg.in_reset) `CB.ready_int <= 1'b0;
219227
endtask
220228

221229
`undef CB
@@ -258,6 +266,10 @@ class pull_device_driver #(
258266
`CB.ack_int <= 1'b0;
259267
if (!cfg.hold_d_data_until_next_req) `CB.d_data_int <= 'x;,
260268
wait (cfg.in_reset);)
269+
// In case there is a race condition between the logic above and the reset_signals task, we make
270+
// sure that the reset also de-asserts the acknowledge signal. It can otherwise get stuck high
271+
// during reset and emit an erroneous acknowledge upon exiting reset.
272+
if (cfg.in_reset) `CB.ack_int <= 1'b0;
261273
endtask
262274

263275
`undef CB

0 commit comments

Comments
 (0)