2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 11:18:27 +08:00

artiq/language/core.py: define print_rpc

This commit is contained in:
pca006132 2022-03-09 11:00:20 +08:00
parent 87154ea016
commit be3f05a4c0

View File

@ -6,6 +6,7 @@ from typing import Generic, TypeVar
from functools import wraps
from inspect import getfullargspec, getmodule
from types import SimpleNamespace
from typing import TypeVar
from math import floor, ceil
from artiq.language import import_cache
@ -16,7 +17,8 @@ __all__ = [
"round64", "floor64", "ceil64",
"extern", "kernel", "portable", "nac3", "rpc",
"parallel", "sequential",
"set_watchdog_factory", "watchdog", "TerminationRequested"
"set_watchdog_factory", "watchdog", "TerminationRequested",
"print_rpc"
]
@ -106,6 +108,14 @@ def rpc(arg=None, flags={}):
return inner_decorator
return arg
T = TypeVar('T')
@rpc
def print_rpc(a: T):
print(a)
@nac3
class KernelContextManager:
@kernel