runkernel: improve print_int debug functions

This commit is contained in:
Sebastien Bourdeauducq 2021-11-19 12:39:57 +08:00
parent 1e47b364c5
commit 439cef636f
2 changed files with 19 additions and 2 deletions

View File

@ -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]

View File

@ -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);
}