firware: restore exception id order

This commit is contained in:
abdul124 2024-08-23 12:27:57 +08:00
parent 0005508f83
commit e042a7868d

View File

@ -404,26 +404,18 @@ extern fn stop_fn(_version: c_int,
} }
// 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); 19] = [ static EXCEPTION_ID_LOOKUP: [(&str, u32); 11] = [
("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),
("AssertionError", 7), ("SPIError", 7),
("AttributeError", 8), ("ZeroDivisionError", 8),
("IndexError", 9), ("IndexError", 9),
("IOError", 10), ("UnwrapNoneError", 10),
("KeyError", 11),
("NotImplementedError", 12),
("OverflowError", 13),
("RuntimeError", 14),
("TimeoutError", 15),
("TypeError", 16),
("ValueError", 17),
("ZeroDivisionError", 18),
]; ];
pub fn get_exception_id(name: &str) -> u32 { pub fn get_exception_id(name: &str) -> u32 {