From 10d796e02672a40ce3f6609c41bed3e0834262c8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 11 Sep 2014 23:14:45 +0800 Subject: [PATCH] runtime: add rtio_replace syscall --- artiq/devices/runtime.py | 1 + soc/runtime/rtio.c | 8 ++++++++ soc/runtime/rtio.h | 1 + soc/runtime/symbols.c | 1 + 4 files changed, 11 insertions(+) diff --git a/artiq/devices/runtime.py b/artiq/devices/runtime.py index a4a55f77f..5f84fc52e 100644 --- a/artiq/devices/runtime.py +++ b/artiq/devices/runtime.py @@ -10,6 +10,7 @@ _syscalls = { "rpc": "i+:i", "gpio_set": "ii:n", "rtio_set": "Iii:n", + "rtio_replace": "Iii:n", "rtio_sync": "i:n", "dds_program": "ii:n", } diff --git a/soc/runtime/rtio.c b/soc/runtime/rtio.c index ff65b5b79..550e54e45 100644 --- a/soc/runtime/rtio.c +++ b/soc/runtime/rtio.c @@ -17,6 +17,14 @@ void rtio_set(long long int timestamp, int channel, int value) rtio_o_we_write(1); } +void rtio_replace(long long int timestamp, int channel, int value) +{ + rtio_chan_sel_write(channel); + rtio_o_timestamp_write(timestamp); + rtio_o_value_write(value); + rtio_o_replace_write(1); +} + void rtio_sync(int channel) { rtio_chan_sel_write(channel); diff --git a/soc/runtime/rtio.h b/soc/runtime/rtio.h index 2ed47058e..619ee9890 100644 --- a/soc/runtime/rtio.h +++ b/soc/runtime/rtio.h @@ -3,6 +3,7 @@ void rtio_init(void); void rtio_set(long long int timestamp, int channel, int value); +void rtio_replace(long long int timestamp, int channel, int value); void rtio_sync(int channel); #endif /* __RTIO_H */ diff --git a/soc/runtime/symbols.c b/soc/runtime/symbols.c index 5f04ce347..c2db7bcdd 100644 --- a/soc/runtime/symbols.c +++ b/soc/runtime/symbols.c @@ -11,6 +11,7 @@ static const struct symbol syscalls[] = { {"rpc", rpc}, {"gpio_set", gpio_set}, {"rtio_set", rtio_set}, + {"rtio_replace", rtio_replace}, {"rtio_sync", rtio_sync}, {"dds_program", dds_program}, {NULL, NULL}