From 064503f22422bc4e318de644f7e2b7cfcdff3209 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 16 Sep 2017 10:52:13 +0800 Subject: [PATCH] rtio/sed/LaneDistributor: support specifying existing CRI --- artiq/gateware/rtio/sed/lane_distributor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/artiq/gateware/rtio/sed/lane_distributor.py b/artiq/gateware/rtio/sed/lane_distributor.py index a65521028..1c191ba6f 100644 --- a/artiq/gateware/rtio/sed/lane_distributor.py +++ b/artiq/gateware/rtio/sed/lane_distributor.py @@ -7,18 +7,19 @@ from artiq.gateware.rtio.sed import layouts __all__ = ["LaneDistributor"] - # CRI write happens in 3 cycles: # 1. set timestamp # 2. set other payload elements and issue write command # 3. check status class LaneDistributor(Module): - def __init__(self, lane_count, seqn_width, layout_payload, fine_ts_width, enable_spread=True): + def __init__(self, lane_count, seqn_width, layout_payload, fine_ts_width, enable_spread=True, interface=None): if lane_count & (lane_count - 1): raise NotImplementedError("lane count must be a power of 2") - self.cri = cri.Interface() + if interface is None: + interface = cri.Interface() + self.cri = interface self.minimum_coarse_timestamp = Signal(64-fine_ts_width) self.lane_io = [Record(layouts.fifo_ingress(seqn_width, layout_payload)) for _ in range(lane_count)]