增加新的测试用例
This commit is contained in:
@@ -153,9 +153,9 @@ if __name__ == '__main__':
|
||||
#add_tc_2_runlist(watchdog.tc6())
|
||||
#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.tc11())
|
||||
#add_tc_2_runlist(watchdog.tc11())
|
||||
|
||||
#add_tc_2_runlist(mac.tc1())
|
||||
#add_tc_2_runlist(mac.tc2())
|
||||
|
||||
@@ -672,34 +672,10 @@ def watchdog_test_sm_lvds_rd_no_timeout(tc_id, wd_id):
|
||||
|
||||
return gen_file_def
|
||||
|
||||
def tc1():
|
||||
return watchdog_test_sm_lvds_wr_timeout(1, 1)
|
||||
|
||||
def tc2():
|
||||
return watchdog_test_sm_if_rd_timeout(2, 2)
|
||||
|
||||
def tc3():
|
||||
return watchdog_test_sm_lvds_wr_no_timeout(3, 1)
|
||||
|
||||
def tc4():
|
||||
return watchdog_test_sm_if_rd_no_timeout(4, 2)
|
||||
|
||||
def tc5():
|
||||
return watchdog_test_sm_if_wr_timeout(5, 3)
|
||||
|
||||
def tc6():
|
||||
return watchdog_test_sm_lvds_rd_timeout(6, 4)
|
||||
|
||||
def tc7():
|
||||
return watchdog_test_sm_if_wr_no_timeout(7, 3)
|
||||
|
||||
def tc8():
|
||||
return watchdog_test_sm_lvds_rd_no_timeout(8, 4)
|
||||
|
||||
def tc9():
|
||||
def main_station_trans(tc_id, delay_time):
|
||||
genPkt = GenPkt()
|
||||
|
||||
gen_file_def = "watchdog_tc09"
|
||||
gen_file_def = "watchdog_tc%02d"%(tc_id, )
|
||||
sm_idx = 0
|
||||
|
||||
tc_des = (f"使能主站的看门狗0,看通讯的超时Watchdog是否超时。\\n"
|
||||
@@ -753,7 +729,7 @@ def tc9():
|
||||
data = 1 ##使能看门狗
|
||||
data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||
|
||||
data = 960 ##看门狗的超时值
|
||||
data = delay_time ##看门狗的超时值
|
||||
data1 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||
|
||||
genPkt.addBeforeExc(#genTcStartFrameCode(gen_file_def, tc_des)
|
||||
@@ -820,8 +796,63 @@ def tc9():
|
||||
data = 1 ##使能看门狗
|
||||
data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||
|
||||
data = 960 ##看门狗的超时值
|
||||
data1 = [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 + "_ap02"
|
||||
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))
|
||||
|
||||
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])
|
||||
@@ -840,14 +871,14 @@ def tc9():
|
||||
+ genIFRwDataCode(0, 0x400, False, 0x04))
|
||||
#genPkt.addBeforeExc( genIFRwDataCode(1, 0x078, True, 4, [0xff, 0xff, 0xff, 0xff]))
|
||||
|
||||
data = [0,] * 0x20
|
||||
#data = [0,] * 0x40
|
||||
|
||||
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||
genPkt.addSubPkt(1, 0, 0x0, 0xd, 0x20, data)
|
||||
#genPkt.addSubPkt(1, 0, 0x0, 0xd, 0x40, data)
|
||||
|
||||
sm_idx = 0
|
||||
|
||||
gen_file_def_ap = gen_file_def + "_ap02"
|
||||
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)
|
||||
@@ -860,12 +891,12 @@ def tc9():
|
||||
+genIFRwDataCode(3, 0x074, False, 0x04)
|
||||
+genIFRwDataCode(4, 0x074, False, 0x04)
|
||||
+genMessageCode("--延时后检查看门狗寄存器")
|
||||
+"#200000\n"
|
||||
+"#2000000\n"
|
||||
+genIFRwDataCode(0, 0x400, False, 0x04)
|
||||
+genIFRwDataCode(0, 0x400, True, 4, [0xff, 0xff, 0xff, 0xff])
|
||||
+genIFRwDataCode(0, 0x400, False, 0x04)
|
||||
+genMessageCode("--延时后检查看门狗寄存器")
|
||||
+"#200000\n"
|
||||
+"#2000000\n"
|
||||
+genIFRwDataCode(0, 0x400, False, 0x04)
|
||||
+genTcEndFrameCode(gen_file_def))
|
||||
|
||||
@@ -873,6 +904,40 @@ def tc9():
|
||||
|
||||
return gen_file_def
|
||||
|
||||
def tc1():
|
||||
return watchdog_test_sm_lvds_wr_timeout(1, 1)
|
||||
|
||||
def tc2():
|
||||
return watchdog_test_sm_if_rd_timeout(2, 2)
|
||||
|
||||
def tc3():
|
||||
return watchdog_test_sm_lvds_wr_no_timeout(3, 1)
|
||||
|
||||
def tc4():
|
||||
return watchdog_test_sm_if_rd_no_timeout(4, 2)
|
||||
|
||||
def tc5():
|
||||
return watchdog_test_sm_if_wr_timeout(5, 3)
|
||||
|
||||
def tc6():
|
||||
return watchdog_test_sm_lvds_rd_timeout(6, 4)
|
||||
|
||||
def tc7():
|
||||
return watchdog_test_sm_if_wr_no_timeout(7, 3)
|
||||
|
||||
def tc8():
|
||||
return watchdog_test_sm_lvds_rd_no_timeout(8, 4)
|
||||
|
||||
|
||||
|
||||
'''
|
||||
嗅探包主站的 发开始到接收始,嗅探包长度(4B Preamble)+(4B Head) + (2B Data) + (4B Crc) = 14B,大约140个clk
|
||||
如果主站的downOut, upIn出现:发送、接收交叠的情况,则Watchdog0会被触发,持续时间9clk
|
||||
正常的包,最小的包长度为:(4B Preamble)+(4B Head) + (8B SubHead) + (4B Crc) = 20B
|
||||
downOut,upIn 交叠时之间会被反复触发。
|
||||
'''
|
||||
def tc9():
|
||||
return main_station_trans(9, 650)
|
||||
|
||||
|
||||
def tc10():
|
||||
@@ -932,7 +997,7 @@ def tc10():
|
||||
data = 1 ##使能看门狗
|
||||
data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||
|
||||
data = 960 ##看门狗的超时值
|
||||
data = 650 ##看门狗的超时值
|
||||
data1 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||
|
||||
genPkt.addBeforeExc(#genTcStartFrameCode(gen_file_def, tc_des)
|
||||
@@ -996,11 +1061,11 @@ def tc10():
|
||||
genPkt.clean()
|
||||
genPkt.setPktType(0)
|
||||
|
||||
data = 1 ##使能看门狗
|
||||
data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||
#data = 1 ##使能看门狗
|
||||
#data0 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||
|
||||
data = 960 ##看门狗的超时值
|
||||
data1 = [data&0xff, (data>>8)&0xff, (data>>16)&0xff, (data>>24)&0xff]
|
||||
#data = 960 ##看门狗的超时值
|
||||
#data1 = [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])
|
||||
|
||||
Reference in New Issue
Block a user