From 080752092c484ef373edbf2912b31308f3e24970 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 26 Dec 2015 22:43:28 +0800 Subject: [PATCH] gateware/rtio: add LogChannel --- artiq/gateware/rtio/__init__.py | 2 +- artiq/gateware/rtio/core.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/artiq/gateware/rtio/__init__.py b/artiq/gateware/rtio/__init__.py index 9f37a2c32..88ef7fb57 100644 --- a/artiq/gateware/rtio/__init__.py +++ b/artiq/gateware/rtio/__init__.py @@ -1,3 +1,3 @@ -from artiq.gateware.rtio.core import Channel, RTIO +from artiq.gateware.rtio.core import Channel, LogChannel, RTIO from artiq.gateware.rtio.analyzer import Analyzer from artiq.gateware.rtio.moninj import MonInj diff --git a/artiq/gateware/rtio/core.py b/artiq/gateware/rtio/core.py index 94e250c62..e258b2a04 100644 --- a/artiq/gateware/rtio/core.py +++ b/artiq/gateware/rtio/core.py @@ -310,6 +310,15 @@ class Channel: return cls(phy.rtlink, probes, overrides, **kwargs) +class LogChannel: + """A degenerate channel used to log messages into the analyzer.""" + def __init__(self): + self.interface = rtlink.Interface( + rtlink.OInterface(32, suppress_nop=False)) + self.probes = [] + self.overrides = [] + + class _KernelCSRs(AutoCSR): def __init__(self, chan_sel_width, data_width, address_width, full_ts_width): @@ -385,6 +394,12 @@ class RTIO(Module): o_statuses, i_statuses = [], [] sel = self.kcsrs.chan_sel.storage for n, channel in enumerate(channels): + if isinstance(channel, LogChannel): + i_datas.append(0) + i_timestamps.append(0) + i_statuses.append(0) + continue + selected = Signal() self.comb += selected.eq(sel == n)