test_prod2u_door_temp_uart_e2e.pre-sync.diff 1.0 KB

12345678910111213141516171819202122232425262728
  1. diff --git a/tests/cocotb/test_prod2u_door_temp_uart_e2e.py b/tests/cocotb/test_prod2u_door_temp_uart_e2e.py
  2. index 0e4c13b..5a04a14 100644
  3. --- a/tests/cocotb/test_prod2u_door_temp_uart_e2e.py
  4. +++ b/tests/cocotb/test_prod2u_door_temp_uart_e2e.py
  5. @@ -6,7 +6,7 @@ wire boundary: bytes are serialized as 8N1 bits at 217 system clocks/bit.
  6. import cocotb
  7. from cocotb.clock import Clock
  8. -from cocotb.triggers import Event, ReadOnly, RisingEdge, SimTimeoutError, with_timeout
  9. +from cocotb.triggers import Event, NextTimeStep, ReadOnly, ReadWrite, RisingEdge, SimTimeoutError, with_timeout
  10. CLKS_PER_BIT = 217
  11. @@ -38,6 +38,7 @@ async def clocks(dut, count: int) -> None:
  12. async def send_uart_byte(dut, value: int) -> None:
  13. + await ReadWrite()
  14. dut.host_uart_rx.value = 0
  15. await clocks(dut, CLKS_PER_BIT)
  16. for bit in range(8):
  17. @@ -48,6 +49,7 @@ async def send_uart_byte(dut, value: int) -> None:
  18. async def send_frame(dut, packet: bytes) -> None:
  19. + await NextTimeStep()
  20. for value in packet:
  21. await send_uart_byte(dut, value)