Support channel names in RTIO errors #209

Merged
sb10q merged 3 commits from esavkin/artiq-zynq:1697-rtiomap into master 2023-01-09 12:35:56 +08:00
4 changed files with 4 additions and 4 deletions
Showing only changes of commit 3238ad2ef0 - Show all commits

View File

@ -199,7 +199,7 @@ pub extern fn dma_playback(timestamp: i64, ptr: i32) {
csr::rtio_dma::error_write(1); csr::rtio_dma::error_write(1);
if error & 1 != 0 { if error & 1 != 0 {
artiq_raise!("RTIOUnderflow", artiq_raise!("RTIOUnderflow",
Outdated
Review

Why is it {{1}} here and {1} in artiq?

Why is it ``{{1}}`` here and ``{1}`` in ``artiq``?
Outdated
Review

This remains unanswered and unaddressed.

This remains unanswered and unaddressed.

In this version format! macro is used. In artiq - it is not

In this version `format!` macro is used. In artiq - it is not
format!("RTIO underflow at channel {}:{}, {{0}} mu", channel, resolve_channel_name(channel as u32)), format!("RTIO underflow at {{0}} mu, channel {}:{}", channel, resolve_channel_name(channel as u32)),
timestamp as i64, channel as i64, 0); timestamp as i64, channel as i64, 0);
} }
if error & 2 != 0 { if error & 2 != 0 {

View File

@ -88,7 +88,7 @@ unsafe fn process_exceptional_status(channel: i32, status: i32) {
} }
if status & RTIO_O_STATUS_UNDERFLOW != 0 { if status & RTIO_O_STATUS_UNDERFLOW != 0 {
artiq_raise!("RTIOUnderflow", artiq_raise!("RTIOUnderflow",
format!("RTIO underflow at channel {}:{}, {{1}} mu, slack {{2}} mu", channel, resolve_channel_name(channel as u32)), format!("RTIO underflow at {{1}} mu, channel {}:{}, slack {{2}} mu", channel, resolve_channel_name(channel as u32)),
channel as i64, timestamp, timestamp - get_counter()); channel as i64, timestamp, timestamp - get_counter());
} }
if status & RTIO_O_STATUS_DESTINATION_UNREACHABLE != 0 { if status & RTIO_O_STATUS_DESTINATION_UNREACHABLE != 0 {

View File

@ -73,7 +73,7 @@ unsafe fn process_exceptional_status(channel: i32, status: u8) {
} }
if status & RTIO_O_STATUS_UNDERFLOW != 0 { if status & RTIO_O_STATUS_UNDERFLOW != 0 {
artiq_raise!("RTIOUnderflow", artiq_raise!("RTIOUnderflow",
format!("RTIO underflow at channel {}:{}, {{1}} mu, slack {{2}} mu", channel, resolve_channel_name(channel as u32)), format!("RTIO underflow at {{1}} mu, channel {}:{}, slack {{2}} mu", channel, resolve_channel_name(channel as u32)),
Outdated
Review

No. It's not "at channel".

No. It's not "at channel".
channel as i64, timestamp, timestamp - get_counter()); channel as i64, timestamp, timestamp - get_counter());
} }
if status & RTIO_O_STATUS_DESTINATION_UNREACHABLE != 0 { if status & RTIO_O_STATUS_DESTINATION_UNREACHABLE != 0 {

View File

@ -348,7 +348,7 @@ fn read_device_map(cfg: &Config) -> BTreeMap<u32, String> {
let channel = bytes_cr.read_u32().unwrap(); let channel = bytes_cr.read_u32().unwrap();
let device_name = bytes_cr.read_string().unwrap(); let device_name = bytes_cr.read_string().unwrap();
if let Some(old_entry) = device_map.insert(channel, device_name.clone()) { if let Some(old_entry) = device_map.insert(channel, device_name.clone()) {
error!("conflicting entries for channel {}: `{}` and `{}`", error!("read_device_map: conflicting entries for channel {}: `{}` and `{}`",
channel, old_entry, device_name); channel, old_entry, device_name);
} }
} }