test/spi_mmap: lint and autoformat with Ruff

This commit is contained in:
Andrew Dennison 2024-02-25 09:16:17 +11:00
parent 2e67f6a1a3
commit 4bc47c959f
1 changed files with 8 additions and 7 deletions

View File

@ -6,27 +6,28 @@
# SPDX-License-Identifier: BSD-2-Clause
import unittest
import random
from migen import *
from migen import Record
from litex.gen.sim import *
from litex.gen.sim import run_simulation
from litex.soc.cores.spi.spi_mmap import SPIMaster
class TestSPIMMAP(unittest.TestCase):
def test_spi_master(self):
pads = Record([("clk", 1), ("cs_n", 4), ("mosi", 1), ("miso", 1)])
dut = SPIMaster(pads=pads, data_width=32, sys_clk_freq=int(100e6))
dut = SPIMaster(pads=pads, data_width=32, sys_clk_freq=int(100e6))
def generator(dut):
data = [
0x12345678,
0xdeadbeef,
0xDEADBEEF,
]
#data = [
# data = [
# 0x80000001,
# 0x80000001,
#]
# ]
# Config: Mode0, Loopback, Sys-Clk/4
yield dut.loopback.eq(1)