Skip to content

Commit

Permalink
Test cmd and fix output bug
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Oct 18, 2019
1 parent 0871b55 commit f25ddaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jtag/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,14 @@ def compile(file):
is_yield(path[-1].statements[0]) and len(path) > 1:
if isinstance(path[0].statements[0].value.value, ast.Tuple):
start_state = path[0].statements[0].value.value.elts[0]
if init_outputs is None:
init_outputs = path[0].statements[0].value.value.elts[1:]
end_state = path[-1].statements[0].value.value.elts[0]
outputs = path[-1].statements[0].value.value.elts[1:]
else:
start_state = path[0].statements[0].value.value
end_state = path[-1].statements[0].value.value
outputs = []
if init_outputs is None:
init_outputs = outputs
if isinstance(start_state, ast.Str):
assert isinstance(end_state, ast.Str)
start_state, end_state = start_state.s, end_state.s
Expand Down
4 changes: 4 additions & 0 deletions sdram/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
tester.circuit.RESET = 0
tester.eval()
tester.circuit.state.expect(0b01000)
tester.circuit.cmd.expect(0b10111000)
tester.step(2)
tester.circuit.state.expect(0b01001)
tester.circuit.cmd.expect(0b10010001)
tester.step(2)
tester.circuit.state.expect(0b00101)
tester.circuit.cmd.expect(0b10111000)
tester.step(2)
tester.circuit.state.expect(0b01010)
tester.circuit.cmd.expect(0b10001000)
tester.step(2)

tester.compile_and_run("verilator", magma_output="verilog")

0 comments on commit f25ddaf

Please sign in to comment.