Add MIDI loopback test and fix app_midi_simple Tx

This commit is contained in:
Ed
2024-04-19 16:35:32 +01:00
parent 365e9bf014
commit bee1d878af
4 changed files with 81 additions and 29 deletions

View File

@@ -24,12 +24,11 @@ def test_rx(capfd, config, build_midi):
xe = str(Path(tmpdirname) / f"{config}/test_midi_{config}.xe")
midi_commands = [[0x90, 60, 81]]
create_midi_rx_file(1)
create_midi_rx_file(len(midi_commands))
create_midi_tx_file()
expected = midi_expect_rx().expect(midi_commands)
tester = testers.ComparisonTester(midi_expect_rx().expect(midi_commands),
ordered = True)
tester = testers.ComparisonTester(expected, ordered = True)
rx_port = "tile[1]:XS1_PORT_1F"
tx_port = "tile[1]:XS1_PORT_4C" # Needed so that UARTRxChecker (a transmitter) knows when to start
@@ -46,20 +45,14 @@ def test_rx(capfd, config, build_midi):
]
simargs = ["--max-cycles", str(MAX_CYCLES)]
#This is just for local debug so we can capture the traces if needed. It slows xsim down so not needed
#This is just for local debug so we can capture the traces if needed. It slows xsim down so not good for Jenkins
# simargs.extend(["--trace-to", "trace.txt", "--vcd-tracing", "-tile tile[1] -ports -o trace.vcd"])
# Print to console
# with capfd.disabled():
# print("++++", expected, "++++")
# print("****", capture, "****")
# print("****", capture.split("\n"), "****")
# print(xe)
# with capfd.disabled(): # use to see xsim and tester output
Pyxsim.run_with_pyxsim(
xe,
simthreads=simthreads,
timeout=1200,
timeout=120,
simargs=simargs,
)
capture = capfd.readouterr().out