PatternGenerator

Python class to generate patterns for the Chip Test Board.

from slsdet import PatternGenerator

p = PatternGenerator()
p.SB(5)
p.PW()
p.SB(8,9)
p.PW()
p.CB(5)

Created a pattern like this:

patword 0x0000 0x0000000000000020
patword 0x0001 0x0000000000000320
patword 0x0002 0x0000000000000300
patioctrl 0x0000000000000000
patlimits 0x0000 0x0002
...
class slsdet.PatternGenerator

Bases: object

Class to generate a pattern for the SLS detector. Intents to as closely as possible mimic the old pattern generation in the C code.

CB(*bits)

Clear one or several bits. Change will take affect with the next PW.

CLOCK(bit, length=1, verbose=0)
CLOCKS(bit, times=1, length=1, verbose=False)

clocks “bit” n “times”, every half clock is long “length” length is optional, default value is 1

PW(x=1, verbose=False)
SB(*bits)

Set one or several bits. Change will take affect with the next PW.

load(fname)

Load pattern from text file

print()
save(fname)

Save pattern to text file

send_to_detector(det)

Load the pattern into the detector.

serializer(value, serInBit, clkBit, nbits, msbfirst=1, length=1)

Produces the .pat file needed to serialize a word into a shift register. value: value to be serialized serInBit: control bit corresponding to serial in clkBit: control bit corresponding to the clock nbits: number of bits of the target register to load msbfirst: if 1 pushes in the MSB first (default), if 0 pushes in the LSB first length: length of all the PWs in the pattern It produces no output because it modifies directly the members of the class pat via SB and CB

setinput(bit)
setinputs(*args)
setnloop(i, reps)
setoutput(bit)
setoutputs(*args)
setstart()

Set start of pattern to the current address.

setstartloop(i)

Set startloop[i] to the current address.

setstop(l)

Set stop of pattern to the current address.

setstoploop(i)

Set stoploop[i] to the current address.

setwait(i, t)

Set wait[i] to the current address and waittime[i] to t.

setwaitpoint(i)

Set wait[i] to the current address.

setwaittime(i, t)

Set waittime[i] to t.