From 7d8dc4ef3004087c64207e471ea9a3d7bdc2b36e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 18 Aug 2014 23:41:54 +0800 Subject: [PATCH] runtime: support 64-bit RTIO timestamps --- artiq/devices/runtime.py | 22 +++++++++++++--------- soc/runtime/main.c | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/artiq/devices/runtime.py b/artiq/devices/runtime.py index 597938931..eb043be08 100644 --- a/artiq/devices/runtime.py +++ b/artiq/devices/runtime.py @@ -8,16 +8,24 @@ lt.initialize_all() _syscalls = { "rpc": "i+:i", "gpio_set": "ii:n", - "rtio_set": "iii:n", + "rtio_set": "Iii:n", "rtio_sync": "i:n", "dds_program": "ii:n", } +_chr_to_type = { + "n": lambda: lc.Type.void(), + "i": lambda: lc.Type.int(32), + "I": lambda: lc.Type.int(64) +} + +_chr_to_value = { + "n": lambda: ir_values.VNone(), + "i": lambda: ir_values.VInt(), + "I": lambda: ir_values.VInt(64) +} + def _str_to_functype(s): - _chr_to_type = { - "n": lc.Type.void, - "i": lc.Type.int - } assert(s[-2] == ":") type_ret = _chr_to_type[s[-1]]() @@ -42,10 +50,6 @@ class LinkInterface: self.module.add_function(func_type, "__syscall_"+func_name) def syscall(self, syscall_name, args, builder): - _chr_to_value = { - "n": ir_values.VNone, - "i": ir_values.VInt - } r = _chr_to_value[_syscalls[syscall_name][-1]]() if builder is not None: args = [arg.llvm_value for arg in args] diff --git a/soc/runtime/main.c b/soc/runtime/main.c index 2714c1255..01d9a59ac 100644 --- a/soc/runtime/main.c +++ b/soc/runtime/main.c @@ -140,7 +140,7 @@ static void gpio_set(int channel, int value) leds_out_write(csr_value); } -static void rtio_set(int timestamp, int channel, int value) +static void rtio_set(long long int timestamp, int channel, int value) { rtio_chan_sel_write(channel); rtio_o_timestamp_write(timestamp);