修改测试用例结束的条件;修正同步测试用例
This commit is contained in:
@@ -238,7 +238,16 @@ if __name__ == '__main__':
|
||||
genPkt.addSubPkt(0x03, 0, 0xc0, 0x0, 64, None)
|
||||
#genPkt.addSubPkt(10, 2, 0x300, 0x2, 4, None)
|
||||
#genPkt.addSubPkt(11, 1, 0x300, 0x2, 4, None)
|
||||
genPkt.gen("./generated/shin/sm1_pkt.vh", 1)
|
||||
|
||||
gen_file_def = "sm1_pkt"
|
||||
sm_idx = 1
|
||||
|
||||
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)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -251,7 +260,16 @@ if __name__ == '__main__':
|
||||
genPkt.addSubPkt(0x01, 0, 0x00, 0xd, 128, None)
|
||||
#genPkt.addSubPkt(10, 2, 0x300, 0x2, 4, None)
|
||||
#genPkt.addSubPkt(11, 1, 0x300, 0x2, 4, None)
|
||||
genPkt.gen("./generated/shin/sm2_pkt.vh", 1)
|
||||
|
||||
|
||||
gen_file_def = "sm2_pkt"
|
||||
sm_idx = 2
|
||||
|
||||
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)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -270,7 +288,15 @@ if __name__ == '__main__':
|
||||
data[i] = i + 1
|
||||
genPkt.addSubPkt(random.randint(0, 2048), 0, 0x0800, 0xe, 16, data) #0x1800, 0xe, 16, data)
|
||||
|
||||
genPkt.gen("./generated/shin/sm3_pkt.vh", 1)
|
||||
gen_file_def = "sm3_pkt"
|
||||
sm_idx = 3
|
||||
|
||||
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)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -288,7 +314,16 @@ if __name__ == '__main__':
|
||||
56, None)
|
||||
#genPkt.addSubPkt(10, 2, 0x300, 0x2, 4, None)
|
||||
#genPkt.addSubPkt(11, 1, 0x300, 0x2, 4, None)
|
||||
genPkt.gen("./generated/shin/seq_0_pkt.vh", 1)
|
||||
|
||||
|
||||
gen_file_def = "seq_0_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)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#>>>>>>普通数据包0,用来操作sync
|
||||
@@ -348,7 +383,16 @@ if __name__ == '__main__':
|
||||
data[14] = ord('A')
|
||||
genPkt.addSubPkt(0x04, 0, 0x3800, 0x1, 64, data)
|
||||
|
||||
genPkt.gen("./generated/shin/seq_1_pkt.vh", 1)
|
||||
|
||||
gen_file_def = "seq_1_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)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#>>>>>>普通数据包2
|
||||
@@ -365,7 +409,15 @@ if __name__ == '__main__':
|
||||
genPkt.addSubPkt(3, 0, 0x0316, 0x0, 2, b"\0"*2)
|
||||
genPkt.addSubPkt(4, 0, 0x031e, 0x0, 2, b"\0"*2)
|
||||
|
||||
genPkt.gen("./generated/shin/seq_2_pkt.vh", 1)
|
||||
gen_file_def = "seq_2_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)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#>>>>>>同步数据包
|
||||
@@ -402,9 +454,19 @@ if __name__ == '__main__':
|
||||
data[37] = 0x00
|
||||
|
||||
genPkt.addSubPkt(random.randint(0, 2048), 0, 0x120, 0xe, 0x28, data)
|
||||
|
||||
|
||||
genPkt.gen("./generated/shin/sync_sig_pkt.vh", 1)
|
||||
gen_file_def = "sync_sig_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)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -465,6 +527,29 @@ if __name__ == '__main__':
|
||||
data[37] = 0x0
|
||||
|
||||
genPkt.addSubPkt(3, 0, 0x120, 0x1, 0x28, data)
|
||||
|
||||
data = [0,] * 100 #bytearray(b"\0" * 100)
|
||||
data[0] = 0x0f #地址0x120
|
||||
data[2] = 0xa
|
||||
data[4] = 0xa
|
||||
data[6] = 0xa
|
||||
data[8] = 0xa
|
||||
|
||||
data[16] = '''(_temp_time & 8'hff)''' #地址0x130, sync同步点
|
||||
data[17] = '''(_temp_time >> 8) & 8'hff''' #地址0x131
|
||||
data[18] = '''(_temp_time >> 16) & 8'hff'''
|
||||
data[19] = '''(_temp_time >> 24) & 8'hff'''
|
||||
|
||||
data[24] = 0x00 #地址0x138, sync周期 4B
|
||||
data[25] = 0x02 #地址0x139
|
||||
|
||||
data[28] = 0x0 #sync1偏移
|
||||
data[29] = 0x0
|
||||
|
||||
data[36] = 0x0 #sync3偏移
|
||||
data[37] = 0x0
|
||||
|
||||
genPkt.addSubPkt(4, 0, 0x120, 0x1, 0x28, data)
|
||||
|
||||
genPkt.addAfterExc(genWriteTransLenCode(gen_file_def, sm_idx)
|
||||
+genWriteTransPktCode(gen_file_def, sm_idx)
|
||||
|
||||
Reference in New Issue
Block a user