From 0443f83d5ee31cc532bba2f1d0b4948dd81e2fd9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 23 Nov 2016 10:48:26 +0800 Subject: [PATCH] runtime: support for targets without RTIO log channel --- artiq/gateware/targets/kc705.py | 2 ++ artiq/gateware/targets/pipistrello.py | 1 + artiq/runtime.rs/libksupport/rtio.rs | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/artiq/gateware/targets/kc705.py b/artiq/gateware/targets/kc705.py index 502ca5902..75de1ae8d 100755 --- a/artiq/gateware/targets/kc705.py +++ b/artiq/gateware/targets/kc705.py @@ -225,6 +225,7 @@ class NIST_CLOCK(_NIST_Ions): ofifo_depth=512, ififo_depth=4)) + self.config["HAS_RTIO_LOG"] = None self.config["RTIO_LOG_CHANNEL"] = len(rtio_channels) rtio_channels.append(rtio.LogChannel()) @@ -303,6 +304,7 @@ class NIST_QC2(_NIST_Ions): ofifo_depth=512, ififo_depth=4)) + self.config["HAS_RTIO_LOG"] = None self.config["RTIO_LOG_CHANNEL"] = len(rtio_channels) rtio_channels.append(rtio.LogChannel()) diff --git a/artiq/gateware/targets/pipistrello.py b/artiq/gateware/targets/pipistrello.py index 42dc87dac..42b217185 100755 --- a/artiq/gateware/targets/pipistrello.py +++ b/artiq/gateware/targets/pipistrello.py @@ -212,6 +212,7 @@ trce -v 12 -fastpaths -tsi {build_name}.tsi -o {build_name}.twr {build_name}.ncd rtio_channels.append(rtio.Channel.from_phy( phy, ofifo_depth=64, ififo_depth=64)) + self.config["HAS_RTIO_LOG"] = None self.config["RTIO_LOG_CHANNEL"] = len(rtio_channels) rtio_channels.append(rtio.LogChannel()) diff --git a/artiq/runtime.rs/libksupport/rtio.rs b/artiq/runtime.rs/libksupport/rtio.rs index 107583da4..4363b255d 100644 --- a/artiq/runtime.rs/libksupport/rtio.rs +++ b/artiq/runtime.rs/libksupport/rtio.rs @@ -125,6 +125,7 @@ pub extern fn input_data(channel: u32) -> u32 { } } +#[cfg(has_rtio_log)] pub fn log(timestamp: i64, data: &[u8]) { unsafe { csr::rtio::chan_sel_write(csr::CONFIG_RTIO_LOG_CHANNEL); @@ -146,3 +147,6 @@ pub fn log(timestamp: i64, data: &[u8]) { csr::rtio::o_we_write(1); } } + +#[cfg(not(has_rtio_log))] +pub fn log(timestamp: i64, data: &[u8]) {}