Skip to content

Commit 8b5de1e

Browse files
author
ondrej.ille
committed
test: Fixes from regression in rx_err_log_* tests.
1 parent 0fe2626 commit 8b5de1e

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

test/main_tb/feature_tests/rx_err_log_2_ftest.vhd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ package body rx_err_log_2_ftest is
164164
CAN_wait_pc_state(pc_deb_crc_delim, DUT_NODE, chn);
165165
wait for 20 ns;
166166
flip_bus_level(chn);
167-
CAN_wait_sample_point(DUT_NODE, chn);
167+
CAN_wait_sample_point(DUT_NODE, chn, false);
168168
wait for 20 ns;
169169
release_bus_level(chn);
170170

@@ -188,7 +188,11 @@ package body rx_err_log_2_ftest is
188188
check_m(err_frame.erf = '1', "FRAME_FORMAT_W[ERF] = 1");
189189
check_m(err_frame.ivld = '1', "FRAME_FORMAT_W[IVLD] = 1");
190190
check_m(err_frame.erf_pos = ERC_POS_ACK, "FRAME_FORMAT_W[ERF_POS] = ERC_POS_ACK");
191-
check_m(err_frame.erf_type = ERC_FRM_ERR, "FRAME_FORMAT_W[ERF_TYPE] = ERC_FRM_ERR");
191+
192+
-- When we manage to flip just the stuff bit due to randomization, it will be stuff error
193+
-- not from error!
194+
check_m(err_frame.erf_type = ERC_FRM_ERR or err_frame.erf_type = ERC_STUF_ERR,
195+
"FRAME_FORMAT_W[ERF_TYPE] = ERC_FRM_ERR or FRAME_FORMAT_W[ERF_TYPE] = ERC_STUF_ERR");
192196

193197
CAN_wait_bus_idle(DUT_NODE, chn);
194198

test/main_tb/feature_tests/rx_err_log_3_ftest.vhd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ package body rx_err_log_3_ftest is
174174

175175
flip_bus_level(chn);
176176

177-
CAN_wait_sample_point(DUT_NODE, chn);
177+
CAN_wait_sample_point(DUT_NODE, chn, false);
178178
wait for 20 ns;
179179

180180
release_bus_level(chn);
@@ -319,7 +319,7 @@ package body rx_err_log_3_ftest is
319319
wait for 20 ns;
320320
flip_bus_level(chn);
321321

322-
CAN_wait_sample_point(DUT_NODE, chn);
322+
CAN_wait_sample_point(DUT_NODE, chn, false);
323323
wait for 20 ns;
324324

325325
release_bus_level(chn);

test/main_tb/feature_tests/rx_err_log_6_ftest.vhd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ package body rx_err_log_6_ftest is
174174

175175
CAN_wait_sync_seg(DUT_NODE, chn);
176176
flip_bus_level(chn);
177-
CAN_wait_sample_point(DUT_NODE, chn);
177+
CAN_wait_sample_point(DUT_NODE, chn, false);
178178
wait for 20 ns;
179179
release_bus_level(chn);
180180

test/main_tb/feature_tests/rx_err_log_7_ftest.vhd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ package body rx_err_log_7_ftest is
162162
CAN_generate_frame(tx_frame_2);
163163
tx_frame_2.rtr := NO_RTR_FRAME;
164164
tx_frame_2.data_length := 8;
165+
-- To avoid SSP. If error is detected in SSP, DUT Node does not react immediately, but
166+
-- delays until next regular sample point!
167+
tx_frame_2.brs := BR_NO_SHIFT;
165168
decode_length(tx_frame_2.data_length, tx_frame_2.dlc);
166169

167170
CAN_send_frame(tx_frame_2, 1, DUT_NODE, chn, frame_sent);
@@ -175,7 +178,7 @@ package body rx_err_log_7_ftest is
175178

176179
CAN_wait_sync_seg(DUT_NODE, chn);
177180
flip_bus_level(chn);
178-
CAN_wait_sample_point(DUT_NODE, chn);
181+
CAN_wait_sample_point(DUT_NODE, chn, false);
179182
wait for 20 ns;
180183
release_bus_level(chn);
181184

0 commit comments

Comments
 (0)