1.增加测试用例;2.增加自动生成从站数量的代码,可更改成任意的从站数量
This commit is contained in:
@@ -40,6 +40,10 @@ module ShinTopSpiTb(
|
||||
|
||||
reg [15:0] multiCLK;
|
||||
|
||||
|
||||
`include "dev_predef.vh"
|
||||
|
||||
`ifdef DEFINE_SLAVE_DEVICE
|
||||
`define DEV_NUM 4 //slave num
|
||||
`define ALL_DEV_NUM (`DEV_NUM + 1) // slave + master
|
||||
`define SPI_CSN_NUM (`ALL_DEV_NUM * 3)
|
||||
@@ -74,7 +78,7 @@ module ShinTopSpiTb(
|
||||
( spi_miso[2] & ~`ESPI_CSN(2)) |\
|
||||
( spi_miso[3] & ~`ESPI_CSN(3)) |\
|
||||
( spi_miso[4] & ~`ESPI_CSN(4))
|
||||
|
||||
`endif
|
||||
wire [(`DEV_NUM - 1):0] dDat_w;
|
||||
wire [(`DEV_NUM - 1):0] uDat_w;
|
||||
|
||||
@@ -156,6 +160,9 @@ ShinTop s_ShinTop_Mst(
|
||||
.io_uniCode(0)
|
||||
);
|
||||
|
||||
`include "slave_dev_def.vh"
|
||||
|
||||
`ifdef DEFINE_SLAVE_DEVICE
|
||||
ShinTop s_ShinTop_slv0(
|
||||
.clock(clock),
|
||||
.reset(reset | isSoftReset[1]),
|
||||
@@ -359,7 +366,7 @@ ShinTop s_ShinTop_slv3(
|
||||
.io_hwSerial(`HW_SERIAL),
|
||||
.io_uniCode(0)
|
||||
);
|
||||
|
||||
`endif
|
||||
|
||||
initial begin
|
||||
clock = 0;
|
||||
|
||||
Reference in New Issue
Block a user