forked from M-Labs/artiq
1
0
Fork 0

add comments about preallocate_runtime_exception_names/EXCEPTION_ID_LOOKUP syncing

This commit is contained in:
Sebastien Bourdeauducq 2022-02-13 13:48:05 +08:00
parent 9f620491a9
commit ec6c6dd988
2 changed files with 3 additions and 0 deletions

View File

@ -333,6 +333,7 @@ extern fn stop_fn(_version: c_int,
} }
} }
// Must be kept in sync with preallocate_runtime_exception_names() in artiq/language/embedding_map.py
static EXCEPTION_ID_LOOKUP: [(&str, u32); 10] = [ static EXCEPTION_ID_LOOKUP: [(&str, u32); 10] = [
("RuntimeError", 0), ("RuntimeError", 0),
("RTIOUnderflow", 1), ("RTIOUnderflow", 1),

View File

@ -11,6 +11,8 @@ class EmbeddingMap:
self.function_map = {} self.function_map = {}
# preallocate exception names # preallocate exception names
# must be kept in sync with EXCEPTION_ID_LOOKUP in artiq/firmware/ksupport/eh_artiq.rs,
# and src/runtime/src/eh_artiq.rs (Zynq)
self.preallocate_runtime_exception_names(["RuntimeError", self.preallocate_runtime_exception_names(["RuntimeError",
"RTIOUnderflow", "RTIOUnderflow",
"RTIOOverflow", "RTIOOverflow",