From 439cef636f704c81106377b0b51a4ba2b6255c27 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 19 Nov 2021 12:39:57 +0800 Subject: [PATCH] runkernel: improve print_int debug functions --- nac3artiq/demo/min_artiq.py | 12 ++++++++++++ runkernel/src/main.rs | 9 +++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/nac3artiq/demo/min_artiq.py b/nac3artiq/demo/min_artiq.py index 88cb9815..2fbd0765 100644 --- a/nac3artiq/demo/min_artiq.py +++ b/nac3artiq/demo/min_artiq.py @@ -8,6 +8,7 @@ import nac3artiq __all__ = ["KernelInvariant", "extern", "kernel", "portable", "nac3", "ms", "us", "ns", + "print_int32", "print_int64", "Core", "TTLOut", "parallel", "sequential"] @@ -100,6 +101,17 @@ def rtio_input_data(channel: int32) -> int32: raise NotImplementedError("syscall not simulated") +# These is not part of ARTIQ and only available in runkernel. Defined here for convenience. +@extern +def print_int32(x: int32): + raise NotImplementedError("syscall not simulated") + + +@extern +def print_int64(x: int64): + raise NotImplementedError("syscall not simulated") + + @nac3 class Core: ref_period: KernelInvariant[float] diff --git a/runkernel/src/main.rs b/runkernel/src/main.rs index e639276e..5ce64d9c 100644 --- a/runkernel/src/main.rs +++ b/runkernel/src/main.rs @@ -34,8 +34,13 @@ pub extern "C" fn rtio_output(target: i32, data: i32) { } #[no_mangle] -pub extern "C" fn print_int(x: i32) { - println!("print_int: {}", x); +pub extern "C" fn print_int32(x: i32) { + println!("print_int32: {}", x); +} + +#[no_mangle] +pub extern "C" fn print_int64(x: i64) { + println!("print_int64: {}", x); }