예제 #1
0
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
def _read_bytes(n):
    buffer = bytearray()
    for _ in range(n):
        buffer.append(Emulator.read_serial(bits=8))
    return bytes(buffer)