splitPacketGroup
splitPacketGroup - configures split packet group operation.
SYNOPSIS
splitPacketGroup sub-command options
DESCRIPTION
The splitPacketGroup command is used to configure split packet groups in stream generation. Up to 17 bytes can be configured in three separate chunks.
Note: When configuring split packet groups, and all 17 bytes are being used, it is necessary to reset the defaults for the split packet group before changing the size of each split section.
STANDARD OPTIONS
groupIdOffset
The offset, in bytes, from the starting point set in groupIdOffsetBaseType .
groupIdOffsetBaseType
Where in the packet to start the offset for the PGID split section.
Option |
Value |
Usage |
---|---|---|
splitPgidStartOfFrame |
0 |
Start offset at the beginning of the frame |
splitPgidOffsetFrom |
1 |
Start offset from the beginning of the signature. |
groupIdWidth
The number of bytes in the PGID split section. (default = 4)
groupIdMask
The bit mask for the PGID group. (default = FF FF FF FF)
COMMANDS
The splitPacketGroup command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
splitPacketGroup cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the splitPacketGroup command.
splitPacketGroup config option value
Modify the configuration options of the port. If no option is specified, returns a list describing all of the available options (see STANDARD OPTIONS) for port.
splitPacketGroup get chasID cardID portID
Gets the current split PGID configuration for the port indicated from its hardware. Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is not a Packet over Sonet port.
splitPacketGroup set chasID cardID portID
Sets the configuration of the indicated port by reading the configuration option values set by the config option value command. Specific errors are:
- No connection to a chassis
- Invalid port number
- The port is being used by another user
- The configured parameters are not valid for this port
splitPacketGroup setDefault
Sets to IxTclHal default values for all configuration options.
EXAMPLES
package req IxTclHal
proc tdisp {val} {
if {$val >= 1} {
return "$val seconds"
}
if {$val < 1 && $val >= 0.001} {
return [format "%0.4f ms" [expr 1e003 * $val]]
}
if {$val < 0.001} {
return [format "%0.2f us" [expr 1e006 * $val]]
}
}
proc testDuration {val } {
set decimal [string range [format "%0.4f" [expr $val - /
int($val)]] 2 end]
return "[clock format [expr int($val)] -format /
"%H:%M:%S" -gmt 1]"
return "[clock format [expr int($val)] -format /
"%H:%M:%S" -gmt 1].$decimal"
}
proc scaleChange {numbits} {
global maxDurationWidget
global ticksPerSample samplePeriod sampleDuration /
testDuration splitPgidVals
set ticksPerSample [expr int(pow(2,$numbits))]
set samplePeriod [expr (20.0 * $ticksPerSample) / 1000000000]
set sampleDuration [expr $samplePeriod * 0x20000]
set testDuration [testDuration $sampleDuration]
set samplePeriod [tdisp $samplePeriod]
set val [mpexpr 131071 << $numbits]
set mask [mpformat %012x [mpexpr (0xffffffffffff ^ $val)]]
regsub "0x" $mask "" mask
set wordHi "[string range $mask 0 1] /
[string range $mask 2 3] [string range $mask 4 5] [string range $mask 6 7]"
set wordLo "[string range $mask 8 9] [string range /
$mask 10 11]"
set splitPgidVals "$wordHi $wordLo"
puts "ticksPerSample $ticksPerSample "
puts "samplePeriod $samplePeriod "
puts "sampleDuration $sampleDuration "
puts "testDuration $testDuration "
puts "samplePriod $samplePeriod "
puts "splitPgidVals $splitPgidVals"
}
proc setSplitPacketGroup {port offset} {
global splitPgidVals
scan $port "%d %d %d" ch ca po
packetGroup getRx $ch $ca $po
packetGroup config -groupIdMode packetGroupSplit
packetGroup setRx $ch $ca $po
splitPacketGroplitPacketGroup set $ch $ca $po 1
splitPacketGroup set $ch $ca $po 2
splitPacketGroup config -groupIdOffset [expr $offset + 4]
splitPacketGroup config -groupIdMask /
[lrange $splitPgidVals 4 5]
splitPacketGroup config -groupIdWidth 2
splitPacketGroup set $ch $ca $po 0
splitPacketGroup setDefault
splitPacketGroup config -groupIdOffset $offset
splitPacketGroup config -groupIdWidth 4
splitPacketGroup config -groupIdMask /
[lrange $splitPgidVals 0 3]
splitPacketGroup set $ch $ca $po 1
splitPacketGroup setDefault
splitPacketGroup set $ch $ca $po 2
}