artiq icon indicating copy to clipboard operation
artiq copied to clipboard

[RFC] add channel names to RTIO errors

Open hartytp opened this issue 3 years ago • 6 comments

At present RTIO errors (underflow, overflow, sequence) give only a channel number. That can make debugging experiment code quite painful.

It would be really nice if we provided more human-understandable channel descriptions as well as/instead of the channel numbers. Maybe grab a device name from the device db and then (as a luxury) add some driver-dependent additional information (something like dds0.spi).

hartytp avatar Jun 11 '21 08:06 hartytp

+1; this is a surprisingly obvious idea that I can't believe didn't occur to me earlier.

dnadlinger avatar Jun 11 '21 16:06 dnadlinger

(This would be especially useful in situations where you don't have a backtrace available, which often provides enough context otherwise.)

dnadlinger avatar Jun 11 '21 16:06 dnadlinger

okay, thanks for the input @dnadlinger It felt so obvious that I wasn't sure if there was a reason it's actually completely infeasible.

Okay, I'll add that to our to fix list...

hartytp avatar Jun 11 '21 20:06 hartytp

Obvious as in a feature that should obviously exist. :) The implementation might require some finesse, though, in terms of finding a way that avoids breaking the various abstractions as much as possible. Presumably the artiq.coredevice.core code would need to inspect the exception types, and on a match interpret the extra int data sent by the core device a certain way. Either way, I'd say it's definitely worth a small amount of complications.

dnadlinger avatar Jun 11 '21 20:06 dnadlinger

This would be such a quality of life improvement! 👍

cjbe avatar Jun 11 '21 20:06 cjbe

A step on the way there would be a standalone tool (e.g. part of artiq_client) that resolves RTIO channel indices. This would still require adding some metadata to the device_db to resolve the channel ids, but would avoid messing with the EH machinery.

dnadlinger avatar Jul 16 '21 18:07 dnadlinger

Needs port to the Zynq firmware

sbourdeauducq avatar Dec 02 '22 08:12 sbourdeauducq

This also broke the tests. Good c591e7e305e98475fd293676cef19a030f7a260f https://nixbld.m-labs.hk/eval/5452 Bad 1852491102752c83f6689a316e61b8000454d4fa https://nixbld.m-labs.hk/eval/5456

sbourdeauducq avatar Dec 03 '22 08:12 sbourdeauducq

Bad 1852491 https://nixbld.m-labs.hk/eval/5456

https://github.com/m-labs/artiq/pull/2017

thomasfire avatar Dec 06 '22 09:12 thomasfire