Compare commits

..

No commits in common. "cbc660e740453a8b43f7c13ea0358caed2bc9f57" and "8cb6cf6094b5ad2d5a6177ee96b3a9ece3c61796" have entirely different histories.

5 changed files with 20 additions and 40 deletions

View File

@ -11,11 +11,11 @@
"src-pythonparser": "src-pythonparser"
},
"locked": {
"lastModified": 1681792537,
"narHash": "sha256-xqjG9o6ubK40XDdw/yzqcNxlnA919BwsPizCyb7GXZA=",
"lastModified": 1680398257,
"narHash": "sha256-ANODm+Xjx/OYHkmQpybDuIPXiu22IkoQ0wdI0ReQsNk=",
"ref": "refs/heads/master",
"rev": "918d30b90072d4c1afbdf17215f24d15edc09e62",
"revCount": 8331,
"rev": "7ba06bfe61cad4ad41f478188917cac6571a6875",
"revCount": 8323,
"type": "git",
"url": "https://github.com/m-labs/artiq.git"
},

View File

@ -330,7 +330,7 @@ async fn handle_run_kernel(
rtio_dma::erase(name, aux_mutex, routing_table, timer).await;
}
kernel::Message::DmaGetRequest(name) => {
let result = rtio_dma::retrieve(name).await;
let result = rtio_dma::retrieve(name);
control
.borrow_mut()
.tx

View File

@ -10,7 +10,6 @@ use crate::{artiq_raise, pl::csr, rtio};
pub struct DmaTrace {
duration: i64,
address: i32,
uses_ddma: bool,
}
#[derive(Clone, Debug)]
@ -152,12 +151,8 @@ pub extern "C" fn dma_retrieve(name: CSlice<u8>) -> DmaTrace {
}
match unsafe { KERNEL_CHANNEL_0TO1.as_mut().unwrap() }.recv() {
Message::DmaGetReply(None) => (),
Message::DmaGetReply(Some((address, duration, uses_ddma))) => {
return DmaTrace {
address,
duration,
uses_ddma,
};
Message::DmaGetReply(Some((address, duration))) => {
return DmaTrace { address, duration };
}
_ => panic!("Expected DmaGetReply after DmaGetRequest!"),
}
@ -165,7 +160,7 @@ pub extern "C" fn dma_retrieve(name: CSlice<u8>) -> DmaTrace {
artiq_raise!("DMAError", "DMA trace not found");
}
pub extern "C" fn dma_playback(timestamp: i64, ptr: i32, _uses_ddma: bool) {
pub extern "C" fn dma_playback(timestamp: i64, ptr: i32) {
unsafe {
csr::rtio_dma::base_address_write(ptr as u32);
csr::rtio_dma::time_offset_write(timestamp as u64);
@ -173,15 +168,13 @@ pub extern "C" fn dma_playback(timestamp: i64, ptr: i32, _uses_ddma: bool) {
csr::cri_con::selected_write(1);
csr::rtio_dma::enable_write(1);
#[cfg(has_drtio)]
if _uses_ddma {
KERNEL_CHANNEL_1TO0
.as_mut()
.unwrap()
.send(Message::DmaStartRemoteRequest {
id: ptr,
timestamp: timestamp,
});
}
KERNEL_CHANNEL_1TO0
.as_mut()
.unwrap()
.send(Message::DmaStartRemoteRequest {
id: ptr,
timestamp: timestamp,
});
while csr::rtio_dma::enable_read() != 0 {}
csr::cri_con::selected_write(0);
@ -210,7 +203,7 @@ pub extern "C" fn dma_playback(timestamp: i64, ptr: i32, _uses_ddma: bool) {
}
}
#[cfg(has_drtio)]
if _uses_ddma {
{
KERNEL_CHANNEL_1TO0
.as_mut()
.unwrap()

View File

@ -52,7 +52,7 @@ pub enum Message {
DmaPutRequest(DmaRecorder),
DmaEraseRequest(String),
DmaGetRequest(String),
DmaGetReply(Option<(i32, i64, bool)>),
DmaGetReply(Option<(i32, i64)>),
#[cfg(has_drtio)]
DmaStartRemoteRequest {
id: i32,

View File

@ -193,7 +193,7 @@ pub mod remote_dma {
up: bool,
) {
// update state of the destination, resend traces if it's up
if let Some(trace) = self.traces.async_lock().await.get_mut(&destination) {
if let Some(trace) = self.traces.lock().get_mut(&destination) {
if up {
match drtio::ddma_upload_trace(
aux_mutex,
@ -213,10 +213,6 @@ pub mod remote_dma {
}
}
}
pub async fn is_empty(&self) -> bool {
self.traces.async_lock().await.is_empty()
}
}
static mut TRACES: BTreeMap<u32, TraceSet> = BTreeMap::new();
@ -273,11 +269,6 @@ pub mod remote_dma {
.await;
}
}
pub async fn has_remote_traces(id: u32) -> bool {
let trace_set = unsafe { TRACES.get_mut(&id).unwrap() };
!(trace_set.is_empty().await)
}
}
pub async fn put_record(
@ -352,11 +343,7 @@ pub async fn erase(name: String, _aux_mutex: &Rc<Mutex<bool>>, _routing_table: &
}
}
pub async fn retrieve(name: String) -> Option<(i32, i64, bool)> {
pub fn retrieve(name: String) -> Option<(i32, i64)> {
let (ptr, _v, duration) = DMA_RECORD_STORE.lock().get(&name)?.clone();
#[cfg(has_drtio)]
let uses_ddma = remote_dma::has_remote_traces(ptr).await;
#[cfg(not(has_drtio))]
let uses_ddma = false;
Some((ptr as i32, duration, uses_ddma))
Some((ptr as i32, duration))
}