diff --git a/artiq/firmware/satman/repeater.rs b/artiq/firmware/satman/repeater.rs index 6f5b7b28f..889e4aba7 100644 --- a/artiq/firmware/satman/repeater.rs +++ b/artiq/firmware/satman/repeater.rs @@ -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; diff --git a/artiq/gateware/drtio/rt_controller_repeater.py b/artiq/gateware/drtio/rt_controller_repeater.py index 655bf641e..b877700b1 100644 --- a/artiq/gateware/drtio/rt_controller_repeater.py +++ b/artiq/gateware/drtio/rt_controller_repeater.py @@ -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) ] diff --git a/artiq/gateware/drtio/rt_packet_repeater.py b/artiq/gateware/drtio/rt_packet_repeater.py index 0ecd353a8..7f709589f 100644 --- a/artiq/gateware/drtio/rt_packet_repeater.py +++ b/artiq/gateware/drtio/rt_packet_repeater.py @@ -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"))