forked from M-Labs/artiq
1
0
Fork 0

clean up rtio_log

This commit is contained in:
Sebastien Bourdeauducq 2017-11-03 00:52:53 +08:00
parent 5a972907f3
commit 4387b0be1e
3 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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")