修改配套的测试用例和程序,默认上电使用8b10b

This commit is contained in:
2025-10-13 15:56:03 +08:00
parent e4a78182df
commit 80cf9ed40b
3 changed files with 11 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ if __name__ == '__main__':
parser.add_argument("-d2", "--dev2", nargs=2, type=int, default=[0, 0], help="相位(度)、频率偏差ppm") parser.add_argument("-d2", "--dev2", nargs=2, type=int, default=[0, 0], help="相位(度)、频率偏差ppm")
parser.add_argument("-d3", "--dev3", nargs=2, type=int, default=[0, 0], help="相位(度)、频率偏差ppm") parser.add_argument("-d3", "--dev3", nargs=2, type=int, default=[0, 0], help="相位(度)、频率偏差ppm")
parser.add_argument("-d4", "--dev4", nargs=2, type=int, default=[0, 0], help="相位(度)、频率偏差ppm") parser.add_argument("-d4", "--dev4", nargs=2, type=int, default=[0, 0], help="相位(度)、频率偏差ppm")
parser.add_argument("-8b10b", action="store_true", dest="use_8b10b", default=False, help="使用8b10b编码") parser.add_argument("-4b5b", action="store_true", dest="use_4b5b", default=False, help="使用4b5b编码")
parser.add_argument("-spi", dest="spi_type", type=int, default=0, help="选择SPI0:ISPI;1:OSPI;2:OQSPI;3:AQSPI") parser.add_argument("-spi", dest="spi_type", type=int, default=0, help="选择SPI0:ISPI;1:OSPI;2:OQSPI;3:AQSPI")
parser.add_argument("-cdr", dest="cdr_type", type=int, default=0, help="选择CDR") parser.add_argument("-cdr", dest="cdr_type", type=int, default=0, help="选择CDR")
@@ -35,14 +35,14 @@ if __name__ == '__main__':
environment.set_dev_clk(dev_clk_info) environment.set_dev_clk(dev_clk_info)
environment.set_spi_interface(args.spi_type) environment.set_spi_interface(args.spi_type)
environment.set_using_8b10b(args.use_8b10b) environment.set_using_transcode(args.use_4b5b)
environment.set_cdr_type(args.cdr_type) environment.set_cdr_type(args.cdr_type)
environment.gen_slv_dev_for_clk(4) environment.gen_slv_dev_for_clk(4)
environment.bringup() environment.bringup()
if args.use_8b10b: if args.use_4b5b:
add_tc_2_runlist(rwregs.tc1()) add_tc_2_runlist(rwregs.tc1())
#add_tc_2_runlist(errorPkt.tc1()) #add_tc_2_runlist(errorPkt.tc1())

View File

@@ -3,7 +3,7 @@ from pyutils import *
global_dev_num = 4 global_dev_num = 4
global_setting_dev_clk = dict() global_setting_dev_clk = dict()
global_using_8b10b = False global_using_4b5b = False
global_spi_type = 0 global_spi_type = 0
global_cdr_type = 0 global_cdr_type = 0
@@ -452,22 +452,22 @@ def set_spi_interface(spi_type):
global global_spi_type global global_spi_type
global_spi_type = spi_type global_spi_type = spi_type
def set_using_8b10b(isUsing8b10b): def set_using_transcode(isUsing4b5b):
global global_using_8b10b global global_using_4b5b
global_using_8b10b = isUsing8b10b global_using_4b5b = isUsing4b5b
def set_cdr_type(cdr_type): def set_cdr_type(cdr_type):
global global_cdr_type global global_cdr_type
global_cdr_type = cdr_type global_cdr_type = cdr_type
def using_proper_workmode(dev, iface=1): def using_proper_workmode(dev, iface=1):
global global_using_8b10b global global_using_4b5b
global global_spi_type global global_spi_type
global global_cdr_type global global_cdr_type
trans_code = 0x0 trans_code = 0x0
if global_using_8b10b: if global_using_4b5b:
trans_code = 0x1 trans_code = 0x1
return genIFRwDataCode(dev, 0x09, True, 1, [global_spi_type, ], wlog=False, iface=iface)\ return genIFRwDataCode(dev, 0x09, True, 1, [global_spi_type, ], wlog=False, iface=iface)\

View File

@@ -99,7 +99,7 @@ def watchdog_test_sm_lvds_wr_timeout(tc_id, wd_id):
+genMessageCode("--复位数据缓冲区") +genMessageCode("--复位数据缓冲区")
+genIFRwDataCode(1, 0x300 + slave_sm_id * 4, True, 1, [0, ]) +genIFRwDataCode(1, 0x300 + slave_sm_id * 4, True, 1, [0, ])
+genMessageCode("--延时后检查看门狗寄存器") +genMessageCode("--延时后检查看门狗寄存器")
+"#1200000\n" +"#2000000\n"
+genIFRwDataCode(1, 0x400, False, 0x04) +genIFRwDataCode(1, 0x400, False, 0x04)
+genTcEndFrameCode(gen_file_def)) +genTcEndFrameCode(gen_file_def))
@@ -180,7 +180,7 @@ def watchdog_test_sm_lvds_wr_no_timeout(tc_id, wd_id):
+genMessageCode("--复位数据缓冲区") +genMessageCode("--复位数据缓冲区")
+genIFRwDataCode(1, 0x300 + slave_sm_id * 4, True, 1, [0, ]) +genIFRwDataCode(1, 0x300 + slave_sm_id * 4, True, 1, [0, ])
+genMessageCode("--延时后检查看门狗寄存器") +genMessageCode("--延时后检查看门狗寄存器")
+"#1200000\n" +"#2000000\n"
+genIFRwDataCode(1, 0x400, False, 0x04) +genIFRwDataCode(1, 0x400, False, 0x04)
+genTcEndFrameCode(gen_file_def)) +genTcEndFrameCode(gen_file_def))