2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-29 13:13:34 +08:00

drtio: improve repeater error reports

This commit is contained in:
Sebastien Bourdeauducq 2018-09-12 20:54:01 +08:00
parent 420e1cb1d0
commit 0befec7d26
3 changed files with 13 additions and 3 deletions

View File

@ -124,11 +124,13 @@ impl Repeater {
error!("[REP#{}] received truncated packet", repno);
}
if errors & 4 != 0 {
let cmd;
let chan_sel;
unsafe {
cmd = (csr::DRTIOREP[repno].command_missed_cmd_read)();
chan_sel = (csr::DRTIOREP[repno].command_missed_chan_sel_read)();
}
error!("[REP#{}] CRI command missed, chan_sel=0x{:06x}", repno, chan_sel)
error!("[REP#{}] CRI command missed, cmd={}, chan_sel=0x{:06x}", repno, cmd, chan_sel)
}
if errors & 8 != 0 {
let destination;

View File

@ -10,6 +10,7 @@ class RTController(Module, AutoCSR):
def __init__(self, rt_packet):
self.set_time = CSR()
self.protocol_error = CSR(4)
self.command_missed_cmd = CSRStatus(2)
self.command_missed_chan_sel = CSRStatus(24)
self.buffer_space_timeout_dest = CSRStatus(8)
@ -28,7 +29,8 @@ class RTController(Module, AutoCSR):
(rt_packet.err_unknown_packet_type, "rtio_rx", None, None),
(rt_packet.err_packet_truncated, "rtio_rx", None, None),
(rt_packet.err_command_missed, "rtio",
rt_packet.cri.chan_sel, self.command_missed_chan_sel.status),
Cat(rt_packet.command_missed_cmd, rt_packet.command_missed_chan_sel),
Cat(self.command_missed_cmd.status, self.command_missed_chan_sel.status)),
(rt_packet.err_buffer_space_timeout, "rtio",
rt_packet.buffer_space_destination, self.buffer_space_timeout_dest.status)
]

View File

@ -19,6 +19,8 @@ class RTPacketRepeater(Module):
# in rtio domain
self.err_command_missed = Signal()
self.command_missed_cmd = Signal(2)
self.command_missed_chan_sel = Signal(24)
self.err_buffer_space_timeout = Signal()
self.buffer_space_destination = Signal(8)
@ -103,7 +105,11 @@ class RTPacketRepeater(Module):
# Missed commands
cri_ready = Signal()
self.sync.rtio += self.err_command_missed.eq(~cri_ready & (self.cri.cmd != cri.commands["nop"]))
self.sync.rtio += [
self.err_command_missed.eq(~cri_ready & (self.cri.cmd != cri.commands["nop"])),
self.command_missed_chan_sel.eq(self.cri.chan_sel),
self.command_missed_cmd.eq(self.cri.cmd)
]
# TX FSM
tx_fsm = ClockDomainsRenamer("rtio")(FSM(reset_state="IDLE"))