NathanY3G / rp2040-pio-emulator

RP2040 emulator for the testing and debugging of PIO programs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contents of transmit FIFO incorrectly reported in before state for PULL instruction

NathanY3G opened this issue · comments

The following example demonstrates this issue. When run it outputs exactly the same contents for both the before and after states! This implies nothing has changed when in fact it has. Also, the last value from the FIFO has been removed instead of the first value.

before, after = next(
    emulate(
        [0x80A0],
        initial_state=State(transmit_fifo=deque([1, 2, 3, 4])),
        stop_when=clock_cycles_reached(1),
    )
)

print(f"Transmit FIFO before and after PULL instruction: {before.transmit_fifo} -> {after.transmit_fifo}")

Actual Result:

Transmit FIFO before and after PULL instruction: deque([1, 2, 3]) -> deque([1, 2, 3])

Expected Result:

Transmit FIFO before and after PULL instruction: deque([1, 2, 3, 4]) -> deque([2, 3, 4])