增加测试用例,wd17的测试尚有疑问
This commit is contained in:
@@ -145,17 +145,58 @@ if __name__ == '__main__':
|
|||||||
add_tc_2_runlist(ebmmu.tc19())
|
add_tc_2_runlist(ebmmu.tc19())
|
||||||
#'''
|
#'''
|
||||||
|
|
||||||
#add_tc_2_runlist(watchdog.tc1())
|
'''
|
||||||
#add_tc_2_runlist(watchdog.tc2())
|
add_tc_2_runlist(watchdog.tc1())
|
||||||
#add_tc_2_runlist(watchdog.tc3())
|
add_tc_2_runlist(watchdog.tc2())
|
||||||
#add_tc_2_runlist(watchdog.tc4())
|
add_tc_2_runlist(watchdog.tc3())
|
||||||
#add_tc_2_runlist(watchdog.tc5())
|
add_tc_2_runlist(watchdog.tc4())
|
||||||
#add_tc_2_runlist(watchdog.tc6())
|
add_tc_2_runlist(watchdog.tc5())
|
||||||
#add_tc_2_runlist(watchdog.tc7())
|
add_tc_2_runlist(watchdog.tc6())
|
||||||
#add_tc_2_runlist(watchdog.tc8())
|
add_tc_2_runlist(watchdog.tc7())
|
||||||
|
add_tc_2_runlist(watchdog.tc8())
|
||||||
|
#'''
|
||||||
|
|
||||||
|
'''
|
||||||
add_tc_2_runlist(watchdog.tc9())
|
add_tc_2_runlist(watchdog.tc9())
|
||||||
#add_tc_2_runlist(watchdog.tc10())
|
add_tc_2_runlist(watchdog.tc10())
|
||||||
#add_tc_2_runlist(watchdog.tc11())
|
add_tc_2_runlist(watchdog.tc11())
|
||||||
|
add_tc_2_runlist(watchdog.tc12())
|
||||||
|
add_tc_2_runlist(watchdog.tc13())
|
||||||
|
add_tc_2_runlist(watchdog.tc14())
|
||||||
|
add_tc_2_runlist(watchdog.tc15())
|
||||||
|
add_tc_2_runlist(watchdog.tc16())
|
||||||
|
#'''
|
||||||
|
|
||||||
|
'''
|
||||||
|
add_tc_2_runlist(watchdog.tc17())
|
||||||
|
add_tc_2_runlist(watchdog.tc18())
|
||||||
|
add_tc_2_runlist(watchdog.tc19())
|
||||||
|
add_tc_2_runlist(watchdog.tc20())
|
||||||
|
add_tc_2_runlist(watchdog.tc21())
|
||||||
|
add_tc_2_runlist(watchdog.tc22())
|
||||||
|
add_tc_2_runlist(watchdog.tc23())
|
||||||
|
add_tc_2_runlist(watchdog.tc24())
|
||||||
|
#'''
|
||||||
|
|
||||||
|
'''
|
||||||
|
add_tc_2_runlist(watchdog.tc25())
|
||||||
|
add_tc_2_runlist(watchdog.tc26())
|
||||||
|
add_tc_2_runlist(watchdog.tc27())
|
||||||
|
add_tc_2_runlist(watchdog.tc28())
|
||||||
|
add_tc_2_runlist(watchdog.tc29())
|
||||||
|
add_tc_2_runlist(watchdog.tc30())
|
||||||
|
add_tc_2_runlist(watchdog.tc31())
|
||||||
|
add_tc_2_runlist(watchdog.tc32())
|
||||||
|
#'''
|
||||||
|
|
||||||
|
#'''
|
||||||
|
#add_tc_2_runlist(watchdog.tc33())
|
||||||
|
#add_tc_2_runlist(watchdog.tc34())
|
||||||
|
#add_tc_2_runlist(watchdog.tc35())
|
||||||
|
#add_tc_2_runlist(watchdog.tc36())
|
||||||
|
add_tc_2_runlist(watchdog.tc37())
|
||||||
|
#'''
|
||||||
|
|
||||||
|
|
||||||
#add_tc_2_runlist(mac.tc1())
|
#add_tc_2_runlist(mac.tc1())
|
||||||
#add_tc_2_runlist(mac.tc2())
|
#add_tc_2_runlist(mac.tc2())
|
||||||
|
|||||||
@@ -929,6 +929,80 @@ def tc8():
|
|||||||
return watchdog_test_sm_lvds_rd_no_timeout(8, 4)
|
return watchdog_test_sm_lvds_rd_no_timeout(8, 4)
|
||||||
|
|
||||||
|
|
||||||
|
def tc9():
|
||||||
|
return watchdog_test_sm_lvds_wr_timeout(9, 5)
|
||||||
|
|
||||||
|
def tc10():
|
||||||
|
return watchdog_test_sm_if_rd_timeout(10, 6)
|
||||||
|
|
||||||
|
def tc11():
|
||||||
|
return watchdog_test_sm_lvds_wr_no_timeout(11, 5)
|
||||||
|
|
||||||
|
def tc12():
|
||||||
|
return watchdog_test_sm_if_rd_no_timeout(12, 6)
|
||||||
|
|
||||||
|
def tc13():
|
||||||
|
return watchdog_test_sm_if_wr_timeout(13, 7)
|
||||||
|
|
||||||
|
def tc14():
|
||||||
|
return watchdog_test_sm_lvds_rd_timeout(14, 8)
|
||||||
|
|
||||||
|
def tc15():
|
||||||
|
return watchdog_test_sm_if_wr_no_timeout(15, 7)
|
||||||
|
|
||||||
|
def tc16():
|
||||||
|
return watchdog_test_sm_lvds_rd_no_timeout(16, 8)
|
||||||
|
|
||||||
|
|
||||||
|
def tc17():
|
||||||
|
return watchdog_test_sm_lvds_wr_timeout(17, 9)
|
||||||
|
|
||||||
|
def tc18():
|
||||||
|
return watchdog_test_sm_if_rd_timeout(18, 10)
|
||||||
|
|
||||||
|
def tc19():
|
||||||
|
return watchdog_test_sm_lvds_wr_no_timeout(19, 9)
|
||||||
|
|
||||||
|
def tc20():
|
||||||
|
return watchdog_test_sm_if_rd_no_timeout(20, 10)
|
||||||
|
|
||||||
|
def tc21():
|
||||||
|
return watchdog_test_sm_if_wr_timeout(21, 11)
|
||||||
|
|
||||||
|
def tc22():
|
||||||
|
return watchdog_test_sm_lvds_rd_timeout(22, 12)
|
||||||
|
|
||||||
|
def tc23():
|
||||||
|
return watchdog_test_sm_if_wr_no_timeout(23, 11)
|
||||||
|
|
||||||
|
def tc24():
|
||||||
|
return watchdog_test_sm_lvds_rd_no_timeout(24, 12)
|
||||||
|
|
||||||
|
|
||||||
|
def tc25():
|
||||||
|
return watchdog_test_sm_lvds_wr_timeout(25, 13)
|
||||||
|
|
||||||
|
def tc26():
|
||||||
|
return watchdog_test_sm_if_rd_timeout(26, 14)
|
||||||
|
|
||||||
|
def tc27():
|
||||||
|
return watchdog_test_sm_lvds_wr_no_timeout(27, 13)
|
||||||
|
|
||||||
|
def tc28():
|
||||||
|
return watchdog_test_sm_if_rd_no_timeout(28, 14)
|
||||||
|
|
||||||
|
def tc29():
|
||||||
|
return watchdog_test_sm_if_wr_timeout(29, 15)
|
||||||
|
|
||||||
|
def tc30():
|
||||||
|
return watchdog_test_sm_lvds_rd_timeout(30, 16)
|
||||||
|
|
||||||
|
def tc31():
|
||||||
|
return watchdog_test_sm_if_wr_no_timeout(31, 15)
|
||||||
|
|
||||||
|
def tc32():
|
||||||
|
return watchdog_test_sm_lvds_rd_no_timeout(32, 16)
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
嗅探包主站的 发开始到接收始,嗅探包长度(4B Preamble)+(4B Head) + (2B Data) + (4B Crc) = 14B,大约140个clk
|
嗅探包主站的 发开始到接收始,嗅探包长度(4B Preamble)+(4B Head) + (2B Data) + (4B Crc) = 14B,大约140个clk
|
||||||
@@ -936,14 +1010,17 @@ def tc8():
|
|||||||
正常的包,最小的包长度为:(4B Preamble)+(4B Head) + (8B SubHead) + (4B Crc) = 20B
|
正常的包,最小的包长度为:(4B Preamble)+(4B Head) + (8B SubHead) + (4B Crc) = 20B
|
||||||
downOut,upIn 交叠时之间会被反复触发。
|
downOut,upIn 交叠时之间会被反复触发。
|
||||||
'''
|
'''
|
||||||
def tc9():
|
def tc33():
|
||||||
return main_station_trans(9, 650)
|
return main_station_trans(33, 650)
|
||||||
|
|
||||||
|
def tc34():
|
||||||
|
return main_station_trans(34, 500)
|
||||||
|
|
||||||
|
|
||||||
def tc10():
|
def slave_station_trans(tc_id, delay_time):
|
||||||
genPkt = GenPkt()
|
genPkt = GenPkt()
|
||||||
|
|
||||||
gen_file_def = "watchdog_tc10"
|
gen_file_def = "watchdog_tc%02d"%(tc_id, )
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
tc_des = (f"使能从站的看门狗0,看通讯的超时Watchdog是否超时。\\n"
|
tc_des = (f"使能从站的看门狗0,看通讯的超时Watchdog是否超时。\\n"
|
||||||
@@ -997,7 +1074,7 @@ def tc10():
|
|||||||
data = 1 ##使能看门狗
|
data = 1 ##使能看门狗
|
||||||
data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||||
|
|
||||||
data = 650 ##看门狗的超时值
|
data = delay_time ##看门狗的超时值
|
||||||
data1 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
data1 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||||
|
|
||||||
genPkt.addBeforeExc(#genTcStartFrameCode(gen_file_def, tc_des)
|
genPkt.addBeforeExc(#genTcStartFrameCode(gen_file_def, tc_des)
|
||||||
@@ -1111,6 +1188,63 @@ def tc10():
|
|||||||
+genMessageCode("--延时后检查看门狗寄存器")
|
+genMessageCode("--延时后检查看门狗寄存器")
|
||||||
+"#200000\n"
|
+"#200000\n"
|
||||||
+genIFRwDataCode(1, 0x400, False, 0x04)
|
+genIFRwDataCode(1, 0x400, False, 0x04)
|
||||||
|
)
|
||||||
|
#+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1, True, gen_file_def_ap)
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------
|
||||||
|
genPkt.clean()
|
||||||
|
genPkt.setPktType(1)
|
||||||
|
|
||||||
|
#data = 1 ##使能看门狗
|
||||||
|
#data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||||
|
|
||||||
|
genPkt.addBeforeExc(#genTcStartFrameCode(gen_file_def, tc_des)
|
||||||
|
genIFRwDataCode(0, 0x078, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||||
|
#+ genIFRwDataCode(0, 0x404, True, 4, data0)
|
||||||
|
#+ genIFRwDataCode(0, 0x110, False, 4)
|
||||||
|
#+ '''_temp_time = rxBuf[`ARRAY_IDX_OFF] + (rxBuf[`ARRAY_IDX_OFF+1] << 8) + (rxBuf[`ARRAY_IDX_OFF+2] << 16) + (rxBuf[`ARRAY_IDX_OFF+3] << 24);\n'''
|
||||||
|
#+ '''_temp_time = _temp_time + 32'h100;\n'''
|
||||||
|
#+ '''txBuf[`ARRAY_IDX_OFF+0] = (_temp_time & 8'hff);\n'''
|
||||||
|
#+ '''txBuf[`ARRAY_IDX_OFF+1] = ( (_temp_time >> 8) & 8'hff);\n'''
|
||||||
|
#+ '''txBuf[`ARRAY_IDX_OFF+2] = ((_temp_time >> 16) & 8'hff);\n'''
|
||||||
|
#+ '''txBuf[`ARRAY_IDX_OFF+3] = ((_temp_time >> 24) & 8'hff);\n'''
|
||||||
|
#+ '''spi_trans( (16'h0408), (`SPI_WRITE), (4), (`IF_IDX(0)));\n\n'''
|
||||||
|
|
||||||
|
#+ genIFRwDataCode(0, 0x408, True, 4, data1)
|
||||||
|
+ genIFRwDataCode(0, 0x400, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||||
|
+ genIFRwDataCode(0, 0x400, False, 0x04))
|
||||||
|
#genPkt.addBeforeExc( genIFRwDataCode(1, 0x078, True, 4, [0xff, 0xff, 0xff, 0xff]))
|
||||||
|
|
||||||
|
#data = [0,] * 0x40
|
||||||
|
|
||||||
|
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||||
|
#genPkt.addSubPkt(1, 0, 0x0, 0xd, 0x40, data)
|
||||||
|
|
||||||
|
sm_idx = 0
|
||||||
|
|
||||||
|
gen_file_def_ap = gen_file_def + "_ap03"
|
||||||
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genWriteTransPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genTrgTransPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
+genReadAckPktCode(gen_file_def_ap, sm_idx)
|
||||||
|
|
||||||
|
+genMessageCode("--检查中断寄存器")
|
||||||
|
+genIFRwDataCode(0, 0x074, False, 0x04)
|
||||||
|
+genIFRwDataCode(1, 0x074, False, 0x04)
|
||||||
|
+genIFRwDataCode(2, 0x074, False, 0x04)
|
||||||
|
+genIFRwDataCode(3, 0x074, False, 0x04)
|
||||||
|
+genIFRwDataCode(4, 0x074, False, 0x04)
|
||||||
|
+genMessageCode("--延时后检查看门狗寄存器")
|
||||||
|
+"#2000000\n"
|
||||||
|
+genIFRwDataCode(0, 0x400, False, 0x04)
|
||||||
|
+genIFRwDataCode(0, 0x400, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||||
|
+genIFRwDataCode(0, 0x400, False, 0x04)
|
||||||
|
+genMessageCode("--延时后检查看门狗寄存器")
|
||||||
|
+"#2000000\n"
|
||||||
|
+genIFRwDataCode(0, 0x400, False, 0x04)
|
||||||
+genTcEndFrameCode(gen_file_def))
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1, True, gen_file_def_ap)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1, True, gen_file_def_ap)
|
||||||
@@ -1119,10 +1253,18 @@ def tc10():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def tc11():
|
|
||||||
|
def tc35():
|
||||||
|
return slave_station_trans(35, 500)
|
||||||
|
|
||||||
|
def tc36():
|
||||||
|
return slave_station_trans(36, 300)
|
||||||
|
|
||||||
|
|
||||||
|
def tc37():
|
||||||
genPkt = GenPkt()
|
genPkt = GenPkt()
|
||||||
|
|
||||||
gen_file_def = "watchdog_tc11"
|
gen_file_def = "watchdog_tc36"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
tc_des = (f"使能从站的看门狗17,看通讯的超时Watchdog是否超时。\\n"
|
tc_des = (f"使能从站的看门狗17,看通讯的超时Watchdog是否超时。\\n"
|
||||||
@@ -1135,7 +1277,7 @@ def tc11():
|
|||||||
data = 1 << 17 ##使能看门狗
|
data = 1 << 17 ##使能看门狗
|
||||||
data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||||
|
|
||||||
data = 12000 ##看门狗的超时值
|
data = 15000 ##看门狗的超时值
|
||||||
data1 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
data1 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||||
|
|
||||||
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des)
|
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des)
|
||||||
@@ -1217,7 +1359,7 @@ def tc11():
|
|||||||
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
|
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||||
|
|
||||||
+genMessageCode("--延时后检查看门狗寄存器")
|
+genMessageCode("--延时后检查看门狗寄存器")
|
||||||
+"#200000\n"
|
#+"#200000\n"
|
||||||
+genIFRwDataCode(1, 0x400, False, 0x04)
|
+genIFRwDataCode(1, 0x400, False, 0x04)
|
||||||
+genIFRwDataCode(1, 0x400, True, 4, [0xff, 0xff, 0xff, 0xff])
|
+genIFRwDataCode(1, 0x400, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||||
+genIFRwDataCode(1, 0x400, False, 0x04)
|
+genIFRwDataCode(1, 0x400, False, 0x04)
|
||||||
|
|||||||
Reference in New Issue
Block a user