Skip to content

Commit

Permalink
runtime: support for targets without RTIO log channel
Browse files Browse the repository at this point in the history
sbourdeauducq committed Nov 23, 2016
1 parent 3c5a622 commit 0c49679
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions artiq/gateware/targets/kc705.py
Original file line number Diff line number Diff line change
@@ -226,6 +226,7 @@ def __init__(self, cpu_type="or1k", **kwargs):
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())

@@ -304,6 +305,7 @@ def __init__(self, cpu_type="or1k", **kwargs):
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())

1 change: 1 addition & 0 deletions artiq/gateware/targets/pipistrello.py
Original file line number Diff line number Diff line change
@@ -212,6 +212,7 @@ def __init__(self, cpu_type="or1k", **kwargs):
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())

4 changes: 4 additions & 0 deletions artiq/runtime.rs/libksupport/rtio.rs
Original file line number Diff line number Diff line change
@@ -123,6 +123,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);
@@ -144,3 +145,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]) {}

0 comments on commit 0c49679

Please sign in to comment.