Skip to content

Commit 6be732c

Browse files
committed
wishbone.bus.Interface: add support for LOCK_IO signal.
1 parent 66548b1 commit 6be732c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

nmigen_soc/test/test_wishbone_bus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_granularity(self):
4444

4545
def test_optional(self):
4646
iface = Interface(addr_width=32, data_width=32,
47-
optional={"rty", "err", "stall", "cti", "bte"})
47+
optional={"rty", "err", "stall", "lock", "cti", "bte"})
4848
self.assertEqual(iface.layout, Layout.cast([
4949
("adr", 32, DIR_FANOUT),
5050
("dat_w", 32, DIR_FANOUT),
@@ -57,6 +57,7 @@ def test_optional(self):
5757
("err", 1, DIR_FANIN),
5858
("rty", 1, DIR_FANIN),
5959
("stall", 1, DIR_FANIN),
60+
("lock", 1, DIR_FANOUT),
6061
("cti", CycleType, DIR_FANOUT),
6162
("bte", BurstTypeExt, DIR_FANOUT),
6263
]))

nmigen_soc/wishbone/bus.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class Interface(Record):
8080
Optional. Corresponds to Wishbone signal ``RTY_I`` (initiator) or ``RTY_O`` (target).
8181
stall : Signal()
8282
Optional. Corresponds to Wishbone signal ``STALL_I`` (initiator) or ``STALL_O`` (target).
83+
lock : Signal()
84+
Optional. Corresponds to Wishbone signal ``LOCK_O`` (initiator) or ``LOCK_I`` (target).
8385
cti : Signal()
8486
Optional. Corresponds to Wishbone signal ``CTI_O`` (initiator) or ``CTI_I`` (target).
8587
bte : Signal()
@@ -110,7 +112,7 @@ def __init__(self, *, addr_width, data_width, granularity=None, optional=frozens
110112
alignment=alignment)
111113

112114
optional = set(optional)
113-
unknown = optional - {"rty", "err", "stall", "cti", "bte"}
115+
unknown = optional - {"rty", "err", "stall", "lock", "cti", "bte"}
114116
if unknown:
115117
raise ValueError("Optional signal(s) {} are not supported"
116118
.format(", ".join(map(repr, unknown))))
@@ -130,6 +132,8 @@ def __init__(self, *, addr_width, data_width, granularity=None, optional=frozens
130132
layout += [("rty", 1, Direction.FANIN)]
131133
if "stall" in optional:
132134
layout += [("stall", 1, Direction.FANIN)]
135+
if "lock" in optional:
136+
layout += [("lock", 1, Direction.FANOUT)]
133137
if "cti" in optional:
134138
layout += [("cti", CycleType, Direction.FANOUT)]
135139
if "bte" in optional:

0 commit comments

Comments
 (0)