⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pm5337_config.tcl

📁 用于EOS芯片的驱动程序, 供参考 参考
💻 TCL
📖 第 1 页 / 共 5 页
字号:
    # Configure 3-to-1 Mux to source from T1         wr cpld 0x3 0x3        # Enable Fast Lock mode    set init_value [rd fpga 0x7]    set value [expr $init_value | 0x1]      set value [dec2hex $value]      wr fpga 0x7 $value               # Enable normal mode    set init_value [rd fpga 0x7]    set value [expr $init_value & 0xF9FF]    set value [dec2hex $value]     wr fpga 0x7 $value           # Setup Timing LED    set timing_led 0x1 ;# Extenal or T1 mode    set init_value [expr 0xFFCF & [rd fpga 0x2]]    set value [expr $init_value | $timing_led << 4]        set value [dec2hex $value]    wr fpga 0x2 $value      }           ############################################  ##### CORE_XC Subsystem Configuration  #####  ############################################    if {$devID == -1} {    puts "<br>"    puts "/*---------- CORE_XC Subsystem Configuration ----------*/<br>"      }  ### Enable the CORE_XC subsystem to SMART Framing Mode with CMP switching ###  ### in Incremental mode with CM2 active.                                  ###  CORE_XC_Init $devID 0 2   ### Configure Input Port Mux ###    # Rx1 -> Input of MASU link 1 STM4-1   CORE_XC_Input_MUX_Config $devID 0x14 -1 -1 -1 -1 -1 -1 -1 -1 -1    ### Configure Output Port Mux ###  # Output of MASU link 1 STM4-1 -> Tx1  CORE_XC_Output_MUX_Config $devID -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0x19 -1 -1 -1 -1     ##############################################  ##### SYS_SONET Subsystem Configuration  #####  ##############################################    if {$devID == -1} {    puts "<br>"    puts "/*---------- SYS_SONET Subsystem Configuration ----------*/<br>"    }  # Disable System Side ESSI Links  SYS_SONET_ESSI_Init $devID 0       ###############################################  ##### LINE_SONET Subsystem Configuration  #####  ###############################################    if {$devID == -1} {    puts "<br>"    puts "/*---------- LINE_SONET Subsystem Configuration ----------*/<br>"     }  ### 1. Line Interface Configuration  ###      # Initialize LINE_SONET Subsystem  LINE_SONET_Init $devID 1    if {$line_intf_mode == 1} {        # Configure Line Interface #1 and #2 to OC-12 mode    LINE_SONET_Line_Intf_Config $devID 0 0 1 0 10100    LINE_SONET_Line_Intf_Config $devID 1 0 1 0 10100      } elseif {$line_intf_mode == 2} {        # Configure Line Interface #1 and #2 to OC-3 mode    LINE_SONET_Line_Intf_Config $devID 0 0 0 0 10100    LINE_SONET_Line_Intf_Config $devID 1 0 0 0 10100  }       ### 2. Linear APS Core Configuration  ###        ### 3. Payload Configuration for HOPP and LOPP slice 1 ###        LINE_SONET_HO_Payload_Config $devID 1 $HO_payload  LINE_SONET_LO_Payload_Config $devID 1 $LO_payload     ### 4. Alarm Configurations ###  if {$ais_l == 1} {    # Insert AIS-L in the event of OOF, LOF and LOS    LINE_SONET_Line_AIS_Insert_Config $devID 1 1 1 1 0 0      }     if {$ais_p == 1} {          # Insert AIS-P in the event of AIS-L, RDI-L, RDI-P, UNEQ-P, AIS-P, LOP-P    LINE_SONET_Path_AIS_Insert_Config $devID 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 1 1 1 1 1  }     if {$ais_v == 1 && $tu == 1} {      # Insert AIS-V in the event of UNEQ-V, LOP-V, AIS-V, LOM, PAIS    LINE_SONET_LO_TAIS_Config $devID 1 0 0 0 0 0 1 0 1 1 1 1  }     if {$rdi_l == 1} {    # Insert RDI-L in the event of AIS-L    LINE_SONET_Line_RDI_Insert_Config $devID 1 0 0 0 1 0 0 0 0 0 0 0 0      }    if {$rdi_p == 1} {    # Insert RDI-P in the event of AIS-P    LINE_SONET_Path_RDI_Insert_Config $devID 1 1  }     if {$rdi_v == 1 && $tu == 1} {    # Insert RDI-V in the event of UNEQ-V      LINE_SONET_LO_RDI_Config $devID 1 0 0 1 0 0  }     ### 6. ADM 622 Reference Clock Configuration ###  # Configure Line CSU to source clock input from SYSCLK_P/N and  # set frequency to 155.52 MHz.  LINE_SONET_Timing_Config $devID 1 1    # Configure PGMRCLK[1] to generate a 8kHz clock based on the recovered clock   # from Line Interface #1.  Configure PGMTCLK to generate a 8kHz clock.    LINE_SONET_PGMCLK_Config $devID 1 0 4 1 0 4 0 0 0      # Traffic from line interface #1 is selected  admwrb $devID 0x102A 14 0  admwrb $devID 0x102A 15 1    # Enable Linear APS Core    LINE_SONET_Linear_APS_Config $devID 1         ########################################  ##### EOS Subsystem Configuration  #####  ########################################  if {$devID == -1} {    puts "<br>"    puts "/*---------- EOS Subsystem Configuration ----------*/<br>"      }  # EOS Subsystem is unused    # Disable FE and GE PHY  set init_value [rd cpld 0x2]  set value [expr ($init_value & 0xFFEF) | (1 << 5)]      set value [dec2hex $value]   wr cpld 0x2 $value                   ########################################  ##### PDH Subsystem Configuration  #####  ########################################  if {$devID == -1} {    puts "<br>"    puts "/*---------- PDH Subsystem Configuration ----------*/<br>"     }    # PDH Subsystem is unused    # Hold TDK LIU channels in Soft Reset   TDKReset 0  TDKReset 1  TDKReset 2    # Disable HDLIU  set init_value [rd cpld 0x2]  set value [expr $init_value & 0xFFFD]      set value [dec2hex $value]   wr cpld 0x2 $value       ###############################  ##### MASU Configuration  #####  ###############################    if {$devID == -1} {    puts "<br>"    puts "/*---------- MASU Configuration ----------*/<br>"      }     ### Configure MASU Block with MAPS disabled ###      if {$payload_config == 4 || $payload_config == 11 || $payload_config == 15 } {    # Note: when the payload contain a VT2/TU12, the whole STM-16 must be configured    CORE_XC_LOME_Config $devID 1 $XC_payload 4    CORE_XC_LOMP_Config $devID     CORE_XC_LOSU_Config $devID $XC_payload 4    CORE_XC_CM_Switchover $devID                          } else {        # Note: Only the first STM-4 in the STM-16 link is configured    CORE_XC_LOME_Config $devID 1 $XC_payload  1    CORE_XC_LOMP_Config $devID     CORE_XC_LOSU_Config $devID $XC_payload  1          CORE_XC_CM_Switchover $devID          }       #############################  ##### LED Status Update #####  #############################   # Set DS1 to reflect mode and timing  LEDRateSet $line_intf_mode 0  LEDTimingSet $refclk_mode  LEDLOSUpdate  DS3Update  }#------------------------------------------------------------------------------# SCRIPT NAME:	ADM622_Config3## DESCRIPTION:	This procedure configures the ADM 622 device to demostrate the #               MAPS Function.#		# PARAMETERS:	devID  - This parameter is used to specify the device #                        under configuration##               refclk_mode - 0 (Internal Clock), 1 (External via SMB)#                             2 (Recover from Line Interface 1)#                             3 (Recover from T1 clock)##               line_intf_mode - 1 (OC-12), 2 (OC-3)##               payload_config - 0 (STS-12c), 1 (STS-3c), 2 (STS-1), 3 (VT1.5)#                                4 (VT2), 5 (VT3), 6 (VT6), 7 (AU4-4c), 8 (AU4/C4)#                                9 (AU3/C3), 10 (AU4/TU11), 11 (AU4/TU12), #                                12 (AU4/TU2), 13 (AU4/TU3), 14 (AU3/TU11), #                                15 (AU3/TU12), 16 (AU3/TU2)#               #               g2i_col - 0 (column 1), 1 (column 2), 2 (column 3)##               g2i_row - 0 (row 1), 1 (row 2), ... 8 (row 9)##               statemachine -  0 (Direct Source Selection)#                               1 (Post-hold Timer)#                               2 (WTR Timer)#                               3 (Pre-hold Timer)#                               4 (Pre-hold Timer with Post-Hold Timer)#                               5 (Pre-hold Timer with WTR Timer)##	        timer_mode - 0 (0 sec), 1 (10 sec), 2 (20 sec), 3 (30 sec)                              ## NOTES:  ##  1. Alarm to L-Code Mapping Table    #  ---------------------------------------------------------------------|---------#   Priority           Alarm                             L-Code         |  F-Code #  ===============================================================================#                                                         0xFF          |  0x3E   #  -------------------------------------------------------------------------------#   High     *Loss of Signal (LOS)                         0xFE          |  0x3D   #            *Loss of Frame (LOF)                          0xFD          |  0x3C   #            *Out of Frame (OOF)                           0xFC          |  0x3B   #            APS byte failure defect (APSBF)              0xFB          |  0x3A   #            Section Trace Identifier Mismatch (TIM-S)    0xFA          |  0x39   #            *Line AIS (AIS-L)                             0xF9          |  0x38   #            Signal Fail (SF-L)                           0xF8          |  0x37   #            *Path AIS (AIS-P)                             0xF7          |  0x36   #            *Loss of Pointer (LOP-P)                      0xF6          |  0x35   #            *Path Unequipped Signal label (UNEQ-P)        0xF5          |  0x34   #            Path Trace Identifier Mismatch (TIM-P)       0xF4          |  0x33   #            Payload Label Mismatch (PLM-P)               0xF3          |  0x32   #            Path Signal Fail (SF-P) (10-3 to 10-11)      0xF2 to 0xEA  |  0x31   #            PDI codes (28 down to 1)                     0xE9 to 0xCE  |  0x30   #            ---------------------------------------------------------------------#            *VT AIS (AIS-V)                               0xA0          |  0x29   #            *VT Loss of Pointer (LOP-V)                   0x9F          |  0x28   #            VT UNEQ (UNEQ-V)                             0x9E          |  0x27   #            VT TIM, TIU                                  0x9D          |  0x26   #            VT PSLM, PSLU                                0x9C          |  0x25   #            SF-BER-V (10^-3 to 10^-12)                   0x9B to 0x92  |  0x24   #            SD-BER-V (10^-3 to 10^-12)                   0x91 to 0x88  |  0x23   #            ---------------------------------------------------------------------#            Path Signal Degrade (SD-P) (10-3 to 10-11)   0x87 to 0x7F  |  0x22   #   Low      Signal Degrade (SD-L)                        0x7E          |  0x21   #   ------------------------------------------------------------------------------#                                                         0x7D to 0x00  |  0x1    #  ##   2. In this example, RX1 is the working interface and RX2 is the protect interface.#      RX1 has a lower routing code than RX2, this mean if the signal quality on both#      interfaces are the same, the traffic from RX1 will be selected.#  #   3. Base L-Code is set to 0x00##   4. The L-code is debounced for 7 frames/multiframes#                                         #------------------------------------------------------------------------------------proc ADM622_Config3 { {devID 0} {refclk_mode 0} {line_intf_mode 1} {payload_config 0}                      {g2i_col 0} {g2i_row 2} {statemachine 0} {timer_mode 0} } {                                            ##################################################  ##### Sourcing all TCL configuration scripts #####  ##################################################      #source PM5337_util.tcl  ;# this file is sourced in the PM5337_TOP.tcl file    source /usr/lib/cgi-bin/apps/tclscripts/PM5337_TOP.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_LINE_SONET.tcl    source /usr/lib/cgi-bin/apps/tclscripts/PM5337_LINE_SONET_SLP.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_LINE_SONET_APS.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_LINE_SONET_HOPP.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_LINE_SONET_LOPP.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_LINE_SONET_LUT.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_LINE_SONET_ALARMS.tcl    source /usr/lib/cgi-bin/apps/tclscripts/PM5337_SYS_SONET.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_PDH.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_EOS.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_CORE_XC.tcl  source /usr/lib/cgi-bin/apps/tclscripts/PM5337_CORE_XC_MASU.tcl  source /usr/lib/cgi-bin/apps/tclscripts/TDK_FPGA.tcl    source /usr/lib/cgi-bin/apps/tclscripts/hdliu_init.tcl  source /usr/lib/cgi-bin/apps/tclscripts/LED.tcl     ####################################  ##### Defining Local Variables #####  ####################################    # Defining payload naming notation used by different procedure    if {$payload_config == 0} {    set XC_payload "STS-12c"    set HO_payload "STS-12c"    set LO_payload "STS-12c"    set tu 0 ;# flag to indicate no VT/TUs in data stream  } elseif {$payload_config == 1} {    set XC_payload "STS-3c"    set HO_payload "STS-3c"    set LO_payload "STS-3c"    set tu 0 ;# flag to indicate no VT/TUs in data stream  } elseif {$payload_config == 2} {    set XC_payload "STS-1"    set HO_payload "STS-1"    set LO_payload "STS-1"    set tu 0 ;# flag to indicate no VT/TUs in data stream  } elseif {$payload_config == 3} {    set XC_payload "VT15"    set HO_payload "STS-1"    set LO_payload "VT15"    set tu 1 ;# flag to indicate VT/TUs in data stream  } elseif {$payload_config == 4} {    set XC_payload "VT2"    set HO_payload "STS-1"    set LO_payload "VT2"    set tu 1 ;# flag to indicate VT/TUs in data stream      } elseif {$payload_config == 5} {    set XC_payload "VT3"    set HO_payload "STS-1"    set LO_payload "VT3"    set tu 1 ;# flag to indicate VT/TUs in data stream      } elseif {$payload_config == 6} {    set XC_payload "VT6"    set HO_payload "STS-1"    set LO_payload "VT6"    set tu 1 ;# flag to indicate VT/TUs in data stream      } elseif {$payload_config == 7} {    set XC_payload "AU4-4c"    set HO_payload "AU4-4c"     set LO_payload "AU4-4c"    set tu 0 ;# flag to indicate no VT/TUs in data stream  } elseif {$payload_config == 8} {    set XC_payload "AU4/C4"    set HO_payload "AU4"    set LO_payload "AU4/C4"    set tu 0 ;# flag to indicate no VT/TUs in data stream  } elseif {$payload_config == 9} {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -