修改测试用例,SPI/QSPI的测试用例应该过了

This commit is contained in:
2025-09-22 00:58:34 +08:00
parent d19c7e8481
commit 2c1627b215
7 changed files with 60 additions and 37 deletions

View File

@@ -510,8 +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_transcode(0)
+using_proper_transcode(2)
+using_proper_workmode(0)
+using_proper_workmode(2)
+genMessageCode("--读取中断")
+genIFRwDataCode(0, 0x74, False, 4)
@@ -2120,8 +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_transcode(0)
+using_proper_transcode(4)
+using_proper_workmode(0)
+using_proper_workmode(4)
+genMessageCode("--读取中断")
+genIFRwDataCode(0, 0x74, False, 4)
@@ -2336,8 +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_transcode(0)
+using_proper_transcode(4)
+using_proper_workmode(0)
+using_proper_workmode(4)
+genMessageCode("--读取中断")
+genIFRwDataCode(0, 0x74, False, 4)
@@ -2627,7 +2627,7 @@ def tc31():
+genIFRwDataCode(4, 0x40, True, 4, [0x01, 0x00, 0x66, 0x79])
+"#5000"
+genIFRwDataCode(4, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_transcode(4)
+using_proper_workmode(4)
+genIFRwDataCode(4, 0x0, True, 1, [1, ])
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
#+genEnableInsertTimeCode(0xa)
@@ -2825,7 +2825,7 @@ def tc31():
+genIFRwDataCode(0, 0x40, True, 4, [0x01, 0x00, 0x66, 0x79])
+"#5000\n"
+genIFRwDataCode(0, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_transcode(0)
+using_proper_workmode(0)
+genIFRwDataCode(0, 0x0, True, 1, [1, ])
+genIFRwDataCode(0, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genIFRwDataCode(0, 0x7c, True, 2, [0x10, 0x80])
@@ -3009,7 +3009,7 @@ def tc31():
+genIFRwDataCode(4, 0x40, True, 4, [0x01, 0x00, 0x66, 0x79])
+"#5000"
+genIFRwDataCode(4, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_transcode(4)
+using_proper_workmode(4)
+genIFRwDataCode(4, 0x00, True, 1, [2, ])
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
)

View File

@@ -4,6 +4,7 @@ from pyutils import *
global_dev_num = 4
global_setting_dev_clk = dict()
global_using_8b10b = False
global_spi_type = 0
def bringup():
gen_file_def = "sys_bringup"
@@ -30,11 +31,11 @@ def bringup():
+genIFRwDataCode(3, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genMessageCode("--设置合适的底层编码4b5b or 8b10b")
+using_proper_transcode(0)
+using_proper_transcode(1)
+using_proper_transcode(2)
+using_proper_transcode(3)
+using_proper_transcode(4)
+using_proper_workmode(0)
+using_proper_workmode(1)
+using_proper_workmode(2)
+using_proper_workmode(3)
+using_proper_workmode(4)
)
main_dev = [0x01, ]
@@ -265,11 +266,24 @@ def __GenDevice(id, TerminateNode = False):
def __gen_slv_dev_predef(num):
global global_setting_dev_clk
global global_spi_type
code_for_clk = ""
for k in global_setting_dev_clk:
code_for_clk = code_for_clk + "reg [15:0] multiCLK%d;\n"%(k, )
code_predef =("`define DEV_NUM %d //slave num\n"%(num, )
spi_type_str = "USING_IQSPI"
if global_spi_type == 1:
spi_type_str = "USING_OSPI"
elif global_spi_type == 2:
spi_type_str = "USING_OQSPI"
elif global_spi_type == 3:
spi_type_str = "USING_AQSPI"
else:
spi_type_str = "USING_IQSPI"
code_predef =("`define %s\n"%(spi_type_str, )
+"`define DEV_NUM %d //slave num\n"%(num, )
+"`define ALL_DEV_NUM (`DEV_NUM + 1) // slave + master\n"
+"`define SPI_CSN_NUM (`ALL_DEV_NUM * 4)\n\n"
@@ -427,16 +441,23 @@ def teardown():
#add_tc_2_runlist("")
pass
def set_spi_interface(spi_type):
global global_spi_type
global_spi_type = spi_type
def set_using_8b10b(isUsing8b10b):
global global_using_8b10b
global_using_8b10b = isUsing8b10b
def using_proper_transcode(dev):
def using_proper_workmode(dev):
global global_using_8b10b
global global_spi_type
trans_code = 0x0
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)
trans_code = 0x1
return genIFRwDataCode(dev, 0x004c, True, 2, [0x1, 0x59], wlog = False)+genIFRwDataCode(dev, 0x4e, True, 2, [global_spi_type, 0x60], wlog=False, iface=1)

View File

@@ -58,7 +58,7 @@ def tc1():
default_trans_code = ""
for i in range(dev_num + 1):
default_trans_code = default_trans_code + using_proper_transcode(i)
default_trans_code = default_trans_code + using_proper_workmode(i)
genPkt.addAfterExc(genMessageCode("--正确的key")
+change_8b10b_code1

View File

@@ -834,7 +834,7 @@ def tc5():
+genIFRwDataCode(3, 0xc0, False, 4)
+genIFRwDataCode(4, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_transcode(4)
+using_proper_workmode(4)
+genIFRwDataCode(4, 0x00, True, 1, [0x2, ])
+genIFRwDataCode(4, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
@@ -1338,7 +1338,7 @@ def tc7():
genPkt.addBeforeExc("\n#5000\n"
+genIFRwDataCode(0, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_transcode(0)
+using_proper_workmode(0)
+genIFRwDataCode(0, 0x74, False, 4)
#+genIFRwDataCode(0, 0x40, False, 4)
@@ -1771,14 +1771,14 @@ def tc8():
genPkt.addBeforeExc("\n#5000\n"
+genIFRwDataCode(0, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_transcode(0)
+using_proper_workmode(0)
+genIFRwDataCode(0, 0x74, False, 4)
+genIFRwDataCode(0, 0x00, True, 1, [0x1, ])
+genIFRwDataCode(0, 0x78, True, 4, [0xff, 0xff, 0xff, 0xff])
+genIFRwDataCode(1, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_transcode(1)
+using_proper_workmode(1)
+genIFRwDataCode(1, 0x74, False, 4)
+genIFRwDataCode(1, 0x00, True, 1, [0x2, ])
@@ -1863,7 +1863,7 @@ def tc8():
genPkt.addBeforeExc("\n#5000\n"
+genIFRwDataCode(0, 0x09, True, 1, [0, ], False, iface=1)
+using_proper_transcode(0)
+using_proper_workmode(0)
+genIFRwDataCode(0, 0x74, False, 4)
#+genIFRwDataCode(0, 0x40, False, 4)