Add ReadOnly trigger to ensure that dut writes have had a chance to take effect
This was needed to make tests pass.
@@ -27,7 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. '''
import logging
import cocotb
-from cocotb.triggers import RisingEdge, Timer
+from cocotb.triggers import RisingEdge, Timer, ReadOnly
from cocotb.clock import Clock
from cocotb.drivers.avalon import AvalonMaster
from cocotb.result import ReturnValue, TestFailure
@@ -85,6 +85,8 @@ def initial_hal_test(dut, debug=True):
yield cocotb.external(hal.endian_swapper_enable)(state)
+ yield ReadOnly()
+
if not dut.byteswapping.value:
raise TestFailure("Byteswapping wasn't enabled after calling "
"endian_swapper_enable")
