gateware/rtio: add LogChannel

This commit is contained in:
Sebastien Bourdeauducq 2015-12-26 22:43:28 +08:00
parent 9ba8dfbf23
commit 080752092c
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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)