@@ -129,24 +129,28 @@ def __init__(self, interface, counter, fifo_depth, guard_io_cycles):
129
129
collision = Signal ()
130
130
any_error = Signal ()
131
131
nop = Signal ()
132
- self . sync . rsys += [
132
+ if interface . enable_replace :
133
133
# Note: replace may be asserted at the same time as collision
134
134
# 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 += \
136
137
# Detect sequence errors on coarse timestamps only
137
138
# so that they are mutually exclusive with collision errors.
138
139
sequence_error .eq (self .ev .timestamp [fine_ts_width :]
139
140
< 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 ))
143
151
else :
144
- different_addresses = 0
145
- if fine_ts_width :
146
152
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 :])
150
154
self .comb += any_error .eq (sequence_error | collision )
151
155
if interface .suppress_nop :
152
156
# disable NOP at reset: do not suppress a first write with all 0s
0 commit comments