增加EBMMU的新测试用例
This commit is contained in:
@@ -21,6 +21,10 @@
|
|||||||
//`define ENABLE_SYNC_SIG1_TEST
|
//`define ENABLE_SYNC_SIG1_TEST
|
||||||
//`define ENABLE_RESET_TEST
|
//`define ENABLE_RESET_TEST
|
||||||
|
|
||||||
|
`define ENABLE_EBMMU_TC1_TEST
|
||||||
|
`define ENABLE_EBMMU_TC2_TEST
|
||||||
|
`define ENABLE_EBMMU_TC3_TEST
|
||||||
|
|
||||||
module ShinTopSpiTb(
|
module ShinTopSpiTb(
|
||||||
|
|
||||||
);
|
);
|
||||||
@@ -1296,22 +1300,47 @@ initial begin
|
|||||||
end
|
end
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
begin:EBMMU_TEST
|
`ifdef ENABLE_EBMMU_TC1_TEST
|
||||||
|
begin:EBMMU_TC1_TEST
|
||||||
_t_start = $realtime;
|
_t_start = $realtime;
|
||||||
#1000
|
#1000
|
||||||
|
|
||||||
$fdisplay(spidata_file, "\n\n测试用例:EBMMU测试");
|
$fdisplay(spidata_file, "\n\n测试用例:EBMMU测试 1");
|
||||||
|
|
||||||
`include "ebmmu_settings.vh"
|
`include "ebmmu_tc1_settings.vh"
|
||||||
|
|
||||||
`include "ebmmu_seq_read.vh"
|
`include "ebmmu_tc1_seq_read.vh"
|
||||||
|
|
||||||
`include "ebmmu_read.vh"
|
`include "ebmmu_tc1_read.vh"
|
||||||
|
|
||||||
_t_end = $realtime;
|
_t_end = $realtime;
|
||||||
$fdisplay(spidata_file, "该测试用例运行时间:%t\n", _t_end - _t_start);
|
$fdisplay(spidata_file, "该测试用例运行时间:%t\n", _t_end - _t_start);
|
||||||
end
|
end
|
||||||
|
`endif
|
||||||
|
|
||||||
|
`ifdef ENABLE_EBMMU_TC2_TEST
|
||||||
|
begin:EBMMU_TC2_TEST
|
||||||
|
_t_start = $realtime;
|
||||||
|
#1000
|
||||||
|
|
||||||
|
$fdisplay(spidata_file, "\n\n测试用例:EBMMU测试 2");
|
||||||
|
|
||||||
|
`include "ebmmu_tc2_settings.vh"
|
||||||
|
|
||||||
|
`include "ebmmu_tc2_seq_read.vh"
|
||||||
|
|
||||||
|
`include "ebmmu_tc2_read.vh"
|
||||||
|
|
||||||
|
|
||||||
|
_t_end = $realtime;
|
||||||
|
$fdisplay(spidata_file, "该测试用例运行时间:%t\n", _t_end - _t_start);
|
||||||
|
end
|
||||||
|
`endif
|
||||||
|
|
||||||
|
|
||||||
|
`ifdef ENABLE_EBMMU_TC3_TEST
|
||||||
|
|
||||||
|
`endif
|
||||||
|
|
||||||
#1000000
|
#1000000
|
||||||
$display("Testcase Finished! Time Out !!!");
|
$display("Testcase Finished! Time Out !!!");
|
||||||
|
|||||||
@@ -921,7 +921,7 @@ if __name__ == '__main__':
|
|||||||
genPkt.addSubPkt(0x4, 0, 0x0200, 0x1, 10, data)
|
genPkt.addSubPkt(0x4, 0, 0x0200, 0x1, 10, data)
|
||||||
|
|
||||||
|
|
||||||
gen_file_def = "ebmmu_settings"
|
gen_file_def = "ebmmu_tc1_settings"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||||
@@ -944,7 +944,7 @@ if __name__ == '__main__':
|
|||||||
genPkt.addSubPkt(0x03, 0, 0x0200, 0x0, 10, data)
|
genPkt.addSubPkt(0x03, 0, 0x0200, 0x0, 10, data)
|
||||||
genPkt.addSubPkt(0x04, 0, 0x0200, 0x0, 10, data)
|
genPkt.addSubPkt(0x04, 0, 0x0200, 0x0, 10, data)
|
||||||
|
|
||||||
gen_file_def = "ebmmu_seq_read"
|
gen_file_def = "ebmmu_tc1_seq_read"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||||
@@ -956,7 +956,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#>>>>>>设置EB-MMU
|
#>>>>>>用EB-MMU方式读取EB-MMU设置
|
||||||
genPkt.clean()
|
genPkt.clean()
|
||||||
genPkt.setPktType(0)
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
@@ -965,7 +965,117 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
genPkt.addSubPkt(0x1000, 2, 0x0000, 0x0, 40, data)
|
genPkt.addSubPkt(0x1000, 2, 0x0000, 0x0, 40, data)
|
||||||
|
|
||||||
gen_file_def = "ebmmu_read"
|
gen_file_def = "ebmmu_tc1_read"
|
||||||
|
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)
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#>>>>>>设置EB-MMU
|
||||||
|
genPkt.clean()
|
||||||
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
|
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||||
|
data = [0,] * 30
|
||||||
|
|
||||||
|
data[0] = 0x00
|
||||||
|
data[1] = 0x00
|
||||||
|
data[2] = 0x00
|
||||||
|
data[3] = 0x20
|
||||||
|
|
||||||
|
data[4] = 0x00
|
||||||
|
data[5] = 0x00
|
||||||
|
|
||||||
|
data[6] = 0x0f
|
||||||
|
data[7] = 0x00
|
||||||
|
|
||||||
|
data[8] = 0x01
|
||||||
|
data[9] = 0x01
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x020a, 0x1, 10, data)
|
||||||
|
|
||||||
|
|
||||||
|
data = [0,] * 30
|
||||||
|
data[0] = 0x10
|
||||||
|
data[1] = 0x00
|
||||||
|
data[2] = 0x00
|
||||||
|
data[3] = 0x20
|
||||||
|
|
||||||
|
data[4] = 0x00
|
||||||
|
data[5] = 0x00
|
||||||
|
|
||||||
|
data[6] = 0x0f
|
||||||
|
data[7] = 0x00
|
||||||
|
|
||||||
|
data[8] = 0x01
|
||||||
|
data[9] = 0x01
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x020a, 0x1, 10, data)
|
||||||
|
|
||||||
|
|
||||||
|
data = [0,] * 30
|
||||||
|
|
||||||
|
data[0] = 0x20
|
||||||
|
data[1] = 0x00
|
||||||
|
data[2] = 0x00
|
||||||
|
data[3] = 0x20
|
||||||
|
|
||||||
|
data[4] = 0x00
|
||||||
|
data[5] = 0x00
|
||||||
|
|
||||||
|
data[6] = 0x0f
|
||||||
|
data[7] = 0x00
|
||||||
|
|
||||||
|
data[8] = 0x01
|
||||||
|
data[9] = 0x01
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x020a, 0x1, 10, data)
|
||||||
|
|
||||||
|
data = [0,] * 30
|
||||||
|
|
||||||
|
data[0] = 0x30
|
||||||
|
data[1] = 0x00
|
||||||
|
data[2] = 0x00
|
||||||
|
data[3] = 0x20
|
||||||
|
|
||||||
|
data[4] = 0x00
|
||||||
|
data[5] = 0x00
|
||||||
|
|
||||||
|
data[6] = 0x0f
|
||||||
|
data[7] = 0x00
|
||||||
|
|
||||||
|
data[8] = 0x01
|
||||||
|
data[9] = 0x01
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x020a, 0x1, 10, data)
|
||||||
|
|
||||||
|
|
||||||
|
gen_file_def = "ebmmu_tc2_settings"
|
||||||
|
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)
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#>>>>>>读取数据
|
||||||
|
genPkt.clean()
|
||||||
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
|
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||||
|
data = [0,] * 40
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x01, 0, 0x0000, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x02, 0, 0x0000, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x03, 0, 0x0000, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x04, 0, 0x0000, 0x0, 16, data)
|
||||||
|
|
||||||
|
gen_file_def = "ebmmu_tc2_seq_read"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||||
@@ -976,4 +1086,23 @@ if __name__ == '__main__':
|
|||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#>>>>>>用EB-MMU方式读取EB-MMU设置
|
||||||
|
genPkt.clean()
|
||||||
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
|
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||||
|
data = [0,] * 100
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x2000, 2, 0x0000, 0x0, 0x40, data)
|
||||||
|
|
||||||
|
gen_file_def = "ebmmu_tc2_read"
|
||||||
|
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