Pattern Definition Language
The pattern definition language is a collection of statements used to define a bit-sequence for use as a User Pattern. Using this language, you can create text ".patt" files that can be deployed into independent Ch-0 or Ch-1 channels or loaded as bit-deinterleaved bit streams into both output channels simultaneously.
Language Tokens
Language tokens are atomic elements the parser identifies for application in commands.
Number := '0b'<binary-value> | '0x'<hexadecimal-value> | <decimal-value> | Name
Number tokens are specified as binary, hexadecimal, or decimal values. Numbers may be assigned to names using the SET command and referred to by the associated name instead of the numerical value.
EndAlign := 'Repeat', 'Zeros', 'Ones', 'Default'
Pattern bit-sequences are aligned to the internal 128-bit word architecture. This alignment can be done by repeating the pattern until it it fits, or it can be padded with zeros or ones. The default is to repeat the pattern
PrbsType := 'p7' | 'p11' | 'p13' | 'p15' | 'p20' | 'p23' | 'p31' | 'i7' | 'i11' | 'i13' | 'i15' | 'i20' | 'i23' | 'i31'
PrbsPatternLength := <2^n - 1, where n defines the Prbs Type>
PRBS pattern bit sequences are specified by the length of the PRBS pattern and whether the PRBS pattern is inverted or not. Inversion is significant because a Prbs<n> pattern does not have a run of <n> zeros, whereas it does have a run of <n> ones. If you invert a PRBS pattern, you can achieve a run of <n> zeros.
SymbolSize: = <Number between 1 and 32>
Numeric values are defined by a Number value and by specifying the symbol size which is the number of bits the number will occupy.
PrbsSeed := <Number between 1 and PrbsPatternLength - 1>
Number value used as the seed of the PRBS pattern generator for the associated PRBS pattern type. This value determines the next PRBS bit generated for bit-stream output. Internally, the seed for the associated PRBS type pattern generator is updated each time a PRBS bit is generated. Each PRBS pattern type has a unique seed. Seed values are inherited by included patterns, but not by sub-patterns.
Name := <Alphanumeric string of characters without white space or punctuation, may contain '_' >
Names are used to assign number values to symbols. A previously established name can be used wherever a number can be used. Names are inherited by included patterns, but not by sub-patterns.
PatternFilePath := <File path ending in ".patt" >
Pattern file specification is used to include patterns within other patterns. Files always end in ".patt". Forward or backward slashes can be used to indicate folder structure. If a file name is specified without a folder name, the current pattern folder is assumed. If a folder is specified that does not begin with a slash character, then it is assumed the folder is rooted in the system pattern home.
LoopCount := <Number greater than 0>
Loop count is used to indicate the cycle repetition amount in the Loop command.
Commands
Commands are statements that control pattern creation.
SymbolSizeCommand := SYMBOL_SIZE '(' Number ')'
Defines the number of bits that each numeric value will occupy in the output bit-stream. The symbol size remains operational until it is changed.
Examples:
SYMBOL_SIZE(1)
SYMBOL_SIZE(10)
EndAlignCommand := 'PATT_END_ALIGN' '(' EndAlign ')'
Specifies the method for aligning the pattern to system 128-bit word architecture. Using this command, you can specify to repeat the pattern until it fits evenly, or to pad the pattern with 1's or 0's.
Examples:
PATT_END_ALIGN( Repeat )
PrbsSeedCommand := 'PRBS_SEED' '(' PrbsType ',' PrbsSeed ')'
Specifies the seed value of the indicated PRBS pattern type. The seed value controls the value of the next bit generated by the associated PRBS pattern generator.
Examples:
PRBS_SEED( p7, 0x7f )
PRBS_SEED( p15, 0x7fff )
SetCommand := 'SET' Name '=' Number
Assign a number to a symbolic name. These names can be used later wherever a number is required. The list of available names are inherited by included patterns. They are not inherited by sub-patterns.
Examples:
SET K28 = 0x28
PrbsCommand := 'PRBS' '(' PrbsType ')'
Create a bit of output from the associated PRBS pattern type generator. The next big created will be based on the current seed value for the associated PRBS pattern type. The seed value is updated after each bit of output.
Examples:
PRBS(p31)
PRBS(i7)
NumericSymbolsCommand := Number [Number] ...
Define a sequence of symbols for output by listing each consecutive value. The number of bits emitted for each value is defined by the current symbol size. Values that exceed the allowable range for a given symbol size will be truncated to the specified number of bits.
Examples:
0x1 0x0 0x15 0x14
0 1 0 1 0 1 0 1
LoopCommand := '{' ListOfExpressions '}' LoopCount
Create a specified number of cycles of a defined bit-stream. Each item in a loop definition is considered to be one symbol size number of bits long. Loop commands can be nested.
Example:
{ { PRBS(p7) } 128 } 4
{ 1 0 } 50
PatternCommand := 'PATTERN' '(' PatternFilePath ')'
Embed a specified sub-pattern file bit-stream inside another pattern by indicating the file of the embedded pattern. Sub-patterns are parsed and embedded without inheriting properties from the parent pattern. This is useful, for example, to ensure a Sub-pattern version of a PRBS generator always starts with the same seed value instead of inheriting the current seed value from the parent pattern.
Example:
PATTERN( "Prbs/prbs07.patt" )
SubCommand := 'PATT_BEGIN' ListOfExpressions 'PATT_END'
Define an embedded pattern dynamically without using a separate pattern file. This is useful to utilize the feature of not inheriting parent pattern characteristics in the sub-pattern, and not creating persistent artifacts of the sub-pattern for the parent pattern.
Example:
PATT_BEGIN
PRBS_SEED(p7,0x7f)
{ Prbs(p7) } 128
PATT_END
IncludeCommand := 'INCLUDE' '(' PatternFilePath ')'
Includes a specified pattern file inside the current pattern file. Included pattern files are parsed and included while inheriting properties from the parent pattern and creating environmental artifacts that will persist in the parent pattern file afterwards. This is useful, for example, to enable a Sub-pattern version of a PRBS generator to continue generating a PRBS pattern sequence across different pattern files. Persistent artifacts are useful, for instance, to assign a series of names to numeric values in an included file, so they can subsequently be referred to by those names in the parent file.
Example:
INCLUDE( "ProtocolSymbols.patt" )
Other Language Structure Elements
PatternFile := ListOfExpressions
A pattern file is defined to be a list of expressions.
ListOfExpressions := Expression [Expression] ...
A list of expressions is one or more consecutive expressions
Expression := GlobalCommand | LoopCommand | ListOfSymbolsProducers
An expression is either a global command, a nested loop of commands, or a series of symbol producing commands
GlobalCommand := SymbolSizeCommand | EndAlignCommand | PrbsSeedCommand | SetCommand
Global commands are used to set the output symbol size, define the end alignment mode, specify each PRBS seed, or define a number value to a symbolic name.
SymbolsProducer := PatternCommand | IncludeCommand | PrbsCommand | SubCommand | NumericSymbolsCommand
A symbol producer is command that produces a bit sequence.
ListOfSymbolsProducers := SymbolProducer [SymbolProducer] ...
One or more symbol producers.