File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
testbenches/ip/spi_engine/tests Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -181,8 +181,10 @@ program test_lanes (
181181 # 100ns ;
182182
183183 fifo_spi_test ();
184- sdi_lane_mask = 8'h1 ;
185- sdo_lane_mask = 8'h1 ;
184+ sdi_lane_mask = { `NUM_OF_SDI { 1'b1 }} ;
185+ sdo_lane_mask = { `NUM_OF_SDO { 1'b1 }} ;
186+ num_of_active_sdi_lanes = $countones (sdi_lane_mask);
187+ num_of_active_sdo_lanes = $countones (sdo_lane_mask);
186188 spi_api.fifo_command (`SET_SDI_LANE_MASK (sdi_lane_mask));// guarantee all SDI lanes must be active
187189 spi_api.fifo_command (`SET_SDO_LANE_MASK (sdo_lane_mask));// guarantee all SDO lanes must be active
188190
@@ -389,6 +391,7 @@ program test_lanes (
389391
390392 for (int i = 0 , k = 0 ; i < ((`NUM_OF_TRANSFERS )* (`NUM_OF_WORDS )* (`NUM_OF_SDI )); i++ ) begin
391393 if (sdi_lane_mask[i% (`NUM_OF_SDI )]) begin
394+ sdi_read_data[k] = base_env.ddr.agent.mem_model.backdoor_memory_read_4byte (xil_axi_uint ' (`DDR_BA + 4 * i));
392395 if (sdi_read_data[k] != sdi_read_data_store[k]) begin // one word at a time comparison
393396 `INFO ((" sdi_read_data[%d ]: %x ; sdi_read_data_store[%d ]: %x " ,
394397 k, sdi_read_data[k],
Original file line number Diff line number Diff line change @@ -431,12 +431,12 @@ program test_program (
431431 // Generate a FIFO transaction, write SDO first
432432 for (int i = 0 ; i < (`NUM_OF_WORDS ); i++ ) begin
433433 for (int j = 0 ; j < (`NUM_OF_SDI ); j++ ) begin
434- rx_data[j] = sdo_lane_mask[j] ? { $urandom } : `SDO_IDLE_STATE ;
434+ rx_data[j] = sdo_lane_mask[j] ? $urandom : `SDO_IDLE_STATE ;
435435 sdi_fifo_data_store[i * (`NUM_OF_SDI ) + j] = rx_data[j];
436436 end
437437
438438 for (int j = 0 ; j < num_of_active_sdo_lanes; j++ ) begin
439- tx_data[j] = { $urandom } ;
439+ tx_data[j] = $urandom ;
440440 tx_data_cast[j] = tx_data[j]; // a cast is necessary for the SPI API
441441 end
442442
You can’t perform that action at this time.
0 commit comments