生成测试用例数据的python代码太长了,利用python的包等结构分割代码,当前初步做了分割
This commit is contained in:
21
tb/shinTest/testcase/readregs.py
Normal file
21
tb/shinTest/testcase/readregs.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from pyutils import *
|
||||
import time
|
||||
import random
|
||||
|
||||
def tc1():
|
||||
random.seed(int(time.time() * 1000))
|
||||
genPkt = GenPkt()
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#>>>>>>嗅探数据包1,正常的嗅探数据包
|
||||
genPkt.clean()
|
||||
genPkt.setPktType(1)
|
||||
gen_file_def = "test_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)
|
||||
print("it's a test")
|
||||
Reference in New Issue
Block a user