增加8b10b的测试用例,并与4b5b共享测试用例

This commit is contained in:
2025-09-09 01:21:02 +08:00
parent b51b56688a
commit 58b65da129
9 changed files with 104 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
from pyutils import *
from .environment import *
def tc1():
genPkt = GenPkt()
@@ -510,6 +510,8 @@ def tc8():
+"\n#5000\n"
+genIFRwDataCode(0, 0x09, True, 1, [0, ], False, iface=1)
+genIFRwDataCode(2, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_code(0)
+using_proper_code(2)
+genMessageCode("--读取中断")
+genIFRwDataCode(0, 0x74, False, 4)
@@ -2118,6 +2120,8 @@ def tc28():
+"#5000"
+genIFRwDataCode(0, 0x09, True, 1, [0, ], False, iface=1)
+genIFRwDataCode(4, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_code(0)
+using_proper_code(4)
+genMessageCode("--读取中断")
+genIFRwDataCode(0, 0x74, False, 4)
@@ -2332,6 +2336,8 @@ def tc28():
+"#5000"
+genIFRwDataCode(0, 0x09, True, 1, [0, ], False, iface=1)
+genIFRwDataCode(4, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_code(0)
+using_proper_code(4)
+genMessageCode("--读取中断")
+genIFRwDataCode(0, 0x74, False, 4)

View File

@@ -3,8 +3,7 @@ from pyutils import *
global_dev_num = 4
global_setting_dev_clk = dict()
global_using_8b10b = False
def bringup():
gen_file_def = "sys_bringup"
@@ -30,6 +29,12 @@ def bringup():
+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("--设置合适的底层编码4b5b or 8b10b")
+using_proper_code(0)
+using_proper_code(1)
+using_proper_code(2)
+using_proper_code(3)
+using_proper_code(4)
)
main_dev = [0x01, ]
@@ -404,4 +409,18 @@ def __gen_slv_clk(clk, ph, period):
def teardown():
#add_tc_2_runlist("")
pass
pass
def set_using_8b10b(isUsing8b10b):
global global_using_8b10b
global_using_8b10b = isUsing8b10b
def using_proper_code(dev):
global global_using_8b10b
if global_using_8b10b:
return genIFRwDataCode(dev, 0x004c, True, 2, [0x1, 0x59], wlog = False)
else:
return genIFRwDataCode(dev, 0x004c, True, 2, [0x0, 0x59], wlog = False)

View File

@@ -30,3 +30,31 @@ def tc1():
+genTcEndFrameCode(gen_file_def))
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
return gen_file_def
def tc2():
gen_file_def = "regtest_tc02"
sm_idx = 0
tc_des = "测试寄存器的读写状态将系统改为4B5B进行通信\\n"
genPkt = GenPkt()
genPkt.clean()
dev_num = get_slv_dev_num()
genPkt.addBeforeExc(genTcStartFrameCode(gen_file_def, tc_des))
change_4b5b_code = ""
for i in range(dev_num + 1):
change_4b5b_code = change_4b5b_code + genIFRwDataCode(i, 0x004c, True, 2, [0x0, 0x59])\
+genIFRwDataCode(i, 0x004c, False, 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)
change_4b5b_code
+genTcEndFrameCode(gen_file_def))
genPkt.gen("./generated/shin/%s.vh"%(gen_file_def, ), 1)
return gen_file_def

View File

@@ -1,5 +1,5 @@
from pyutils import *
from .environment import *
def tc1():
genPkt = GenPkt()
@@ -822,6 +822,7 @@ def tc5():
+genIFRwDataCode(3, 0xc0, False, 4)
+genIFRwDataCode(4, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_code(4)
+genIFRwDataCode(4, 0x00, True, 1, [0x2, ])
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
@@ -1319,9 +1320,10 @@ def tc7():
genPkt.addBeforeExc("\n#5000\n"
+genIFRwDataCode(0, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_code(0)
+genIFRwDataCode(0, 0x74, False, 4)
+genIFRwDataCode(0, 0x40, False, 4)
#+genIFRwDataCode(0, 0x40, False, 4)
+genIFRwDataCode(0, 0x00, True, 1, [0x1, ])
)