增加测试代码,支持vqspi 4, bqspi 5
This commit is contained in:
@@ -67,7 +67,7 @@ module ShinTopSpiTb(
|
||||
wire qspi_sck;
|
||||
wire [3:0] qspi_mosi;
|
||||
//wire [40-1:0] qspi_miso;
|
||||
wire [(`ALL_DEV_NUM * 4 * 3 - 1):0] qspi_miso;
|
||||
wire [(`ALL_DEV_NUM * 4 * `QSPI_TYPE_NUM - 1):0] qspi_miso;
|
||||
|
||||
integer spidata_file;
|
||||
integer c_line;
|
||||
@@ -153,6 +153,18 @@ ShinTop s_ShinTop_Mst(
|
||||
.io_aqspi_isDirIn(),
|
||||
.io_aqspi_csn(`AQSPI_CSN(0)),
|
||||
|
||||
.io_vqspi_sck(qspi_sck),
|
||||
.io_vqspi_mosi(qspi_mosi),
|
||||
.io_vqspi_miso(`VQSPI_MISO(0)),
|
||||
.io_vqspi_isDirIn(),
|
||||
.io_vqspi_csn(`VQSPI_CSN(0)),
|
||||
|
||||
.io_bqspi_sck(qspi_sck),
|
||||
.io_bqspi_mosi(qspi_mosi),
|
||||
.io_bqspi_miso(`BQSPI_MISO(0)),
|
||||
.io_bqspi_isDirIn(),
|
||||
.io_bqspi_csn(`BQSPI_CSN(0)),
|
||||
|
||||
.io_isSoftReset(isSoftReset[0]),
|
||||
.io_interrupt(io_int_sig[0]),
|
||||
.io_latchPin_0(latch0),
|
||||
@@ -478,8 +490,12 @@ end
|
||||
reg [11:0] transCnt;
|
||||
reg [11:0] byteCnt;
|
||||
reg [2:0] bitCnt;
|
||||
|
||||
reg [11:0] length;
|
||||
reg [16:0] idx;
|
||||
|
||||
`ifndef OLD_SPI_SUPPORT
|
||||
reg spi_1to4 = 1;
|
||||
reg spi_1to4 = 1;//(idx < (`ALL_DEV_NUM * 4));
|
||||
`endif
|
||||
|
||||
assign spi_mosi = exChangeRego[7];
|
||||
@@ -530,11 +546,6 @@ end
|
||||
reg isReq = 0;
|
||||
reg isBusy = 0;
|
||||
|
||||
reg [11:0] length;
|
||||
reg [16:0] idx;
|
||||
|
||||
|
||||
|
||||
always @(posedge clock) begin
|
||||
if( isReq & sck == 0 ) begin
|
||||
isBusy <= #5 1'b1;
|
||||
@@ -698,6 +709,7 @@ task spi_trans( input [15:0] saddress, input [7:0] scmd, input [12:0] slength, i
|
||||
`endif
|
||||
|
||||
idx <= sidx;
|
||||
spi_1to4 = (idx < (`ALL_DEV_NUM * 4));
|
||||
|
||||
#5
|
||||
@(negedge sck)
|
||||
@@ -946,11 +958,24 @@ end
|
||||
`define ARRAY_IDX_OFF 4
|
||||
`endif
|
||||
|
||||
`ifdef USING_VQSPI
|
||||
`define INTERFACE_IDX (`ALL_DEV_NUM * 4)//internal spi
|
||||
`define ARRAY_IDX_OFF 4
|
||||
`endif
|
||||
|
||||
`ifdef USING_BQSPI
|
||||
`define INTERFACE_IDX (`ALL_DEV_NUM * 5)//internal spi
|
||||
`define ARRAY_IDX_OFF 4
|
||||
`endif
|
||||
|
||||
`define IF_IDX(idx) ((`INTERFACE_IDX)+(idx))
|
||||
`define IF_IQSPI(idx) ((idx))
|
||||
`define IF_OSPI(idx) ((`ALL_DEV_NUM) + (idx))
|
||||
`define IF_OQSPI(idx) ((`ALL_DEV_NUM * 2) + (idx))
|
||||
`define IF_AQSPI(idx) ((`ALL_DEV_NUM * 3) + (idx))
|
||||
`define IF_OSPI(idx) ((`ALL_DEV_NUM) + (idx))
|
||||
`define IF_VQSPI(idx) ((`ALL_DEV_NUM * 4) + (idx))
|
||||
`define IF_BQSPI(idx) ((`ALL_DEV_NUM * 5) + (idx))
|
||||
|
||||
`define SPI_WRITE 8'h00
|
||||
`define SPI_READ 8'h80
|
||||
|
||||
|
||||
Reference in New Issue
Block a user