diff --git a/artiq/firmware/ksupport/lib.rs b/artiq/firmware/ksupport/lib.rs index 1af9f7b46..6693b7196 100644 --- a/artiq/firmware/ksupport/lib.rs +++ b/artiq/firmware/ksupport/lib.rs @@ -405,6 +405,7 @@ extern fn dma_playback(timestamp: i64, ptr: i32) { csr::cri_con::selected_write(1); csr::rtio_dma::enable_write(1); + #[cfg(has_drtio)] send(&DmaStartRemoteRequest { id: ptr as i32, timestamp: timestamp }); while csr::rtio_dma::enable_read() != 0 {} csr::cri_con::selected_write(0); @@ -427,23 +428,29 @@ extern fn dma_playback(timestamp: i64, ptr: i32) { } } - send(&DmaAwaitRemoteRequest { id: ptr as i32 }); - recv!(&DmaAwaitRemoteReply { timeout, error, channel, timestamp } => { - if timeout { - raise!("DMAError", - "Error running DMA on satellite device, timed out waiting for results"); - } - if error & 1 != 0 { - raise!("RTIOUnderflow", - "RTIO underflow at channel {rtio_channel_info:0}, {1} mu", - channel as i64, timestamp as i64, 0); - } - if error & 2 != 0 { - raise!("RTIODestinationUnreachable", - "RTIO destination unreachable, output, at channel {rtio_channel_info:0}, {1} mu", - channel as i64, timestamp as i64, 0); - } - }); + #[cfg(has_drtio)] + { + send(&DmaAwaitRemoteRequest { id: ptr as i32 }); + recv!(&DmaAwaitRemoteReply { timeout, error, channel, timestamp } => { + if timeout { + println!("timeout\n"); + raise!("DMAError", + "Error running DMA on satellite device, timed out waiting for results"); + } + if error & 1 != 0 { + println!("rtio underflow from ddma\n"); + raise!("RTIOUnderflow", + "RTIO underflow at channel {rtio_channel_info:0}, {1} mu", + channel as i64, timestamp as i64, 0); + } + if error & 2 != 0 { + println!("rtio destun from ddma\n"); + raise!("RTIODestinationUnreachable", + "RTIO destination unreachable, output, at channel {rtio_channel_info:0}, {1} mu", + channel as i64, timestamp as i64, 0); + } + }); + } } #[cfg(not(has_rtio_dma))] diff --git a/artiq/firmware/runtime/rtio_dma.rs b/artiq/firmware/runtime/rtio_dma.rs index 1ec15384e..d388d9bfc 100644 --- a/artiq/firmware/runtime/rtio_dma.rs +++ b/artiq/firmware/runtime/rtio_dma.rs @@ -218,12 +218,13 @@ impl Manager { self.recording_trace.extend_from_slice(data) } - pub fn record_stop(&mut self, duration: u64, enable_ddma: bool, + pub fn record_stop(&mut self, duration: u64, _enable_ddma: bool, _io: &Io, _ddma_mutex: &Mutex) -> u32 { let mut local_trace = Vec::new(); - let mut remote_traces: BTreeMap> = BTreeMap::new(); + let mut _remote_traces: BTreeMap> = BTreeMap::new(); - if enable_ddma { + #[cfg(has_drtio)] + if _enable_ddma { let mut trace = Vec::new(); mem::swap(&mut self.recording_trace, &mut trace); trace.push(0); @@ -239,10 +240,10 @@ impl Manager { local_trace.extend(&trace[ptr..ptr+len]); } else { - if let Some(remote_trace) = remote_traces.get_mut(&destination) { + if let Some(remote_trace) = _remote_traces.get_mut(&destination) { remote_trace.extend(&trace[ptr..ptr+len]); } else { - remote_traces.insert(destination, trace[ptr..ptr+len].to_vec()); + _remote_traces.insert(destination, trace[ptr..ptr+len].to_vec()); } } // and jump to the next event @@ -278,7 +279,7 @@ impl Manager { self.name_map.insert(name, id); #[cfg(has_drtio)] - remote_dma::add_traces(_io, _ddma_mutex, id, remote_traces); + remote_dma::add_traces(_io, _ddma_mutex, id, _remote_traces); id }