修改测试用例,SPI/QSPI的测试用例应该过了
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user