1
0
Fork 0

firmware: sync exception names and ids

This commit is contained in:
abdul124 2024-08-21 16:34:25 +08:00
parent 20181e9915
commit bae41253e4
1 changed files with 22 additions and 14 deletions

View File

@ -477,20 +477,28 @@ extern "C" fn stop_fn(
} }
} }
// Must be kept in sync with preallocate_runtime_exception_names() in artiq/language/embedding_map.py // Must be kept in sync with preallocate_runtime_exception_names() in `artiq.compiler.embedding`
static EXCEPTION_ID_LOOKUP: [(&str, u32); 12] = [ static EXCEPTION_ID_LOOKUP: [(&str, u32); 20] = [
("RuntimeError", 0), ("RTIOUnderflow", 0),
("RTIOUnderflow", 1), ("RTIOOverflow", 1),
("RTIOOverflow", 2), ("RTIODestinationUnreachable", 2),
("RTIODestinationUnreachable", 3), ("DMAError", 3),
("DMAError", 4), ("I2CError", 4),
("I2CError", 5), ("CacheError", 5),
("CacheError", 6), ("SPIError", 6),
("SPIError", 7), ("SubkernelError", 7),
("ZeroDivisionError", 8), ("AssertionError", 8),
("IndexError", 9), ("AttributeError", 9),
("UnwrapNoneError", 10), ("IndexError", 10),
("SubkernelError", 11), ("IOError", 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 {