2.1. Named Patterns

Patterns have names, much like variables in computer languages. This allows building complex patterns from simpler base patterns. The syntax of a named pattern definition follows:


META_PATTERN:
  PATTERN_1(n1)   -- PATTERN_1 repeated n1 times
  PATTERN_2(n2)   -- PATTERN_2 repeated n2 times
  PATTERN_3(n3)   -- PATTERN_3 repeated n3 times
  PATTERN_4(n4)   -- PATTERN_4 repeated n4 times
  ...

Here META_PATTERN is the pattern name being defined, PATTERN_1PATTERN_4 are previously defined pattern names and n1n4 are repeat counts (integers[1] ), specifying how many times to repeat the pattern.

Two pre-defined pattern names exist, with the following definitions:

All named patterns are built from these two fundamental patterns (obviously the "0" and "1" pattern names would be reserved language keywords).

2.1.1. Example: A Clock-like Pattern

For example to create a clock-like pattern named CLOCK_4 that has a frequency of sys_frequency / 4 with a duty cycle of 50% and lasts for 100 sys_clock cycles, one could write:


DUTY_50:        -- Start definition of pattern DUTY_50
  0(2)          -- Signal de-asserted (off) for two clock cycles
  1(2)          -- Signal    asserted  (on) for two clock cycles

CLOCK_4:        -- Start definition of pattern CLOCK_4
  DUTY_50(25)   -- Repeat pattern DUTY_50 25 times

The DUTY_50 pattern is four sys_clocks long, de-asserted for two clocks and asserted for two clocks. The CLOCK_4 pattern is 25 copies of the DUTY_50 pattern, for a total of 100 sys_clock cycles.

Note

If you were to create a pattern of alternating 1's and 0's this clock-like signal would have a frequency equal to one half of the FIFO clocking frequency, sys_frequency. The normal sys_frequency for the VME LAT COMM I/O Board is 20 MHz, but an external clock source could also be used.

Using named patterns the user can create a palette of pattern fragments.

Notes

[1]

It may also be useful for the repeat count to take a wild card value, *, meaning repeat pattern until FIFO full. It remains to be seen if that will be a useful concept.