From 248d8cbece2d2b0c91ad9f31158c54629eb01c9f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 2 Oct 2021 23:40:06 +0800 Subject: [PATCH] nac3artiq: handle now-pinning depending on target --- nac3artiq/artiq_builtins.py | 17 ++++------------- nac3artiq/artiq_timeline_extern.py | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 nac3artiq/artiq_timeline_extern.py diff --git a/nac3artiq/artiq_builtins.py b/nac3artiq/artiq_builtins.py index 55a11f0a..dc5c6eaa 100644 --- a/nac3artiq/artiq_builtins.py +++ b/nac3artiq/artiq_builtins.py @@ -1,20 +1,11 @@ -from language import * from numpy import int32, int64 -@extern -def now_mu() -> int64: - raise NotImplementedError("syscall not simulated") +from language import * -@extern -def at_mu(t: int64): - raise NotImplementedError("syscall not simulated") - - -@extern -def delay_mu(dt: int64): - raise NotImplementedError("syscall not simulated") - +import device_db +if device_db.device_db["core"]["arguments"]["target"] == "cortexa9": + from artiq_timeline_extern import * @extern def rtio_init(): diff --git a/nac3artiq/artiq_timeline_extern.py b/nac3artiq/artiq_timeline_extern.py new file mode 100644 index 00000000..fccf81ca --- /dev/null +++ b/nac3artiq/artiq_timeline_extern.py @@ -0,0 +1,20 @@ +from numpy import int32, int64 +from language import * + + +__all__ = ["now_mu", "at_mu", "delay_mu"] + + +@extern +def now_mu() -> int64: + raise NotImplementedError("syscall not simulated") + + +@extern +def at_mu(t: int64): + raise NotImplementedError("syscall not simulated") + + +@extern +def delay_mu(dt: int64): + raise NotImplementedError("syscall not simulated")