syscall -> extern (#21)

escape-analysis
Sebastien Bourdeauducq 2021-09-27 10:13:03 +08:00
parent d4ed76d76e
commit 64404bba20
3 changed files with 11 additions and 11 deletions

View File

@ -1381,7 +1381,7 @@ impl TopLevelComposer {
{
if !decorator_list.is_empty()
&& matches!(&decorator_list[0].node,
ast::ExprKind::Name{ id, .. } if id == &"syscall".into())
ast::ExprKind::Name{ id, .. } if id == &"extern".into())
{
instance_to_symbol.insert("".into(), simple_name.to_string());
continue;

View File

@ -2,42 +2,42 @@ from language import *
from numpy import int32, int64
@syscall
@extern
def now_mu() -> int64:
raise NotImplementedError("syscall not simulated")
@syscall
@extern
def at_mu(t: int64):
raise NotImplementedError("syscall not simulated")
@syscall
@extern
def delay_mu(dt: int64):
raise NotImplementedError("syscall not simulated")
@syscall
@extern
def rtio_init():
raise NotImplementedError("syscall not simulated")
@syscall
@extern
def rtio_get_counter() -> int64:
raise NotImplementedError("syscall not simulated")
@syscall
@extern
def rtio_output(target: int32, data: int32):
raise NotImplementedError("syscall not simulated")
@syscall
@extern
def rtio_input_timestamp(timeout_mu: int64, channel: int32) -> int64:
raise NotImplementedError("syscall not simulated")
@syscall
@extern
def rtio_input_data(channel: int32) -> int32:
raise NotImplementedError("syscall not simulated")

View File

@ -4,14 +4,14 @@ from functools import wraps
import nac3embedded
__all__ = ["syscall", "kernel"]
__all__ = ["extern", "kernel"]
nac3 = nac3embedded.NAC3()
allow_object_registration = True
def syscall(function):
def extern(function):
assert allow_object_registration
nac3.register_object(function)
return function