m.d.sync += [ # Enable CS sram_0.cs.o.eq(0), # Setup address sram_0.a.o.eq(0x00000), # Enable lower/upper byte mask sram_0.dm.o[0].eq(0), sram_0.dm.o[1].eq(0), ] m.next = "READ_A2" with m.State("READ_A2"): m.d.sync += [ # Lower OE to start read cycle sram_0.oe.o.eq(0), ] m.next = "READ_A3a" with m.State("READ_A3a"): # m.d.sync += [ # ] m.next = "READ_A3" with m.State("READ_A3"): m.d.sync += [ # Disable CS sram_0.cs.o.eq(1), # Disable lower/upper byte mask sram_0.dm.o[0].eq(1), sram_0.dm.o[1].eq(1), # Data valid read readBuf.eq(sram_0.d.i[0:16]), ] m.next = "READ_A4" with m.State("READ_A4"): m.d.sync += [ # Raise OE to complete read cycle sram_0.oe.o.eq(1), ] m.next = "READ_A5" with m.State("READ_A5"): m.d.sync += [ stateBuf.eq(0b10000001), # Write buf to LEDs pmod_b.o.eq(readBuf[0:8]), ] m.next = "READ_A5"