From 4387b0be1e6f36920d680c4133fefae78de22734 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 3 Nov 2017 00:52:53 +0800 Subject: [PATCH] clean up rtio_log --- artiq/compiler/transforms/artiq_ir_generator.py | 2 +- artiq/firmware/ksupport/rtio.rs | 2 +- artiq/test/coredevice/test_analyzer.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index 0c99352f0..a1bc76956 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -1725,7 +1725,7 @@ class ARTIQIRGenerator(algorithm.Visitor): self.polymorphic_print([self.visit(prefix)], separator=" ", suffix="\x1E", as_rtio=True) self.polymorphic_print([self.visit(arg) for arg in args], - separator=" ", suffix="\n\x1D", as_rtio=True) + separator=" ", suffix="\x1D", as_rtio=True) return ir.Constant(None, builtins.TNone()) elif types.is_builtin(typ, "delay"): if len(node.args) == 1 and len(node.keywords) == 0: diff --git a/artiq/firmware/ksupport/rtio.rs b/artiq/firmware/ksupport/rtio.rs index ebc86b9f5..682a118c6 100644 --- a/artiq/firmware/ksupport/rtio.rs +++ b/artiq/firmware/ksupport/rtio.rs @@ -140,7 +140,7 @@ pub fn log(timestamp: i64, data: &[u8]) { for i in 0..data.len() { word <<= 8; word |= data[i] as u32; - if i % 4 == 0 { + if i != 0 && i % 4 == 0 { rtio_o_data_write(0, word); csr::rtio::o_we_write(1); word = 0; diff --git a/artiq/test/coredevice/test_analyzer.py b/artiq/test/coredevice/test_analyzer.py index 0f3b57495..0098e78dd 100644 --- a/artiq/test/coredevice/test_analyzer.py +++ b/artiq/test/coredevice/test_analyzer.py @@ -74,4 +74,4 @@ class AnalyzerTest(ExperimentCase): log = "".join([_extract_log_chars(msg.data) for msg in dump.messages if isinstance(msg, OutputMessage) and msg.channel == dump.log_channel]) - self.assertEqual(log, "foo\x1E32\n\x1D") + self.assertEqual(log, "foo\x1E32\x1D")