1
0
Fork 0

firmware: restore exception id order

This commit is contained in:
abdul124 2024-08-23 14:12:50 +08:00
parent 0e48524999
commit 953e60b4d2
1 changed files with 13 additions and 21 deletions

View File

@ -476,27 +476,19 @@ extern "C" fn stop_fn(
} }
// Must be kept in sync with preallocate_runtime_exception_names() in `artiq.compiler.embedding` // Must be kept in sync with preallocate_runtime_exception_names() in `artiq.compiler.embedding`
static EXCEPTION_ID_LOOKUP: [(&str, u32); 20] = [ static EXCEPTION_ID_LOOKUP: [(&str, u32); 12] = [
("RTIOUnderflow", 0), ("RuntimeError", 0),
("RTIOOverflow", 1), ("RTIOUnderflow", 1),
("RTIODestinationUnreachable", 2), ("RTIOOverflow", 2),
("DMAError", 3), ("RTIODestinationUnreachable", 3),
("I2CError", 4), ("DMAError", 4),
("CacheError", 5), ("I2CError", 5),
("SPIError", 6), ("CacheError", 6),
("SubkernelError", 7), ("SPIError", 7),
("AssertionError", 8), ("ZeroDivisionError", 8),
("AttributeError", 9), ("IndexError", 9),
("IndexError", 10), ("UnwrapNoneError", 10),
("IOError", 11), ("SubkernelError", 11),
("KeyError", 12),
("NotImplementedError", 13),
("OverflowError", 14),
("RuntimeError", 15),
("TimeoutError", 16),
("TypeError", 17),
("ValueError", 18),
("ZeroDivisionError", 19),
]; ];
pub fn get_exception_id(name: &str) -> u32 { pub fn get_exception_id(name: &str) -> u32 {