#For use with TSW14J5x board, set sysParams.jesdABLvdsSync/sysParams.jesdCDLvdsSync to 1 sysParams.__init__() setupParams.selectedDut=1 if boardType in ("EVM","HSC1373"): if setupParams.selectedDut==1: AFE=AFE1 device=device1 logDumpInst=logDumpInst1 else: AFE=AFE0 device=device0 logDumpInst=logDumpInst0 else: setupParams.selectedDut=0 sysParams=AFE.systemParams device.hardReadAlways=False ##### PLL & LO curr_lo = 850 sysParams.rxAdcBw=100 sysParams.FRef = 245.76 sysParams.Fs = 2949.12 sysParams.pllMuxModes = 2 #0: 4T4R Mode with PLL0 as Master. PLL 0 for all the LOs. #1: 4T4R Mode with PLL2 as Master. PLL 2 for all the LOs. #2: 4T4R FDD Mode. PLL0 for TX and PLL2 for RX. #3: 2*2T2R FDD Mode: PLL0 AB-TX;PLL3 AB-RX; PLL2 CD TX; PLL4 CD RX #4: 2T2R FDD - TDD Mode: PLL0 AB-TX; PLL3-AB-RX; PLL2 CD sysParams.pllLo = [curr_lo,sysParams.Fs,815,1720,1810] #PLL Frequencies for PLLs [0,1,2,3,4] sysParams.setTxLoFbNcoFreqForTxCalib = True sysParams.mode2t2r = 1 ## In below parameters, first in the array is for first 2T2R1F and second 2T2R1F. # JESD and Serdes Parameters sysParams.useSpiSysref = False sysParams.LMFSHdRx = ["14810","14810"] sysParams.LMFSHdFb = ["12820","12820"] sysParams.LMFSHdTx = ["24410","24410"] sysParams.systemMode = [1,1] # 0-Identical, 1-FDD, 2-TDD sysParams.dedicatedLaneMode = [1,1] sysParams.enableRxFbJesdLanes = [0x3,0x0]#[0x5,0x1] sysParams.enableTxJesdLanes = [0x3,0x0] sysParams.enableFbcd = 0 sysParams.jesdProtocol = 0#1 # -0:B; 1:H; 2:C sysParams.serdesFirmware = True sysParams.jesdTxLaneMux = [0,2,1,3,4,5,6,7]#[0,4,1,5,2,3,6,7]#[0,1,4,5,2,3,6,7] # RX1,RX2,FB1,FB2 on STX1...STX4 sysParams.jesdRxLaneMux = [0,1,4,5,2,3,6,7] # TX1,TX2 on SRX1...SRX4 sysParams.jesdRxRbd = [15, 15] sysParams.jesdScr = [True,True] sysParams.serdesTxLanePolarity = [False,False,False,False,False,False,False,False] sysParams.serdesRxLanePolarity = [False,False,False,False,False,False,False,False] sysParams.jesdK = [32]*2 sysParams.syncLoopBack = 1 sysParams.jesdLoopbackEn = 0 sysParams.jesdTxRxABSyncMux = 0 sysParams.jesdTxRxCDSyncMux = 3 #NA sysParams.jesdTxFBABSyncMux = 1 sysParams.jesdTxFBCDSyncMux = 2 #NA sysParams.jesdRxABSyncMux = 0 sysParams.jesdRxCDSyncMux = 1 #NA sysParams.jesdABLvdsSync = 0 sysParams.jesdCDLvdsSync = 0 sysParams.useOnlyAbSide = 1 # Decimation and interpolation Parameters sysParams.ddcFactorRx = [24]*2#[12]*2 sysParams.ddcFactorFb = [12]*2 sysParams.ducFactorTx = [12]*2 sysParams.fbNco = [curr_lo,curr_lo] sysParams.fbNcoBand1 = [0,0] sysParams.lowIfNcoRx = [0,0] sysParams.lowIfNcoTx = [0,0] sysParams.lowIfNcoFb = [0,0] LMKParams.pllEn = True #sysParams.txIqmcExternalDelayValue=[0x4f7,0x4f7,0x4f7,0x4f7] LMKParams.lmkFrefClk = True #LMKParams.inputClk = 1474.56 LMKParams.sysrefFreq = 0.96 for i in range(4): sysParams.agcRegConfigParams[i]['enableIa']=1 #Enable Internal AGC for RX sysParams.agcRegConfigParams[i]['dgcEnable']=1 sysParams.agcRegConfigParams[i]['dgcMode']=3 sysParams.agcRegConfigParams[i]['coarseIndexBits'] = 4 sysParams.agcRegConfigParams[i]['coarseStep'] = 6 sysParams.agcRegConfigParams[i]['enableEl']=0 sysParams.agcRegConfigParams[i]['thresholdSa']=-3 sysParams.agcRegConfigParams[i]['windowLenSa']=256 sysParams.agcRegConfigParams[i]['stepSizeSa']=1 sysParams.agcRegConfigParams[i]['numHitsSa']=32 sysParams.agcRegConfigParams[i]['enableSa']=1 sysParams.agcRegConfigParams[i]['thresholdSd']=-7 sysParams.agcRegConfigParams[i]['windowLenSd']=512 sysParams.agcRegConfigParams[i]['stepSizeSd']=1 sysParams.agcRegConfigParams[i]['numHitsSd']=32 sysParams.agcRegConfigParams[i]['enableSd']=1 sysParams.agcRegConfigParams[i]['thresholdBa']=-2 sysParams.agcRegConfigParams[i]['windowLenBa']=128 sysParams.agcRegConfigParams[i]['stepSizeBa']=3 sysParams.agcRegConfigParams[i]['numHitsBa']=32 sysParams.agcRegConfigParams[i]['enableBa']=1 sysParams.agcRegConfigParams[i]['thresholdBd']=-6 sysParams.agcRegConfigParams[i]['windowLenBd']=256 sysParams.agcRegConfigParams[i]['stepSizeBd']=3 sysParams.agcRegConfigParams[i]['numHitsBd']=32 sysParams.agcRegConfigParams[i]['enableBd']=1 #GPIO assignment sysParams.gpioMapping={ 'U18': u'tx_fb_loop_1', 'T18': u'tx_fb_loop_2', 'U17': u'tx_fb_loop_3', 'V18': u'tx_fb_loop_0', 'D15': u'fb_nco_sw', 'T13': u'tdd_1f_en_ab', 'V13': u'tdd_2r_en_ab', 'C13': u'tdd_2r_en_cd', 'U14': u'tdd_2t_en_ab', 'D14': u'tdd_2t_en_cd', 'V5': u'adc_sync_n_ab_0', 'C5': u'adc_sync_n_cd_0', 'U5': u'adc_sync_n_ab_1', 'D5': u'adc_sync_n_cd_1', 'Y5': u'dac_sync_n_ab_0', 'A5': u'dac_sync_n_cd_0', 'W5': u'dac_sync_n_ab_1', 'B5': u'dac_sync_n_cd_1', 'E17': u'alarm_2', 'C17': u'alarm_1', 'E16': u'global_pdn' } sysParams.gpioConfigMode=3 #end GPIO assignment #Calibrations sysParams.enableRxDsaFactoryCal = False sysParams.enableTxDsaFactoryCal = False sysParams.enableTxIqmcLolTrackingCorr = True sysParams.enableRxIqmcLolTrackingCorr = True sysParams.txIqMcCalibMode = 0 # 0 -Single Fb Mode FB AB ; 1 -Single Fb Mode FB CD ; 2- Dual Fb_Mode sysParams.txDsaCalibMode = 0 sysParams.rxDsaCalibMode = 0 setupParams.skipFpga=0 setupParams.skipLmk=0 logDumpInst.setFileName(ASTERIX_DIR+DEVICES_DIR+r"\Hongxin_2t2r1fb_singleband_FDD_MU_configurationfile_0202.txt") logDumpInst.logFormat=0x4 logDumpInst.rewriteFile=1 logDumpInst.ignoreLogComments=0 logDumpInst.enableReadCheck=True logDumpInst.enableReads= False device.rawWriteLogEn=1 device.rewriteFile=1 device.rawWriteLogsFile=ASTERIX_DIR+DEVICES_DIR+r"\test.txt"#"D:\AFE77xx_config/testBroadcast.txt" lmk.rawWriteLogEn=1 lmk.rawWriteLogsFile=device.rawWriteLogsFile # AFE.initializeConfig() AFE.deviceBringup() ''' # power down TX B & D, RX B&D device.TOP.TOP_ANA_CTRL.TOP_ANA_CTRL.po_common_to_2r_rxab_spare_0.PDN_GBL_RXB = 1 device.TOP.TOP_ANA_CTRL.TOP_ANA_CTRL.po_common_to_2r_rxcd_spare_0.PDN_GBL_RXD = 1 device.TOP.TOP_ANA_CTRL.TOP_ANA_CTRL.po_common_to_2t_txab_spare_0.PDN_GBL_TXB = 1 device.TOP.TOP_ANA_CTRL.TOP_ANA_CTRL.po_common_to_2t_txcd_spare_0.PDN_GBL_TXD = 1 # # disabling jesd lane 1 in each link # device.JESD.DAC_RX[0].DAC_RX.TXDUC_REG124.lane_ena = 1 # device.JESD.DAC_RX[1].DAC_RX.TXDUC_REG124.lane_ena = 1 # device.JESD.ADC_TX[0].ADC_TX.JESD_TX_CONFIG6.lane_ena = 0x5 # device.JESD.ADC_TX[1].ADC_TX.JESD_TX_CONFIG6.lane_ena = 0x1 # # AFE.JESDRX[0].getJesdAlarms() # AFE.JESDRX[1].getJesdAlarms() ''' device.rawWriteLogEn=1 lmk.rawWriteLogEn=0 engine.sampleNo=32768 #Enables FB_IF_NCO_SW through Pin #device.TOP.TIMING_CTRL.TDD_CONTROLLER.Register38197_554h.Property_130h_0_0=1 AFE.TOP.overrideTdd(1, 1, 1) device.currentPageSelected.setValue(0)