📄 pm5337_core_xc_masu.tcl
字号:
# 0xFD | 0x3C# 0xFC | 0x3B# 0xFB | 0x3A# 0xFA | 0x39# 0xF9 | 0x38# 0xF8 | 0x37# 0xF7 | 0x36# 0xF6 | 0x35# 0xF5 | 0x34# 0xF4 | 0x33# 0xF3 | 0x32# 0xF2 to 0xEA | 0x31# 0xE9 to 0xCE | 0x30# -------------------------------------# 0xA0 | 0x29# 0x9F | 0x28# 0x9E | 0x27# 0x9D | 0x26# 0x9C | 0x25# 0x9B to 0x92 | 0x24# 0x91 to 0x88 | 0x23# -------------------------------------# 0x87 to 0x7F | 0x22# 0x7E | 0x21# -------------------------------------# 0x7D to 0x00 | 0x1##-------------------------------------------------------------------proc CORE_XC_LOME_MAPS_Config {devID link payload g2i_col g2i_row lcode_debounce_length base_lcode manual_lcode mode} { source /usr/lib/cgi-bin/apps/tclscripts/PM5337_util.tcl ################################################ ##### 1. Temporarily disable MAPS function ##### ################################################ admwrb $devID 0x4800 0 0 admwrb $devID 0x6800 0 0 ################################################################## ##### 2. Configuring the TUG3TUG2EN_x_[y] bit to ##### ##### enable AU4 to AU3 conversion ##### ################################################################## if {$payload == "AU4/TU11" || $payload == "AU4/TU12" || $payload == "AU4/TU2"} { if {$link == 1} { # Link 1 admwr $devID 0x4801 0x0000FFFF ;# TUG3TUG2EN_1_[16..1] admwr $devID 0x4802 0x0000FFFF ;# TUG3TUG2EN_2_[16..1] admwr $devID 0x4803 0x0000FFFF ;# TUG3TUG2EN_3_[16..1] } if {$link == 2} { # Link 2 admwr $devID 0x6801 0x0000FFFF ;# TUG3TUG2EN_1_[16..1] admwr $devID 0x6802 0x0000FFFF ;# TUG3TUG2EN_2_[16..1] admwr $devID 0x6803 0x0000FFFF ;# TUG3TUG2EN_3_[16..1] } } else { # Turn off all conversion if {$link == 1} { # Link 1 in LOME block $slice_num admwr $devID 0x4801 0x00000000 ;# TUG3TUG2EN_1_[16..1] admwr $devID 0x4802 0x00000000 ;# TUG3TUG2EN_2_[16..1] admwr $devID 0x4803 0x00000000 ;# TUG3TUG2EN_3_[16..1] } if {$link == 2} { # Link 2 in LOME block $slice_num admwr $devID 0x6801 0x00000000 ;# TUG3TUG2EN_1_[16..1] admwr $devID 0x6802 0x00000000 ;# TUG3TUG2EN_2_[16..1] admwr $devID 0x6803 0x00000000 ;# TUG3TUG2EN_3_[16..1] } } ################################################################## ###### 3. Configuring the Ingress Connection Memory ##### ###### (CM) to declare ingress traffic payload size. ##### ################################################################## # Define the number of STM1 needs to be configure # mode 1 - STM1#1 to STM1#4 are configured # mode 2 - STM1#1 to STM1#8 are configured # mode 3 - STM1#1 to STM1#12 are configured # mode 4 - STM1#1 to STM1#16 are configured if {$mode == 1} { set max_STM1 0x3 } elseif {$mode == 2} { set max_STM1 0x7 } elseif {$mode == 3} { set max_STM1 0xB } elseif {$mode == 4} { set max_STM1 0xF } # The following lines setup the LOME CM using the Incremental Mode # with CM Page 2 active and CM Page 1 standby. # Set SW_CMP_MODE to 1 and SW_CMPS to 0 admwrb $devID 0x0817 2 1 admwrb $devID 0x0817 0 0 ### Configuring CM Page 1 for different payload types for link 1 ### Note: All paths are configured to the same payload types. if {$link == 1} { if {$payload == "VT15" || $payload == "AU3/TU11" || $payload == "AU4/TU11"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 000b admwr $devID $addr_CM1 0x00000000 } } } if {$payload == "VT2" || $payload == "AU3/TU12" ||$payload == "AU4/TU12"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 001b admwr $devID $addr_CM1 0x01111111 } } } if {$payload == "VT3"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 010b admwr $devID $addr_CM1 0x02222222 } } } if {$payload == "VT6" || $payload == "AU3/TU2" || $payload == "AU4/TU2"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 011b admwr $devID $addr_CM1 0x03333333 } } } if {$payload == "STS-1" || $payload == "STS-3c" ||$payload == "STS-12c" || $payload == "AU4-4c" || $payload == "AU4/C4" || $payload == "AU3/C3" || $payload == "AU4/TU3"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x4840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 1XXb, # ie 100b admwr $devID $addr_CM1 0x04444444 } } } } ### Configuring CM Page 1 for different payload types for link 2 ### Note: All paths are configured to the same payload types. if {$link == 2} { if {$payload == "VT15" || $payload == "AU3/TU11" ||$payload == "AU4/TU11"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 000b admwr $devID $addr_CM1 0x00000000 } } } if {$payload == "VT2" || $payload == "AU3/TU12" ||$payload == "AU4/TU12"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 001b admwr $devID $addr_CM1 0x01111111 } } } if {$payload == "VT3"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 010b admwr $devID $addr_CM1 0x02222222 } } } if {$payload == "VT6" || $payload == "AU3/TU2" ||$payload == "AU4/TU2"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 011b admwr $devID $addr_CM1 0x03333333 } } } if {$payload == "STS-1" || $payload == "STS-3c" ||$payload == "STS-12c" || $payload == "AU4-4c" || $payload == "AU4/C4" || $payload == "AU3/C3" || $payload == "AU4/TU3"} { for {set stm1 0x0} {$stm1 <= $max_STM1} {incr stm1 0x1} { for {set stm0 0x0} {$stm0 <= 0x2} {incr stm0 0x1} { # Defining CM1 register address offset set addr_CM1 [expr 0x6840 + [expr $stm1 << 2]|[expr $stm0 << 0]] # For each of 48 STS1 path, set PLSIZE[2..0] = 1XXb, # ie 100b admwr $devID $addr_CM1 0x04444444 } } } } ################################################################## ###### 4. Configure Primary and Secondary G2i Location ##### ################################################################## # Set primary and secondary G2i location for link 1 and link 2 # to identical values set g2i_in_pri_col $g2i_col set g2i_in_pri_row $g2i_row set g2i_in_sec_col $g2i_col set g2i_in_sec_row $g2i_row set value [expr [expr $g2i_in_sec_col << 24]|[expr $g2i_in_sec_row << 16]|\ [expr $g2i_in_pri_col << 8]|[expr $g2i_in_pri_row << 0]] # link 1 if {$link == 1} { admwr $devID 0x4804 $value } # link 2 if {$link == 2} { admwr $devID 0x6804 $value } ################################################################## ##### 5. Specific if G2i is in Primary or Secondary Location ##### ################################################################## # For this example, all G2i byte are in primary location if {$link == 1} { admwr $devID 0x4805 0x0000 admwr $devID 0x4806 0x0000 admwr $devID 0x4807 0x0000 } if {$link == 2} { admwr $devID 0x6805 0x0000 admwr $devID 0x6806 0x0000 admwr $devID 0x6807 0x0000 } ################################################################## ###### 6. Specify if Outgoing G2i will be Overwritten ##### ###### with Final Lcode ##### ################################################################## # For this example, the outgoing G2i code will NOT be overwritten # To change this setting, chanage the following lines to: # admwrb $devID 0x4800 1 1 ;# link 1 # admwrb $devID 0x6800 1 1 ;# link 2 # link 1 if {$link == 1} { admwrb $devID 0x4800 1 0 } # link 2 if {$link == 2} { admwrb $devID 0x6800 1 0 } ################################################################## ###### 7. Configure L-Code Debounce Length ##### ################################################################## # For this example, the outgoing G2i code will be overwritten admwr $devID 0x4001 $lcode_debounce_length ################################################################## ###### 8. Configure Base L-Code ##### ################################################################## # Configuring Base L-Code #link 1 if {$link == 1} { admwr $devID 0x4808 $base_lcode } #link 2 if {$link == 2} { admwr $devID 0x6808 $base_lcode } ################################################################## ###### 9. Configure Manual L-Code ##### ################################################################## # For this example, only Manual L-code 0 is configured # The default Manual L-Code index is 0, to use Manual L-code 1 to # 3, the Manual L-Code Index will need to be change. # See 11. for example. admwr $devID 0x4002 $manual_lcode ################################################################## ###### 10. Configuring L-Code to F-Code Mapping Table ##### ################################################################## # The following section configure the High Order L-Code to F-Code # Mapping Table 1, to configure Table 2 to 4, repeat the following # procedure. # # In this example, the L-Code to F-Code translation is as
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -