Pattern

class decida.Pattern.Pattern(**kwargs)

Bases: decida.ItclObjectx.ItclObjectx

Pattern generator.

synopsis:

Pattern generates one of various bit-sequences and outputs the sequence as either a string of 1’s and 0’s, a piece-wise linear set of time, voltage pairs, or a set of time, binary pairs.

The Tckt class uses Pattern to generate piece-wise linear voltage specifications for procedural simulation scripts.

constructor arguments:

**kwargs (dict)

keyword=value specifications: configuration-options

configuration options:

v0 (float, default=0.0)

low value of the signal.

v1 (float, default=1.0)

high value of the signal.

delay (float, default=0.0)

delay before first bit.

edge (float, default=50ps)

rise and fall times in s.

period (float, default=1ns)

bit period in s.

pre (string, default="")

specify preamble to bit-pattern (bit-sequence)

post (string, default="")

specify suffix to bit-pattern (bit-sequence)

start_at_first_bit (bool, default=False)

Normally a pwl sequence starts at the common-mode. If start_at_first_bit=True, start at first bit value.

format (string, default="pwl")

Format of return list:

“binary”: return pattern only

“time-binary”: return list of time binary pairs

“pwl”: return piecewise linear waveform

example (from test_Pattern):

from decida.Pattern import Pattern

p = Pattern(delay=4e-9, start_at_first_bit=True, edge=0.1e-9)
pwl = p.prbs(length=50)
print "t v"
for t,v in zip(pwl[0::2], pwl[1::2]) :
    print t, v

public methods:

  • public methods from ItclObjectx
clock(length, startbit=0)

generate clock pattern (0, 1, 0, 1, 0, ...).

arguments:

length (int)

The number of bits in the sequence

startbit (int, default=0)

The starting bit of the bit sequence

results:

  • The Pattern pattern is set to a clock pattern, with the start bit set to the specified value.
  • Returns pattern in format specified by the format configuration option.
format(pattern)

format the bit-sequence.

arguments:

pattern (string)

a string of “1“‘s and “0“‘s

results:

  • Returns Pattern pattern in format specified by the format configuration option.

    format is one of:

    • “binary”: string sequence of “1“‘s and “0“‘s
    • “time-binary”: pairs of time, and integer value 1 or 0.
    • “pwl”: pairs of time, value to account for signal edge, period, and voltage low and high values.
long_short(long, short, startbit=0)

generate a bit pattern with several repeated bits, followed by a phase where each bit is inverted.

arguments:

long (int)

number of bits in the long phase, where each bit is repeated.

short(int)

number of bits in the short phase, where each bit is inverted.

startbit (int, default=0)

The starting bit of the bit sequence

results:

  • The Pattern pattern is set to the bit pattern.
  • Returns pattern in format specified by the format configuration option.
pattern(pattern)

specify and generate a bit pattern directly.

arguments:

pattern (string)

a string of “1“‘s and “0“‘s

results:

  • The Pattern pattern is set to the bit pattern.
  • Returns pattern in format specified by the format configuration option.
prbs(size=7, length=0)

generate a pseudo-random bit pattern.

arguments:

size (int, default=7)

The PRBS specification: size=7 generates a pseudo-random bit-sequence of length 2^7-1.

length (int, default=0)

The length of the bit-sequence. If length=0, generates a sequence of 2^size - 1.

results:

  • The Pattern pattern is set to the PRBS bit pattern.
  • Returns pattern in format specified by the format configuration option.
rand(length)

generate a random bit sequence.

arguments:

length (int)

the length of the bit sequence.

results:

  • The Pattern pattern is set to a random bit pattern.
  • Returns pattern in format specified by the format configuration option.

Previous topic

Parameters

Next topic

PlotBase

This Page