diff --git a/tb/shinTest/ShinTopSpiTb.v b/tb/shinTest/ShinTopSpiTb.v index 451d2cc..5eebe58 100644 --- a/tb/shinTest/ShinTopSpiTb.v +++ b/tb/shinTest/ShinTopSpiTb.v @@ -523,8 +523,9 @@ always @(posedge clock) begin end end - -wire isQspi = (idx >= 0 && idx <= 4) || idx >= 10; +//DEV_NUM +//ALL_DEV_NUM +wire isQspi = (idx >= 0 && idx <= (`ALL_DEV_NUM - 1)) || idx >= (`ALL_DEV_NUM * 2); wire [11:0] nextByteCnt = byteCnt + 1; //输出 @@ -594,7 +595,7 @@ task spi_trans( input [15:0] saddress, input [7:0] scmd, input [12:0] slength,in begin //$fwrite(spidata_file, "------------%5t------------\n", $realtime); $fwrite(spidata_file, "T:%t \tdev:%4d, addr:0x%02h%02h, %s, len:%4d\n", - $realtime, ((sidx >= 5)? ((sidx >= 10)? (sidx - 10):(sidx - 5)):sidx), txBuf[0], txBuf[1], + $realtime, ((sidx >= `ALL_DEV_NUM)? ((sidx >= (`ALL_DEV_NUM * 2))? (sidx - (`ALL_DEV_NUM * 2)):(sidx - `ALL_DEV_NUM)):sidx), txBuf[0], txBuf[1], ((txBuf[2] == 0)? "Write":" Read"), slength); if ( ((saddress == 16'h0800) @@ -605,7 +606,7 @@ task spi_trans( input [15:0] saddress, input [7:0] scmd, input [12:0] slength,in || (saddress == 16'h3000) || (saddress == 16'h3800) || (saddress == 16'h4000)) - && ((sidx == 0) || (sidx == 5) || (sidx == 10))) begin + && ((sidx == 0) || (sidx == `ALL_DEV_NUM) || (sidx == (`ALL_DEV_NUM * 2)))) begin _pos = 3; for (integer _k = 0; _k < 4; _k++) begin if (scmd == 0) begin @@ -771,8 +772,8 @@ end `define INTERFACE_IDX 0 //internal spi `define IF_IDX(idx) ((`INTERFACE_IDX)+(idx)) `define IF_IQSPI(idx) ((idx)) -`define IF_OQSPI(idx) ((10) + (idx)) -`define IF_OSPI(idx) ((5) + (idx)) +`define IF_OQSPI(idx) ((`ALL_DEV_NUM * 2) + (idx)) +`define IF_OSPI(idx) ((`ALL_DEV_NUM) + (idx)) `define SPI_WRITE 8'h0 `define SPI_READ 8'h1 @@ -944,7 +945,7 @@ initial begin `endif begin:SETTING_INTERFACE - if ((`INTERFACE_IDX) == 5) begin + if ((`INTERFACE_IDX) == `ALL_DEV_NUM) begin $fdisplay(spidata_file, "\n\n从内部QSPI配置使用外部的SPI接口访问EasyBus"); txBuf[0+3] = 8'h01; spi_trans( (16'h09), (`SPI_WRITE), (1), (`IF_OSPI(0)) ); @@ -952,7 +953,7 @@ initial begin spi_trans( (16'h09), (`SPI_WRITE), (1), (`IF_OSPI(2)) ); spi_trans( (16'h09), (`SPI_WRITE), (1), (`IF_OSPI(3)) ); spi_trans( (16'h09), (`SPI_WRITE), (1), (`IF_OSPI(4)) ); - end else if ((`INTERFACE_IDX) == 10) begin + end else if ((`INTERFACE_IDX) == (`ALL_DEV_NUM * 2)) begin $fdisplay(spidata_file, "\n\n从内部QSPI配置使用外部的QSPI接口访问EasyBus"); txBuf[0+3] = 8'h02; spi_trans( (16'h09), (`SPI_WRITE), (1), (`IF_OSPI(0)) ); diff --git a/tb/shinTest/gen_pkt.py b/tb/shinTest/gen_pkt.py index 37f91dd..205764e 100755 --- a/tb/shinTest/gen_pkt.py +++ b/tb/shinTest/gen_pkt.py @@ -4,7 +4,7 @@ from pyutils import * from testcase import environment, readregs, ebmmu, errorPkt, watchdog, broadcast, sync, base, mac if __name__ == '__main__': - environment.gen_slv_dev_num(4) + environment.gen_slv_dev_num(10) environment.bringup() #add_tc_2_runlist(errorPkt.tc1()) #add_tc_2_runlist(errorPkt.tc2()) @@ -14,8 +14,8 @@ if __name__ == '__main__': #add_tc_2_runlist(errorPkt.tc6()) add_tc_2_runlist(base.tc1()) - add_tc_2_runlist(base.tc2()) - add_tc_2_runlist(base.tc3()) + #add_tc_2_runlist(base.tc2()) + #add_tc_2_runlist(base.tc3()) #add_tc_2_runlist(base.tc4()) #add_tc_2_runlist(base.tc5()) #add_tc_2_runlist(base.tc6()) @@ -79,13 +79,13 @@ if __name__ == '__main__': #add_tc_2_runlist(watchdog.tc1()) #add_tc_2_runlist(watchdog.tc2()) - add_tc_2_runlist(mac.tc1()) - add_tc_2_runlist(mac.tc2()) - add_tc_2_runlist(mac.tc3()) - add_tc_2_runlist(mac.tc4()) - add_tc_2_runlist(mac.tc5()) - add_tc_2_runlist(mac.tc6()) - add_tc_2_runlist(mac.tc7()) + #add_tc_2_runlist(mac.tc1()) + #add_tc_2_runlist(mac.tc2()) + #add_tc_2_runlist(mac.tc3()) + #add_tc_2_runlist(mac.tc4()) + #add_tc_2_runlist(mac.tc5()) + #add_tc_2_runlist(mac.tc6()) + #add_tc_2_runlist(mac.tc7()) environment.teardown()