From 6aec42383822017bffcd1c2181ba6a89fcdb1025 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Sat, 26 Mar 2022 19:22:39 +0800 Subject: [PATCH] coredevice/comm_kernel: attributes writeback update --- artiq/coredevice/comm_kernel.py | 6 +++--- artiq/language/embedding_map.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/artiq/coredevice/comm_kernel.py b/artiq/coredevice/comm_kernel.py index 77f1ed74d..670d2cc41 100644 --- a/artiq/coredevice/comm_kernel.py +++ b/artiq/coredevice/comm_kernel.py @@ -658,10 +658,10 @@ class CommKernel: return_tags = self._read_bytes() if service_id == 0: - def service(header, *values): + def service(*values): counter = 0 - for obj in json.loads(header): - old_val = embedding_map.globals_map[obj["id"]] + for obj in embedding_map.attributes_writeback: + old_val = obj["obj"] if "fields" in obj: for name in obj["fields"]: setattr(old_val, name, values[counter]) diff --git a/artiq/language/embedding_map.py b/artiq/language/embedding_map.py index 64a041a6f..466426121 100644 --- a/artiq/language/embedding_map.py +++ b/artiq/language/embedding_map.py @@ -9,7 +9,7 @@ class EmbeddingMap: self.string_map = {} self.string_reverse_map = {} self.function_map = {} - self.globals_map = {} + self.attributes_writeback = [] # preallocate exception names # must be kept in sync with EXCEPTION_ID_LOOKUP in artiq/firmware/ksupport/eh_artiq.rs,