mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 03:08:27 +08:00
gateware/rtio: add LogChannel
This commit is contained in:
parent
9ba8dfbf23
commit
080752092c
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user