增加一个随机错误包的发送
This commit is contained in:
@@ -334,6 +334,52 @@ if __name__ == '__main__':
|
||||
gen_file_def = "detect_err_pkt"
|
||||
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)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#>>>>>>错误的数据包1
|
||||
genPkt.clean()
|
||||
|
||||
data = list()
|
||||
'''
|
||||
for i in range(128):
|
||||
data.append(random.randint(0, 255))
|
||||
'''
|
||||
data = data + [0x57, 0x17, 0xfd, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40]
|
||||
for i in range(64):
|
||||
data.append(random.randint(0, 255))
|
||||
data = data + [0, 0, 0x00, 0x0c, 0x00, 0xc0, 0x00, 0x40]
|
||||
for i in range(64):
|
||||
data.append(random.randint(0, 255))
|
||||
data = data + [0, 0]
|
||||
|
||||
genPkt.setPkt(2, data)
|
||||
gen_file_def = "err_pkt1"
|
||||
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)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#>>>>>>错误的数据包2
|
||||
genPkt.clean()
|
||||
|
||||
data = list()
|
||||
for i in range(256):
|
||||
data.append(random.randint(0, 255))
|
||||
|
||||
genPkt.setPkt(2, data)
|
||||
gen_file_def = "err_pkt2"
|
||||
sm_idx = 0
|
||||
|
||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||
+genTrgTransPktCode(gen_file_def, sm_idx)
|
||||
|
||||
Reference in New Issue
Block a user