Skip to content

Commit

Permalink
🎨 fix white-space and alignment damage from b023a7e
Browse files Browse the repository at this point in the history
  • Loading branch information
caryan committed Jun 2, 2016
1 parent b023a7e commit d9a6221
Showing 1 changed file with 36 additions and 37 deletions.
73 changes: 36 additions & 37 deletions QGL/drivers/APS2Pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,45 +33,45 @@
from builtins import int

#Some constants
SAMPLING_RATE = 1.2e9
ADDRESS_UNIT = 4 #everything is done in units of 4 timesteps
MIN_ENTRY_LENGTH = 8
MAX_WAVEFORM_PTS = 2**28 #maximum size of waveform memory
WAVEFORM_CACHE_SIZE = 2**17
MAX_WAVEFORM_VALUE = 2**13-1 #maximum waveform value i.e. 14bit DAC
SAMPLING_RATE = 1.2e9
ADDRESS_UNIT = 4 #everything is done in units of 4 timesteps
MIN_ENTRY_LENGTH = 8
MAX_WAVEFORM_PTS = 2**28 #maximum size of waveform memory
WAVEFORM_CACHE_SIZE = 2**17
MAX_WAVEFORM_VALUE = 2**13-1 #maximum waveform value i.e. 14bit DAC
MAX_NUM_INSTRUCTIONS = 2**26
MAX_REPEAT_COUNT = 2**16-1;
MAX_TRIGGER_COUNT = 2**32-1
MAX_REPEAT_COUNT = 2**16-1;
MAX_TRIGGER_COUNT = 2**32-1

# instruction encodings
WFM = 0x0
MARKER = 0x1
WAIT = 0x2
LOAD = 0x3
REPEAT = 0x4
CMP = 0x5
GOTO = 0x6
CALL = 0x7
RET = 0x8
SYNC = 0x9
WFM = 0x0
MARKER = 0x1
WAIT = 0x2
LOAD = 0x3
REPEAT = 0x4
CMP = 0x5
GOTO = 0x6
CALL = 0x7
RET = 0x8
SYNC = 0x9
MODULATION = 0xA
LOADCMP = 0xB
LOADCMP = 0xB
PREFETCH = 0xC
NOP = 0XF
NOP = 0XF

# WFM/MARKER op codes
PLAY = 0x0
WAIT_TRIG = 0x1
WAIT_SYNC = 0x2
PLAY = 0x0
WAIT_TRIG = 0x1
WAIT_SYNC = 0x2
WFM_PREFETCH = 0x3
WFM_OP_OFFSET = 46
TA_PAIR_BIT = 45

# CMP op encodings
EQUAL = 0x0
NOTEQUAL = 0x1
EQUAL = 0x0
NOTEQUAL = 0x1
GREATERTHAN = 0x2
LESSTHAN = 0x3
LESSTHAN = 0x3

# Whether we use PHASE_OFFSET modulation commands or bake it into waveform
# Default to false as we usually don't have many variants
Expand Down Expand Up @@ -194,7 +194,7 @@ def __repr__(self):
def __str__(self):

opCodes = ["WFM", "MARKER", "WAIT", "LOAD", "REPEAT", "CMP", "GOTO", "CALL",
"RET", "SYNC", "MODULATION", "LOADCMP", "PREFETCH", "NOP", "NOP", "NOP"]
"RET", "SYNC", "MODULATION", "LOADCMP", "PREFETCH", "NOP", "NOP", "NOP"]

out = "{0} ".format(self.label) if self.label else ""

Expand Down Expand Up @@ -631,10 +631,10 @@ def create_seq_instructions(seqs, offsets):
warn("Dropping entry!")
continue
instructions.append(Waveform(offsets[wf_sig(entry)],
entry.length,
entry.isTimeAmp or entry.isZero,
write=write_flags[ct],
label=label))
entry.length,
entry.isTimeAmp or entry.isZero,
write = write_flags[ct],
label = label))
elif isinstance(entry, ModulationCommand):
instructions.append(entry.to_instruction(write_flag=write_flags[ct], label=label))

Expand All @@ -646,10 +646,10 @@ def create_seq_instructions(seqs, offsets):
markerSel = seq_idx - 1
state = not entry.isZero
instructions.append(Marker(markerSel,
state,
entry.length,
write=write_flags[ct],
label=label))
state,
entry.length,
write=write_flags[ct],
label=label))

#clear label
label = None
Expand Down Expand Up @@ -773,8 +773,7 @@ def write_sequence_file(awgData, fileName):
Main function to pack channel sequences into an APS2 h5 file.
'''
# Convert QGL IR into a representation that is closer to the hardware.
awgData['ch12']['linkList'], wfLib = preprocess(awgData['ch12']['linkList'],
awgData['ch12']['wfLib'])
awgData['ch12']['linkList'], wfLib = preprocess(awgData['ch12']['linkList'], awgData['ch12']['wfLib'])

# compress marker data
for field in ['ch12m1', 'ch12m2', 'ch12m3', 'ch12m4']:
Expand Down

0 comments on commit d9a6221

Please sign in to comment.