コード例 #1
0
ファイル: test_io.py プロジェクト: kervinck/gigatron-rom
def test_read_initial_state():
    # The following are not necessary, but it was very helpful in debugging
    Emulator.run_to(0x2FF, max_instructions=10_000_000)  # Entry of vCPU
    Emulator.run_vcpu_to(0x200)  # Pass through loading sequence
    buffer = bytearray()
    for _ in range(5):
        value = Emulator.read_serial(bits=8)
        buffer.append(value)
    assert buffer == b"READY"
コード例 #2
0
ファイル: test_io.py プロジェクト: kervinck/gigatron-rom
def _read_bytes(n):
    buffer = bytearray()
    for _ in range(n):
        buffer.append(Emulator.read_serial(bits=8))
    return bytes(buffer)