From 8b4572f9cad34ac0c2b6f6bba9382e7b59b2f93b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 12 Dec 2023 15:54:57 +0800 Subject: [PATCH] core: pass artiq_builtins to NAC3 --- artiq/coredevice/core.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/core.py b/artiq/coredevice/core.py index 15bb80a5d..6aecfd60f 100644 --- a/artiq/coredevice/core.py +++ b/artiq/coredevice/core.py @@ -4,7 +4,7 @@ from numpy import int32, int64 import nac3artiq from artiq.language.core import * -from artiq.language.core import _ConstGenericMarker # nac3artiq.NAC3 needs to look up this private class +from artiq.language.core import _ConstGenericMarker from artiq.language import core as core_language from artiq.language.units import * from artiq.language.embedding_map import EmbeddingMap @@ -25,6 +25,14 @@ def rtio_get_counter() -> int64: raise NotImplementedError("syscall not simulated") +artiq_builtins = { + "none": none, + "virtual": virtual, + "_ConstGenericMarker": _ConstGenericMarker, + "Option": Option, +} + + @nac3 class Core: """Core device driver. @@ -58,7 +66,7 @@ class Core: self.comm.core = self self.target = target self.analyzed = False - self.compiler = nac3artiq.NAC3(target) + self.compiler = nac3artiq.NAC3(target, artiq_builtins) def close(self): self.comm.close()