From: whitequark Date: Sat, 26 Oct 2019 02:40:18 +0000 (+0000) Subject: wishbone.bus.Interface: add support for LOCK_IO signal. X-Git-Tag: 24jan2021_ls180~28 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6be732c9cfca02177904a4c0ab1e64e710ebe96b;p=nmigen-soc.git wishbone.bus.Interface: add support for LOCK_IO signal. --- diff --git a/nmigen_soc/test/test_wishbone_bus.py b/nmigen_soc/test/test_wishbone_bus.py index 00da530..4380d21 100644 --- a/nmigen_soc/test/test_wishbone_bus.py +++ b/nmigen_soc/test/test_wishbone_bus.py @@ -44,7 +44,7 @@ class InterfaceTestCase(unittest.TestCase): def test_optional(self): iface = Interface(addr_width=32, data_width=32, - optional={"rty", "err", "stall", "cti", "bte"}) + optional={"rty", "err", "stall", "lock", "cti", "bte"}) self.assertEqual(iface.layout, Layout.cast([ ("adr", 32, DIR_FANOUT), ("dat_w", 32, DIR_FANOUT), @@ -57,6 +57,7 @@ class InterfaceTestCase(unittest.TestCase): ("err", 1, DIR_FANIN), ("rty", 1, DIR_FANIN), ("stall", 1, DIR_FANIN), + ("lock", 1, DIR_FANOUT), ("cti", CycleType, DIR_FANOUT), ("bte", BurstTypeExt, DIR_FANOUT), ])) diff --git a/nmigen_soc/wishbone/bus.py b/nmigen_soc/wishbone/bus.py index 5ee845f..b73598f 100644 --- a/nmigen_soc/wishbone/bus.py +++ b/nmigen_soc/wishbone/bus.py @@ -80,6 +80,8 @@ class Interface(Record): Optional. Corresponds to Wishbone signal ``RTY_I`` (initiator) or ``RTY_O`` (target). stall : Signal() Optional. Corresponds to Wishbone signal ``STALL_I`` (initiator) or ``STALL_O`` (target). + lock : Signal() + Optional. Corresponds to Wishbone signal ``LOCK_O`` (initiator) or ``LOCK_I`` (target). cti : Signal() Optional. Corresponds to Wishbone signal ``CTI_O`` (initiator) or ``CTI_I`` (target). bte : Signal() @@ -110,7 +112,7 @@ class Interface(Record): alignment=alignment) optional = set(optional) - unknown = optional - {"rty", "err", "stall", "cti", "bte"} + unknown = optional - {"rty", "err", "stall", "lock", "cti", "bte"} if unknown: raise ValueError("Optional signal(s) {} are not supported" .format(", ".join(map(repr, unknown)))) @@ -130,6 +132,8 @@ class Interface(Record): layout += [("rty", 1, Direction.FANIN)] if "stall" in optional: layout += [("stall", 1, Direction.FANIN)] + if "lock" in optional: + layout += [("lock", 1, Direction.FANOUT)] if "cti" in optional: layout += [("cti", CycleType, Direction.FANOUT)] if "bte" in optional: