From cc3d86ff1231db71952686887ea8cc2c875cbd3b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 6 Jun 2022 23:43:43 +0800 Subject: [PATCH] test_cache: port to NAC3 --- artiq/test/coredevice/test_cache.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/artiq/test/coredevice/test_cache.py b/artiq/test/coredevice/test_cache.py index 5fc94e4ed..10d586e02 100644 --- a/artiq/test/coredevice/test_cache.py +++ b/artiq/test/coredevice/test_cache.py @@ -1,27 +1,38 @@ +import unittest + +from numpy import int32 + from artiq.experiment import * +from artiq.coredevice.core import Core +from artiq.coredevice.cache import CoreCache from artiq.coredevice.exceptions import CacheError from artiq.test.hardware_testbench import ExperimentCase +@nac3 class _Cache(EnvExperiment): + core: KernelInvariant[Core] + core_cache: KernelInvariant[CoreCache] + def build(self): self.setattr_device("core") self.setattr_device("core_cache") @kernel - def get(self, key): + def get(self, key: str) -> list[int32]: return self.core_cache.get(key) @kernel - def put(self, key, value): + def put(self, key: str, value: list[int32]): self.core_cache.put(key, value) @kernel - def get_put(self, key, value): + def get_put(self, key: str, value: list[int32]): self.get(key) self.put(key, value) +@unittest.skip("NAC3TODO https://git.m-labs.hk/M-Labs/nac3/issues/299") class CacheTest(ExperimentCase): def test_get_empty(self): exp = self.create(_Cache)