Skip to content

Commit 03b53c3

Browse files
committedMar 9, 2016
rtio: disable replace on rt2wb channels
1 parent 1c706fa commit 03b53c3

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed
 

‎artiq/gateware/rtio/core.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,28 @@ def __init__(self, interface, counter, fifo_depth, guard_io_cycles):
129129
collision = Signal()
130130
any_error = Signal()
131131
nop = Signal()
132-
self.sync.rsys += [
132+
if interface.enable_replace:
133133
# Note: replace may be asserted at the same time as collision
134134
# when addresses are different. In that case, it is a collision.
135-
replace.eq(self.ev.timestamp == buf.timestamp),
135+
self.sync.rsys += replace.eq(self.ev.timestamp == buf.timestamp)
136+
self.sync.rsys += \
136137
# Detect sequence errors on coarse timestamps only
137138
# so that they are mutually exclusive with collision errors.
138139
sequence_error.eq(self.ev.timestamp[fine_ts_width:]
139140
< buf.timestamp[fine_ts_width:])
140-
]
141-
if hasattr(self.ev, "a"):
142-
different_addresses = self.ev.a != buf.a
141+
if interface.enable_replace:
142+
if hasattr(self.ev, "a"):
143+
different_addresses = self.ev.a != buf.a
144+
else:
145+
different_addresses = 0
146+
if fine_ts_width:
147+
self.sync.rsys += collision.eq(
148+
(self.ev.timestamp[fine_ts_width:] == buf.timestamp[fine_ts_width:])
149+
& ((self.ev.timestamp[:fine_ts_width] != buf.timestamp[:fine_ts_width])
150+
|different_addresses))
143151
else:
144-
different_addresses = 0
145-
if fine_ts_width:
146152
self.sync.rsys += collision.eq(
147-
(self.ev.timestamp[fine_ts_width:] == buf.timestamp[fine_ts_width:])
148-
& ((self.ev.timestamp[:fine_ts_width] != buf.timestamp[:fine_ts_width])
149-
|different_addresses))
153+
self.ev.timestamp[fine_ts_width:] == buf.timestamp[fine_ts_width:])
150154
self.comb += any_error.eq(sequence_error | collision)
151155
if interface.suppress_nop:
152156
# disable NOP at reset: do not suppress a first write with all 0s

‎artiq/gateware/rtio/phy/wishbone.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def __init__(self, address_width, wb=None):
1313
rtlink.OInterface(
1414
len(wb.dat_w),
1515
address_width + 1,
16-
suppress_nop=False),
16+
suppress_nop=False,
17+
enable_replace=False),
1718
rtlink.IInterface(
1819
len(wb.dat_r),
1920
timestamped=False)

‎artiq/gateware/rtio/rtlink.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
class OInterface:
55
def __init__(self, data_width, address_width=0,
6-
fine_ts_width=0, suppress_nop=True):
6+
fine_ts_width=0, suppress_nop=True,
7+
enable_replace=True):
78
self.stb = Signal()
89
self.busy = Signal()
910

@@ -15,6 +16,7 @@ def __init__(self, data_width, address_width=0,
1516
self.fine_ts = Signal(fine_ts_width)
1617

1718
self.suppress_nop = suppress_nop
19+
self.enable_replace = enable_replace
1820

1921
@classmethod
2022
def like(cls, other):

0 commit comments

Comments
 (0)
Please sign in to comment.