Skip to content

Commit

Permalink
Minimal qwait('RAM') test
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Ristè committed Jul 3, 2018
1 parent 8b88682 commit b0b1ebb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion QGL/ControlFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def qwait(kind="TRIG", addr=None, channels=None):
elif kind == "CMP":
return LoadCmp(channels)
elif kind == "RAM":
if not addr:
if addr is None:
raise Exception('Please specify address')
return [WriteAddrInstruction('INVALIDATE', None, 1, addr, 0xffffffff, False), LoadCmpVramInstruction('LOADCMPVRAM', 1, addr, 0xff, False)]

Expand Down
4 changes: 3 additions & 1 deletion tests/test_ControlFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ def test_repeat(self):

def test_qwait(self):
q1 = self.q1
seq1 = [qwait(), qwait(kind="CMP")]
seq1 = [qwait(), qwait(kind="CMP"), qwait(kind = "RAM", addr = 0)]
assert (isinstance(seq1[0], ControlFlow.Wait))
assert (isinstance(seq1[1], ControlFlow.LoadCmp))
assert (isinstance(seq1[2][0], TdmInstructions.WriteAddrInstruction))
assert (isinstance(seq1[2][1], TdmInstructions.LoadCmpVramInstruction))

def test_compile(self):
q1 = self.q1
Expand Down

0 comments on commit b0b1ebb

Please sign in to comment.