?? pm5337_line_sonet_slp.tcl
字號:
#------------------------------------------------------------------------------# FILE NAME: PM5337_LINE_SONET_SLP.tcl## DESCRIPTION: This file includes the following procedures:# 1) LINE_SONET_Section_Trace_Config# 2) LINE_SONET_Line_BER_Config# # NOTES:### REVISION History:# Preliminary 1 - Script created#------------------------------------------------------------------------------#------------------------------------------------------------------------------# SCRIPT NAME: LINE_SONET_Section_Trace_Config## DESCRIPTION: This procedure configures the RTTP blocks in# the SLP.# # PARAMETERS: devID ## interface - 1, 2## algo - '1', '2', or '3' (see datasheet for details)## length16 - '0' for 64 bytes or '1' for 16 byte## sync - '0' (algorithm will synchronize when receiving a byte with # it MSB set to 1) # '1' algorithm will synchrnoize when receiving a byte with CR/LF# # enable - '1' to enable or '0' to disable## NOTE: Default trace message in ASCII is# FF CR 1 2 3 4 5 6 7 8 9 A B C D##------------------------------------------------------------------------------proc LINE_SONET_Section_Trace_Config {devID interface algo length16 sync enable} { source /usr/lib/cgi-bin/apps/tclscripts/PM5337_util.tcl ##### Defining system block name ##### if {$interface == 1} { set RTTP "$devID LINE_SONET::SLP::RTTP_1" } elseif {$interface == 2} { set RTTP "$devID LINE_SONET::SLP::RTTP_2" } #### Enable Section Trace Message Monitoring ### if {$enable == 1} { # 1. Set ALGO[1:0] to 0 to disable trace monitoring in all paths # Make sure bit 6 (RESERVED_1) is set to 1 admindwr $devID $RTTP 0x0040 0x03 # 2. Program the expected trace message for the first 16 bytes # Program 64 bytes if required (length16 = 0) admindwr $devID $RTTP 0xCD 0xC0 admindwr $devID $RTTP 0x30 0xC1 admindwr $devID $RTTP 0x31 0xC2 admindwr $devID $RTTP 0x32 0xC3 admindwr $devID $RTTP 0x33 0xC4 admindwr $devID $RTTP 0x34 0xC5 admindwr $devID $RTTP 0x35 0xC6 admindwr $devID $RTTP 0x36 0xC7 admindwr $devID $RTTP 0x37 0xC8 admindwr $devID $RTTP 0x38 0xC9 admindwr $devID $RTTP 0x39 0xCa admindwr $devID $RTTP 0x41 0xCb admindwr $devID $RTTP 0x42 0xCc admindwr $devID $RTTP 0x43 0xCd admindwr $devID $RTTP 0x44 0xCe admindwr $devID $RTTP 0x45 0xCf # 3. Set ALGO [1:0], LENGTH16 and SYNC_CRLF value set configvalue [expr [expr $algo << 0]|[expr $length16 << 2]| \ [expr $sync << 5]|[expr 1 << 6]] admindwr $devID $RTTP $configvalue 0x03 } #### Disable Section Trace Message Monitoring ### if {$enable == 0} { # set ALOG[1:0] to 0 to disable trace monitoring admindwr $devID $RTTP 0x0000 0x03 }}#------------------------------------------------------------------------------# SCRIPT NAME: LINE_SONET_Line_BER_Config# DESCRIPTION: This procedure configure the SBER block in the # ADM622 device.# PARAMETERS : devID# interface - '1' or '2'# line_rate - 'OC-3', 'OC-12'# ber_rate - 3 to 11 # sd_sf - 0 (SF), 1 (SD)# enable - 1 (enabled), 0 (disabled) # NOTE : #------------------------------------------------------------------------------proc LINE_SONET_Line_BER_Config {devID interface line_rate ber_rate sd_sf enable} { source /usr/lib/cgi-bin/apps/tclscripts/PM5337_util.tcl # Defining Set Integration Period, Set Threshold and Clear # Threshold # ipH = High Word of Integration Period # ipL = Low Word of Integration Period # sthre = Set Threshold # cthre = Clear Threshold if {$line_rate == "OC-3"} { if {$ber_rate == 3} { set ipH 0x0000 set ipL 0x0007 set sthre 0x02D set cthre 0x026 } elseif {$ber_rate == 4} { set ipH 0x0000 set ipL 0x0017 set sthre 0x018 set cthre 0x011 } elseif {$ber_rate == 5} { set ipH 0x0000 set ipL 0x00C7 set sthre 0x016 set cthre 0x00F } elseif {$ber_rate == 6} { set ipH 0x0000 set ipL 0x07A8 set sthre 0x015 set cthre 0x00F } elseif {$ber_rate == 7} { set ipH 0x0000 set ipL 0x4C7A set sthre 0x15 set cthre 0x00F } elseif {$ber_rate == 8} { set ipH 0x0002 set ipL 0xFCA4 set sthre 0x015 set cthre 0x00F } elseif {$ber_rate == 9} { set ipH 0x001D set ipL 0xDE4F set sthre 0x015 set cthre 0x00F } elseif {$ber_rate == 10} { set ipH 0x012A set ipL 0xAEF9 set sthre 0x015 set cthre 0x00F } elseif {$ber_rate == 11} { set ipH 0x0BAA set ipL 0xD59D set sthre 0x015 set cthre 0x00F } } if {$line_rate == "OC-12"} { if {$ber_rate == 3} { set ipH 0x0000 set ipL 0x0002 set sthre 0x036 set cthre 0x02B } elseif {$ber_rate == 4} { set ipH 0x0000 set ipL 0x0006 set sthre 0x019 set cthre 0x011 } elseif {$ber_rate == 5} { set ipH 0x0000 set ipL 0x0032 set sthre 0x016 set cthre 0x00F } elseif {$ber_rate == 6} { set ipH 0x0000 set ipL 0x01EA set sthre 0x15 set cthre 0x00F } elseif {$ber_rate == 7} { set ipH 0x0000 set ipL 0x131F set sthre 0x015 set cthre 0x00F } elseif {$ber_rate == 8} { set ipH 0x0000 set ipL 0xBF29 set sthre 0x015 set cthre 0x00F } elseif {$ber_rate == 9} { set ipH 0x0007 set ipL 0x7794 set sthre 0x015 set cthre 0x00F } elseif {$ber_rate == 10} { set ipH 0x004A set ipL 0xABBF set sthre 0x015 set cthre 0x00F } elseif {$ber_rate == 11} { set ipH 0x02DA set ipL 0xB568 set sthre 0x015 set cthre 0x00F } } #### Configuring SD BER detection #### if {$sd_sf == 1} { if {$enable == 1} { # 1. Set SD_EN to 0 to disable SD BER detection if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 0x0000 0x06 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 0x0000 0x06 } # 2. Configure SBER SD BERM Set Threshold if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 $sthre 0x04 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 $sthre 0x04 } # 3. Configure SBER SD BERM Clear Threshold if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 $cthre 0x05 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 $cthre 0x05 } # 4. Configure SBER SD BERM Set Integration Period [31:0] if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 $ipH 0x07 admindwr $devID LINE_SONET::SLP::SBER_1 $ipL 0x08 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 $ipH 0x07 admindwr $devID LINE_SONET::SLP::SBER_2 $ipL 0x08 } # 5. Set SD_EN to 1 to enable SD BER detection if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 1 0x06 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 1 0x06 } } elseif {$enable == 0} { # Set SD_EN to 0 to disable SD BER detection if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 0 0x06 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 0 0x06 } } } #### Configuring SF BER detection #### if {$sd_sf == 0} { if {$enable == 1} { # 1. Set SD_EN to 0 to disable SD BER detection if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 0x0000 0x16 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 0x0000 0x16 } # 2. Configure SBER SD BERM Set Threshold if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 $sthre 0x14 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 $sthre 0x14 } # 3. Configure SBER SD BERM Clear Threshold if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 $cthre 0x15 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 $cthre 0x15 } # 4. Configure SBER SD BERM Set Integration Period [31:0] if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 $ipH 0x17 admindwr $devID LINE_SONET::SLP::SBER_1 $ipL 0x18 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 $ipH 0x17 admindwr $devID LINE_SONET::SLP::SBER_2 $ipL 0x18 } # 5. Set SD_EN to 1 to enable SD BER detection if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 1 0x16 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 1 0x16 } } elseif {$enable == 0} { # Set SD_EN to 0 to disable SD BER detection if {$interface == 1} { admindwr $devID LINE_SONET::SLP::SBER_1 0 0x16 } elseif {$interface == 2} { admindwr $devID LINE_SONET::SLP::SBER_2 0 0x16 } } } }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -