增加代码,调试sync测试用例

This commit is contained in:
2025-08-04 19:19:08 +08:00
parent 03b63276b8
commit 594c8d70d9
3 changed files with 78 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ if __name__ == '__main__':
#add_tc_2_runlist(errorPkt.tc4())
#add_tc_2_runlist(base.tc1())
add_tc_2_runlist(base.tc1())
#add_tc_2_runlist(base.tc2())
#add_tc_2_runlist(base.tc3())
#add_tc_2_runlist(base.tc4())
@@ -21,17 +21,18 @@ if __name__ == '__main__':
#add_tc_2_runlist(base.tc7())
#add_tc_2_runlist(base.tc8())
#add_tc_2_runlist(base.tc9())
add_tc_2_runlist(base.tc10())
#add_tc_2_runlist(base.tc10())
#add_tc_2_runlist(base.tc11())
#add_tc_2_runlist(broadcast.tc1())
#add_tc_2_runlist(broadcast.tc2())
#add_tc_2_runlist(broadcast.tc3())
#add_tc_2_runlist(sync.tc1())
#add_tc_2_runlist(sync.tc2())
#add_tc_2_runlist(sync.tc3())
#add_tc_2_runlist(sync.tc4())
add_tc_2_runlist(sync.tc1())
add_tc_2_runlist(sync.tc2())
add_tc_2_runlist(sync.tc3())
add_tc_2_runlist(sync.tc4())
'''

View File

@@ -749,7 +749,7 @@ def tc10():
gen_file_def = "base_tc10"
sm_idx = 0
tc_des = "发送超过带有64个子包的。检查子包的状态、中断、统计等信息。"
tc_des = "发送超过带有64个子包的。检查子包的状态、中断、统计等信息。"
#-------------------------------------------------------------------------
#>>>>>>设置顺序地址
@@ -767,7 +767,7 @@ def tc10():
genPkt.addSubPkt(i, 0, 0x0814, 1, 4, [21, 22, 23, 24])
genPkt.addSubPkt(i, 0, 0x0818, 1, 4, [25, 26, 27, 28])
genPkt.addSubPkt(i, 0, 0x081c, 1, 4, [29, 30, 31, 32])
genPkt.addSubPkt(i, 0, 0x0820, 1, 4, [i + 1, 2, 3, 4])
genPkt.addSubPkt(i, 0, 0x0820, 1, 4, [1, 2, 3, 4])
genPkt.addSubPkt(i, 0, 0x0824, 1, 4, [5, 6, 7, 8])
genPkt.addSubPkt(i, 0, 0x0828, 1, 4, [9, 10, 11, 12])
genPkt.addSubPkt(i, 0, 0x082c, 1, 4, [13, 14, 15, 16])
@@ -810,6 +810,68 @@ def tc10():
+genSlvSMReadData(3, 0, 0x40)
+genSlvSMReadData(4, 0, 0x40)
+genIFRwDataCode(0, 0x80, False, 48)
+genIFRwDataCode(1, 0x80, False, 48)
+genIFRwDataCode(2, 0x80, False, 48)
+genIFRwDataCode(3, 0x80, False, 48)
+genIFRwDataCode(4, 0x80, False, 48)
+genTcEndFrameCode(gen_file_def)
)
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
return gen_file_def
def tc11():
genPkt = GenPkt()
gen_file_def = "base_tc11"
sm_idx = 0
tc_des = "清除统计信息。"
#-------------------------------------------------------------------------
#>>>>>>设置顺序地址
genPkt.clean()
genPkt.setPktType(0)
data = [0, ] * 48
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des)
+genIFRwDataCode(0, 0x80, True, 48, data)
+genIFRwDataCode(1, 0x80, True, 48, data)
+genIFRwDataCode(2, 0x80, True, 48, data)
+genIFRwDataCode(3, 0x80, True, 48, data)
+genIFRwDataCode(4, 0x80, True, 48, data)
)
genPkt.addAfterExc(genMessageCode("--读取中断")
+genIFRwDataCode(0, 0x74, False, 4)
+genIFRwDataCode(1, 0x74, False, 4)
+genIFRwDataCode(2, 0x74, False, 4)
+genIFRwDataCode(3, 0x74, False, 4)
+genIFRwDataCode(4, 0x74, False, 4)
+genMessageCode("--清除中断")
+genIFRwDataCode(0, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genIFRwDataCode(1, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genIFRwDataCode(2, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genIFRwDataCode(3, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genMessageCode("--读取中断")
+genIFRwDataCode(0, 0x74, False, 4)
+genIFRwDataCode(1, 0x74, False, 4)
+genIFRwDataCode(2, 0x74, False, 4)
+genIFRwDataCode(3, 0x74, False, 4)
+genIFRwDataCode(4, 0x74, False, 4)
+genIFRwDataCode(0, 0x80, False, 48)
+genIFRwDataCode(1, 0x80, False, 48)
+genIFRwDataCode(2, 0x80, False, 48)
+genIFRwDataCode(3, 0x80, False, 48)
+genIFRwDataCode(4, 0x80, False, 48)
+genTcEndFrameCode(gen_file_def)
)

View File

@@ -15,7 +15,7 @@ def tc1():
genPkt.setPktType(0)
#subPkt参数索引、索引类型、地址、命令、长度、数据
genPkt.addSubPkt(0x0, 0, random.randint(0, 65535), 0xc, 12, b'\0'*12)
genPkt.addSubPkt(0x0, 0, 0x0, 0xc, 12, b'\0'*12)
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des)
@@ -75,17 +75,20 @@ def tc2():
data[36] = 0x20#sync3偏移
data[37] = 0x00
genPkt.addSubPkt(random.randint(0, 2048), 0, 0x120, 0xe, 0x28, data)
genPkt.addSubPkt(0, 0, 0x120, 0xe, 0x28, data)
sm_idx = 0
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des)
)
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)
+genTcEndFrameCode(gen_file_def))
+"\n#1000000\n"
+genTcEndFrameCode(gen_file_def)
)
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)