@@ 456,7 456,7 @@ async def different_clock_256(dut):
async def inverted_clock(dut):
clk = Clock(dut.clk_i, 5, "ns")
interface = SpiInterface(dut.csn_o, dut.sck_o, dut.miso_i, dut.mosi_o)
- config = SpiConfig(8, RisingEdge, FallingEdge, 10, "ns")
+ config = SpiConfig(8, RisingEdge, FallingEdge, 10, "ns", clock_polarity = 1)
slave = SpiSlave(interface, config)
driver = DutDriver(dut)
@@ 480,7 480,7 @@ async def inverted_clock(dut):
async def shifted_inverted_clock(dut):
clk = Clock(dut.clk_i, 5, "ns")
interface = SpiInterface(dut.csn_o, dut.sck_o, dut.miso_i, dut.mosi_o)
- config = SpiConfig(8, FallingEdge, RisingEdge, 10, "ns")
+ config = SpiConfig(8, FallingEdge, RisingEdge, 10, "ns", clock_polarity = 1)
slave = SpiSlave(interface, config)
driver = DutDriver(dut)
@@ 502,6 502,7 @@ async def shifted_inverted_clock(dut):
await Timer(100, "ns")
dut.clock_phase_i.value = 1
dut.clock_polarity_i.value = 0
+ slave.config.clock_polarity = 0
await FallingEdge(dut.clk_i)
await perform_multiple_transmits(count, dut, slave, driver)
@@ 512,7 513,7 @@ async def shifted_inverted_clock(dut):
async def sixteen_bits(dut):
clk = Clock(dut.clk_i, 5, "ns")
interface = SpiInterface(dut.csn_o, dut.sck_o, dut.miso_i, dut.mosi_o)
- config = SpiConfig(16, FallingEdge, RisingEdge, 10, "ns")
+ config = SpiConfig(16, FallingEdge, RisingEdge, 10, "ns", clock_polarity = 1)
slave = SpiSlave(interface, config)
driver = DutDriver(dut)