增加广播读写的测试用例,但是没有测试通过
This commit is contained in:
@@ -5,11 +5,15 @@
|
||||
`define ENABLE_SET_ADDR_TEST
|
||||
//`define ENABLE_SM1_SEND_TEST
|
||||
//`define ENABLE_SMx_SEND_TEST
|
||||
`define ENABLE_EXCHG_DATA_SEQ_TEST
|
||||
|
||||
//`define ENABLE_EXCHG_DATA_SEQ0_TEST
|
||||
//`define ENABLE_EXCHG_DATA_SEQ1_TEST
|
||||
//`define ENABLE_EXCHG_DATA_SEQ2_TEST
|
||||
//`define ENABLE_EXCHG_DATA_BC_TEST
|
||||
|
||||
`define ENABLE_BC_R_TEST
|
||||
`define ENABLE_BC_W_TEST
|
||||
//`define ENABLE_BC_RW_TEST
|
||||
|
||||
`define ENABLE_SYNC_TEST
|
||||
`define ENABLE_SYNC_SIG0_TEST
|
||||
`define ENABLE_SYNC_SIG1_TEST
|
||||
@@ -767,7 +771,6 @@ initial begin
|
||||
|
||||
`endif
|
||||
|
||||
`ifdef ENABLE_EXCHG_DATA_SEQ_TEST
|
||||
/*---------------------------------------------------------------------------------------------------------
|
||||
测试用例
|
||||
1. 交换数据sm0~sm7
|
||||
@@ -861,9 +864,8 @@ initial begin
|
||||
$fdisplay(spidata_file, "该测试用例运行时间:%2tns\n", (_t_end - _t_start) / 1000);
|
||||
end
|
||||
`endif
|
||||
`endif
|
||||
|
||||
`ifdef ENABLE_EXCHG_DATA_BC_TEST
|
||||
`ifdef ENABLE_BC_R_TEST
|
||||
|
||||
begin:EXCHG_DATA_BC_R_TESTCASE
|
||||
_t_start = $time;
|
||||
@@ -877,9 +879,9 @@ initial begin
|
||||
_t_end = $time;
|
||||
$fdisplay(spidata_file, "该测试用例运行时间:%2tns\n", (_t_end - _t_start) / 1000);
|
||||
end
|
||||
`endif
|
||||
|
||||
|
||||
|
||||
`ifdef ENABLE_BC_W_TEST
|
||||
begin:EXCHG_DATA_BC_W_TESTCASE
|
||||
_t_start = $time;
|
||||
#1000
|
||||
@@ -898,6 +900,22 @@ initial begin
|
||||
end
|
||||
`endif
|
||||
|
||||
`ifdef ENABLE_BC_RW_TEST
|
||||
begin:EXCHG_DATA_BC_RW_TESTCASE
|
||||
_t_start = $time;
|
||||
#1000
|
||||
$display("read&write @ %d", s_ShinTop_Mst.interface__io_cReg_timeStamp);
|
||||
|
||||
$fdisplay(spidata_file, "\n--->>>广播读写");
|
||||
`include "bc_rw_pkt.vh"
|
||||
|
||||
spi_trans( (16'h0180), (`SPI_READ), (128), (`IF_IDX(1)) );
|
||||
|
||||
_t_end = $time;
|
||||
$fdisplay(spidata_file, "该测试用例运行时间:%2tns\n", (_t_end - _t_start) / 1000);
|
||||
end
|
||||
`endif
|
||||
|
||||
|
||||
`ifdef ENABLE_SYNC_TEST
|
||||
/*---------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -682,6 +682,26 @@ if __name__ == '__main__':
|
||||
|
||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#>>>>>>广播读写
|
||||
genPkt.clean()
|
||||
genPkt.setPktType(0)
|
||||
|
||||
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||
data = bytearray(b"\0"*100)
|
||||
for i in range(4):
|
||||
data[i] = i + 1
|
||||
genPkt.addSubPkt(random.randint(0, 2048), 0, 0x00c0, 0xf, 4, data)
|
||||
|
||||
gen_file_def = " "
|
||||
sm_idx = 0
|
||||
|
||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||
+genReadAckPktCode(gen_file_def, sm_idx))
|
||||
|
||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user