增加新的测试用例
This commit is contained in:
@@ -103,7 +103,7 @@ ShinTop i_ShinTop(
|
|||||||
.io_ospi_miso(miso),
|
.io_ospi_miso(miso),
|
||||||
.io_ospi_csn(csn),
|
.io_ospi_csn(csn),
|
||||||
|
|
||||||
.io_rsp_valid(interrupt),
|
.io_interrupt(interrupt),
|
||||||
.io_rsp_bits_isError(),
|
.io_rsp_bits_isError(),
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ def compare_files(source_file, target_file):
|
|||||||
#print(f"Line {i+1}, Position {j+1}: Values match ({src_val} == {tgt_val}).")
|
#print(f"Line {i+1}, Position {j+1}: Values match ({src_val} == {tgt_val}).")
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print(f"\tLine {i+1}, Position {j+1}: Values differ ({src_val} != {tgt_val}).")
|
#print(f"\tLine {i+1}, Position {j+1}: Values differ ({src_val} != {tgt_val}).")
|
||||||
line_match = False
|
line_match = False
|
||||||
all_match = False
|
all_match = False
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if __name__ == '__main__':
|
|||||||
#add_tc_2_runlist(errorPkt.tc4())
|
#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.tc2())
|
||||||
#add_tc_2_runlist(base.tc3())
|
#add_tc_2_runlist(base.tc3())
|
||||||
#add_tc_2_runlist(base.tc4())
|
#add_tc_2_runlist(base.tc4())
|
||||||
@@ -21,17 +21,18 @@ if __name__ == '__main__':
|
|||||||
#add_tc_2_runlist(base.tc7())
|
#add_tc_2_runlist(base.tc7())
|
||||||
#add_tc_2_runlist(base.tc8())
|
#add_tc_2_runlist(base.tc8())
|
||||||
#add_tc_2_runlist(base.tc9())
|
#add_tc_2_runlist(base.tc9())
|
||||||
|
add_tc_2_runlist(base.tc10())
|
||||||
|
|
||||||
'''
|
|
||||||
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(broadcast.tc1())
|
||||||
add_tc_2_runlist(sync.tc2())
|
#add_tc_2_runlist(broadcast.tc2())
|
||||||
add_tc_2_runlist(sync.tc3())
|
#add_tc_2_runlist(broadcast.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())
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
add_tc_2_runlist(ebmmu.tc1())
|
add_tc_2_runlist(ebmmu.tc1())
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ def tc1():
|
|||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
+genReadAckPktCode(gen_file_def, sm_idx)
|
+genReadAckPktCode(gen_file_def, sm_idx)
|
||||||
|
|
||||||
|
+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("--清除中断")
|
+genMessageCode("--清除中断")
|
||||||
+genIFRwDataCode(0, 0x78, True, 4, clear_int)
|
+genIFRwDataCode(0, 0x78, True, 4, clear_int)
|
||||||
+genIFRwDataCode(1, 0x78, True, 4, clear_int)
|
+genIFRwDataCode(1, 0x78, True, 4, clear_int)
|
||||||
@@ -37,6 +44,13 @@ def tc1():
|
|||||||
+genIFRwDataCode(3, 0x78, True, 4, clear_int)
|
+genIFRwDataCode(3, 0x78, True, 4, clear_int)
|
||||||
+genIFRwDataCode(4, 0x78, True, 4, clear_int)
|
+genIFRwDataCode(4, 0x78, True, 4, clear_int)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
+genTcEndFrameCode(gen_file_def))
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
@@ -65,11 +79,34 @@ def tc2():
|
|||||||
|
|
||||||
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
||||||
|
|
||||||
|
clear_int = [0xff, 0xff, 0xff, 0xff]
|
||||||
|
|
||||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
+genReadAckPktCode(gen_file_def, sm_idx)
|
+genReadAckPktCode(gen_file_def, sm_idx)
|
||||||
|
|
||||||
|
+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, clear_int)
|
||||||
|
+genIFRwDataCode(1, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(2, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(3, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(4, 0x78, True, 4, clear_int)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
+genTcEndFrameCode(gen_file_def))
|
+genTcEndFrameCode(gen_file_def))
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
|
|
||||||
@@ -105,6 +142,8 @@ def tc3():
|
|||||||
|
|
||||||
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
||||||
|
|
||||||
|
clear_int = [0xff, 0xff, 0xff, 0xff]
|
||||||
|
|
||||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
@@ -116,6 +155,27 @@ def tc3():
|
|||||||
+genSlvSMReadData(3, 0, 16)
|
+genSlvSMReadData(3, 0, 16)
|
||||||
+genSlvSMReadData(4, 0, 16)
|
+genSlvSMReadData(4, 0, 16)
|
||||||
|
|
||||||
|
+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, clear_int)
|
||||||
|
+genIFRwDataCode(1, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(2, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(3, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(4, 0x78, True, 4, clear_int)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
+genTcEndFrameCode(gen_file_def))
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
@@ -128,32 +188,54 @@ def tc4():
|
|||||||
|
|
||||||
gen_file_def = "base_tc04"
|
gen_file_def = "base_tc04"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
tc_des = "发送错误的数据包,导致设备出问题,出问题的设备在没有恢复的情况下,采取直通状态。\\n" \
|
tc_des = "发送带有超出系统顺序地址和顺序编号的子包,子包中有写入、有读取;没有处理的包\\n" \
|
||||||
+ "清除中断后,错误消失,出问题的设备恢复正常。"
|
+ "其工作计数应为0。"
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#>>>>>>普通数据包,一个读、一个写,增加5个随机包(需要在文件里确认)
|
#>>>>>>普通数据包,一个读、一个写,增加5个随机包(需要在文件里确认)
|
||||||
genPkt.clean()
|
genPkt.clean()
|
||||||
genPkt.setPktType(0)
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||||
#genPkt.addSubPkt(0x02, 0, 0x0830, 0x2, 56, None)
|
|
||||||
genPkt.addSubPkt(0x01, 0, 0x0840, 0x1, 56, None)
|
genPkt.addSubPkt(0x01, 0, 0x0840, 0x1, 56, None)
|
||||||
genPkt.addSubPkt(0x03, 0, 0x1040, 0x0, 56, None)
|
genPkt.addSubPkt(0x03, 0, 0x1040, 0x0, 56, None)
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
genPkt.addSubPkt(random.randint(100, 4000), 0,
|
genPkt.addSubPkt(3288+i, 0,
|
||||||
random.randint(0, 65536), 0x0,
|
0xDF00+i, 0x0,
|
||||||
56, None)
|
56, None)
|
||||||
#genPkt.addSubPkt(10, 2, 0x300, 0x2, 4, None)
|
|
||||||
#genPkt.addSubPkt(11, 1, 0x300, 0x2, 4, None)
|
|
||||||
|
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
|
||||||
|
|
||||||
|
clear_int = [0xff, 0xff, 0xff, 0xff]
|
||||||
|
|
||||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
+genReadAckPktCode(gen_file_def, sm_idx)
|
+genReadAckPktCode(gen_file_def, sm_idx)
|
||||||
|
|
||||||
|
+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, clear_int)
|
||||||
|
+genIFRwDataCode(1, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(2, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(3, 0x78, True, 4, clear_int)
|
||||||
|
+genIFRwDataCode(4, 0x78, True, 4, clear_int)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
|
|
||||||
+genTcEndFrameCode(gen_file_def))
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
@@ -165,30 +247,31 @@ def tc5():
|
|||||||
|
|
||||||
gen_file_def = "base_tc05"
|
gen_file_def = "base_tc05"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
tc_des = "发送错误的数据包,导致设备出问题,出问题的设备在没有恢复的情况下,采取直通状态。\\n" \
|
tc_des = "发送单播子包,向4个从设备分别写入数据。\\n"
|
||||||
+ "清除中断后,错误消失,出问题的设备恢复正常。"
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#>>>>>>普通数据包0,用来操作sync
|
#>>>>>>普通数据包0,用来操作sync
|
||||||
genPkt.clean()
|
genPkt.clean()
|
||||||
genPkt.setPktType(0)
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
|
sm_size = 64
|
||||||
|
|
||||||
data = bytearray(b"\0"*100)
|
data = bytearray(b"\0"*100)
|
||||||
data[0] = 0 #0x0300
|
data[0] = 0 #0x0300
|
||||||
data[1] = 0 #0x0301
|
data[1] = 0 #0x0301
|
||||||
data[2] = 64 #0x302 长度1
|
data[2] = sm_size #0x302 长度1
|
||||||
data[3] = 0 #0x303 长度2
|
data[3] = 0 #0x303 长度2
|
||||||
data[4] = 0
|
data[4] = 0
|
||||||
data[5] = 0
|
data[5] = 0
|
||||||
data[6] = 64
|
data[6] = sm_size
|
||||||
data[7] = 0
|
data[7] = 0
|
||||||
data[8] = 0
|
data[8] = 0
|
||||||
data[9] = 0
|
data[9] = 0
|
||||||
data[10] = 64
|
data[10] = sm_size
|
||||||
data[11] = 0
|
data[11] = 0
|
||||||
data[12] = 0
|
data[12] = 0
|
||||||
data[13] = 0
|
data[13] = 0
|
||||||
data[14] = 64
|
data[14] = sm_size
|
||||||
data[15] = 0
|
data[15] = 0
|
||||||
|
|
||||||
|
|
||||||
@@ -198,33 +281,34 @@ def tc5():
|
|||||||
genPkt.addSubPkt(0x03, 0, 0x0310, 0x1, 4, data) #sm4
|
genPkt.addSubPkt(0x03, 0, 0x0310, 0x1, 4, data) #sm4
|
||||||
genPkt.addSubPkt(0x04, 0, 0x0318, 0x1, 4, data) #sm6
|
genPkt.addSubPkt(0x04, 0, 0x0318, 0x1, 4, data) #sm6
|
||||||
|
|
||||||
|
|
||||||
data = bytearray(b"\0"*100)
|
data = bytearray(b"\0"*100)
|
||||||
for i in range(64):
|
for i in range(sm_size):
|
||||||
data[i] = i
|
data[i] = i
|
||||||
data[10] = ord('B')
|
data[10] = ord('B')
|
||||||
data[11] = ord('A')
|
data[11] = ord('A')
|
||||||
genPkt.addSubPkt(0x02, 0, 0x0800, 0x1, 64, data)
|
genPkt.addSubPkt(0x02, 0, 0x0800, 0x1, sm_size, data)
|
||||||
|
|
||||||
data = bytearray(b"\0"*100)
|
data = bytearray(b"\0"*100)
|
||||||
for i in range(64):
|
for i in range(sm_size):
|
||||||
data[i] = i
|
data[i] = i
|
||||||
data[11] = ord('B')
|
data[11] = ord('B')
|
||||||
data[12] = ord('A')
|
data[12] = ord('A')
|
||||||
genPkt.addSubPkt(0x01, 0, 0x1800, 0x1, 64, data)
|
genPkt.addSubPkt(0x01, 0, 0x1800, 0x1, sm_size, data)
|
||||||
|
|
||||||
data = bytearray(b"\0"*100)
|
data = bytearray(b"\0"*100)
|
||||||
for i in range(64):
|
for i in range(sm_size):
|
||||||
data[i] = i
|
data[i] = i
|
||||||
data[12] = ord('B')
|
data[12] = ord('B')
|
||||||
data[13] = ord('A')
|
data[13] = ord('A')
|
||||||
genPkt.addSubPkt(0x03, 0, 0x2800, 0x1, 64, data)
|
genPkt.addSubPkt(0x03, 0, 0x2800, 0x1, sm_size, data)
|
||||||
|
|
||||||
data = bytearray(b"\0"*100)
|
data = bytearray(b"\0"*100)
|
||||||
for i in range(64):
|
for i in range(sm_size):
|
||||||
data[i] = i
|
data[i] = i
|
||||||
data[13] = ord('B')
|
data[13] = ord('B')
|
||||||
data[14] = ord('A')
|
data[14] = ord('A')
|
||||||
genPkt.addSubPkt(0x04, 0, 0x3800, 0x1, 64, data)
|
genPkt.addSubPkt(0x04, 0, 0x3800, 0x1, sm_size, data)
|
||||||
|
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
@@ -234,6 +318,33 @@ def tc5():
|
|||||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
+genReadAckPktCode(gen_file_def, sm_idx)
|
+genReadAckPktCode(gen_file_def, sm_idx)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
|
+genSlvSMReadData(1, 2, sm_size)
|
||||||
|
+genSlvSMReadData(2, 0, sm_size)
|
||||||
|
+genSlvSMReadData(3, 4, sm_size)
|
||||||
|
+genSlvSMReadData(4, 6, sm_size)
|
||||||
|
|
||||||
+genTcEndFrameCode(gen_file_def))
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
@@ -245,8 +356,7 @@ def tc6():
|
|||||||
|
|
||||||
gen_file_def = "base_tc06"
|
gen_file_def = "base_tc06"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
tc_des = "发送错误的数据包,导致设备出问题,出问题的设备在没有恢复的情况下,采取直通状态。\\n" \
|
tc_des = "从4个从站中读取数据,并从对应的位置读取SM1中的数据长度。\\n"
|
||||||
+ "清除中断后,错误消失,出问题的设备恢复正常。"
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#>>>>>>普通数据包2
|
#>>>>>>普通数据包2
|
||||||
@@ -254,7 +364,7 @@ def tc6():
|
|||||||
genPkt.setPktType(0)
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des)
|
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des)
|
||||||
+genSlvSMWriteData(3, 1, 129)
|
+ genSlvSMWriteData(3, 1, 129)
|
||||||
+ genSlvSMWriteData(4, 1, 140)
|
+ genSlvSMWriteData(4, 1, 140)
|
||||||
+ genSlvSMWriteData(1, 1, 128)
|
+ genSlvSMWriteData(1, 1, 128)
|
||||||
+ genSlvSMWriteData(2, 1, 152))
|
+ genSlvSMWriteData(2, 1, 152))
|
||||||
@@ -265,9 +375,9 @@ def tc6():
|
|||||||
genPkt.addSubPkt(1, 0, 0x1000, 0x0, 128, b"\0"*128)
|
genPkt.addSubPkt(1, 0, 0x1000, 0x0, 128, b"\0"*128)
|
||||||
genPkt.addSubPkt(2, 0, 0x1000, 0x0, 152, b"\0"*152)
|
genPkt.addSubPkt(2, 0, 0x1000, 0x0, 152, b"\0"*152)
|
||||||
genPkt.addSubPkt(1, 0, 0x0306, 0x0, 2, b"\0"*2)
|
genPkt.addSubPkt(1, 0, 0x0306, 0x0, 2, b"\0"*2)
|
||||||
genPkt.addSubPkt(2, 0, 0x030e, 0x0, 2, b"\0"*2)
|
genPkt.addSubPkt(2, 0, 0x0306, 0x0, 2, b"\0"*2)
|
||||||
genPkt.addSubPkt(3, 0, 0x0316, 0x0, 2, b"\0"*2)
|
genPkt.addSubPkt(3, 0, 0x0306, 0x0, 2, b"\0"*2)
|
||||||
genPkt.addSubPkt(4, 0, 0x031e, 0x0, 2, b"\0"*2)
|
genPkt.addSubPkt(4, 0, 0x0306, 0x0, 2, b"\0"*2)
|
||||||
|
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
|
|
||||||
@@ -275,6 +385,28 @@ def tc6():
|
|||||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
+genReadAckPktCode(gen_file_def, sm_idx)
|
+genReadAckPktCode(gen_file_def, sm_idx)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
+genTcEndFrameCode(gen_file_def))
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
@@ -288,8 +420,8 @@ def tc7():
|
|||||||
|
|
||||||
gen_file_def = "base_tc07"
|
gen_file_def = "base_tc07"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
tc_des = "发送错误的数据包,导致设备出问题,出问题的设备在没有恢复的情况下,采取直通状态。\\n" \
|
tc_des = "读写命令,写入0x100开始的32B寄存器,这32B寄存器实际上是只读寄存器。\\n" \
|
||||||
+ "清除中断后,错误消失,出问题的设备恢复正常。"
|
+ "检查是否真的写入,读取的值,子报文的状态。"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#>>>>>>普通数据包3
|
#>>>>>>普通数据包3
|
||||||
@@ -312,51 +444,39 @@ def tc7():
|
|||||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||||
+genReadAckPktCode(gen_file_def, sm_idx)
|
+genReadAckPktCode(gen_file_def, sm_idx)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
+genTcEndFrameCode(gen_file_def))
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
|
|
||||||
return gen_file_def
|
return gen_file_def
|
||||||
|
|
||||||
|
|
||||||
def tc8():
|
def tc8():
|
||||||
genPkt = GenPkt()
|
genPkt = GenPkt()
|
||||||
|
|
||||||
gen_file_def = "base_tc08"
|
gen_file_def = "base_tc08"
|
||||||
sm_idx = 0
|
sm_idx = 0
|
||||||
tc_des = "发送错误的数据包,导致设备出问题,出问题的设备在没有恢复的情况下,采取直通状态。\\n" \
|
|
||||||
+ "清除中断后,错误消失,出问题的设备恢复正常。"
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#>>>>>>设置顺序地址
|
|
||||||
genPkt.clean()
|
|
||||||
genPkt.setPktType(0)
|
|
||||||
|
|
||||||
data = bytearray(b"\0" * 2)
|
|
||||||
data[0] = 0x3f
|
|
||||||
data[1] = 0xff
|
|
||||||
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
|
||||||
genPkt.addSubPkt(0x0, 0, random.randint(0, 65535), 0xb, 2, data)
|
|
||||||
|
|
||||||
sm_idx = 0
|
|
||||||
|
|
||||||
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))
|
|
||||||
|
|
||||||
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
|
||||||
|
|
||||||
return gen_file_def
|
|
||||||
|
|
||||||
def tc9():
|
|
||||||
genPkt = GenPkt()
|
|
||||||
|
|
||||||
gen_file_def = "base_tc09"
|
|
||||||
sm_idx = 0
|
|
||||||
tc_des = "测试RESET,仅复位主站和2号设备;链路和网络被破坏;发送广播包只能到1,2;3,4收不到。\\n" \
|
tc_des = "测试RESET,仅复位主站和2号设备;链路和网络被破坏;发送广播包只能到1,2;3,4收不到。\\n" \
|
||||||
+ "通过嗅探包、设置顺序地址命令等重新建立网络。"
|
+ "通过嗅探包、设置顺序地址命令等重新建立网络。"
|
||||||
|
|
||||||
@@ -477,3 +597,222 @@ def tc9():
|
|||||||
|
|
||||||
|
|
||||||
return gen_file_def
|
return gen_file_def
|
||||||
|
|
||||||
|
|
||||||
|
def tc9():
|
||||||
|
genPkt = GenPkt()
|
||||||
|
|
||||||
|
gen_file_def = "base_tc09"
|
||||||
|
sm_idx = 0
|
||||||
|
tc_des = "发送超过带有64个子包的读。检查子包的状态、中断、统计等信息。"
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#>>>>>>设置顺序地址
|
||||||
|
genPkt.clean()
|
||||||
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
|
data = [0, ] * 32
|
||||||
|
#subPkt参数:索引、索引类型、地址、命令、长度、数据
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x5, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x5, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x5, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x5, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x6, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x6, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x6, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x6, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0000, 0x0, 4, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0100, 0x0, 8, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0200, 0x0, 16, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0300, 0x0, 4, data)
|
||||||
|
|
||||||
|
data = [0, ] * 128
|
||||||
|
genPkt.addSubPkt(0x1, 0, 0x0180, 0x0, 128, data)
|
||||||
|
genPkt.addSubPkt(0x2, 0, 0x0180, 0x0, 128, data)
|
||||||
|
genPkt.addSubPkt(0x3, 0, 0x0180, 0x0, 128, data)
|
||||||
|
genPkt.addSubPkt(0x4, 0, 0x0180, 0x0, 128, data)
|
||||||
|
|
||||||
|
sm_idx = 0
|
||||||
|
|
||||||
|
custom_data1 = list(range(1, 129))
|
||||||
|
custom_data2 = list(range(1*2, 129*2, 2))
|
||||||
|
custom_data3 = list(range(1*3, 129*3, 3))
|
||||||
|
custom_data4 = list(range(1*4, 129*4, 4))
|
||||||
|
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des)
|
||||||
|
+genIFRwDataCode(1, 0x180, True, 128, custom_data1)
|
||||||
|
+genIFRwDataCode(2, 0x180, True, 128, custom_data2)
|
||||||
|
+genIFRwDataCode(3, 0x180, True, 128, custom_data3)
|
||||||
|
+genIFRwDataCode(4, 0x180, True, 128, custom_data4)
|
||||||
|
)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
|
+genTcEndFrameCode(gen_file_def))
|
||||||
|
|
||||||
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
|
|
||||||
|
return gen_file_def
|
||||||
|
|
||||||
|
def tc10():
|
||||||
|
genPkt = GenPkt()
|
||||||
|
|
||||||
|
gen_file_def = "base_tc10"
|
||||||
|
sm_idx = 0
|
||||||
|
tc_des = "发送超过带有64个子包的读。检查子包的状态、中断、统计等信息。"
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#>>>>>>设置顺序地址
|
||||||
|
genPkt.clean()
|
||||||
|
genPkt.setPktType(0)
|
||||||
|
|
||||||
|
for i in range(1, 5):
|
||||||
|
data = [0, ] * 32
|
||||||
|
genPkt.addSubPkt(i, 0, 0x0302, 1, 2, [0x40, 0x00])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x0800, 1, 4, [i + 1, 2, 3, 4])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x0804, 1, 4, [5, 6, 7, 8])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x0808, 1, 4, [9, 10, 11, 12])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x080c, 1, 4, [13, 14, 15, 16])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x0810, 1, 4, [17, 18, 19, 20])
|
||||||
|
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, 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])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x0830, 1, 4, [17, 18, 19, 20])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x0834, 1, 4, [21, 22, 23, 24])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x0838, 1, 4, [25, 26, 27, 28])
|
||||||
|
genPkt.addSubPkt(i, 0, 0x083c, 1, 4, [29, 30, 31, 32])
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
+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)
|
||||||
|
|
||||||
|
+genSlvSMReadData(1, 0, 0x40)
|
||||||
|
+genSlvSMReadData(2, 0, 0x40)
|
||||||
|
+genSlvSMReadData(3, 0, 0x40)
|
||||||
|
+genSlvSMReadData(4, 0, 0x40)
|
||||||
|
|
||||||
|
+genTcEndFrameCode(gen_file_def)
|
||||||
|
)
|
||||||
|
|
||||||
|
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
|
||||||
|
|
||||||
|
return gen_file_def
|
||||||
Reference in New Issue
Block a user