mirror of https://github.com/m-labs/artiq.git
clean up rtio_log
This commit is contained in:
parent
5a972907f3
commit
4387b0be1e
|
@ -1725,7 +1725,7 @@ class ARTIQIRGenerator(algorithm.Visitor):
|
||||||
self.polymorphic_print([self.visit(prefix)],
|
self.polymorphic_print([self.visit(prefix)],
|
||||||
separator=" ", suffix="\x1E", as_rtio=True)
|
separator=" ", suffix="\x1E", as_rtio=True)
|
||||||
self.polymorphic_print([self.visit(arg) for arg in args],
|
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())
|
return ir.Constant(None, builtins.TNone())
|
||||||
elif types.is_builtin(typ, "delay"):
|
elif types.is_builtin(typ, "delay"):
|
||||||
if len(node.args) == 1 and len(node.keywords) == 0:
|
if len(node.args) == 1 and len(node.keywords) == 0:
|
||||||
|
|
|
@ -140,7 +140,7 @@ pub fn log(timestamp: i64, data: &[u8]) {
|
||||||
for i in 0..data.len() {
|
for i in 0..data.len() {
|
||||||
word <<= 8;
|
word <<= 8;
|
||||||
word |= data[i] as u32;
|
word |= data[i] as u32;
|
||||||
if i % 4 == 0 {
|
if i != 0 && i % 4 == 0 {
|
||||||
rtio_o_data_write(0, word);
|
rtio_o_data_write(0, word);
|
||||||
csr::rtio::o_we_write(1);
|
csr::rtio::o_we_write(1);
|
||||||
word = 0;
|
word = 0;
|
||||||
|
|
|
@ -74,4 +74,4 @@ class AnalyzerTest(ExperimentCase):
|
||||||
log = "".join([_extract_log_chars(msg.data)
|
log = "".join([_extract_log_chars(msg.data)
|
||||||
for msg in dump.messages
|
for msg in dump.messages
|
||||||
if isinstance(msg, OutputMessage) and msg.channel == dump.log_channel])
|
if isinstance(msg, OutputMessage) and msg.channel == dump.log_channel])
|
||||||
self.assertEqual(log, "foo\x1E32\n\x1D")
|
self.assertEqual(log, "foo\x1E32\x1D")
|
||||||
|
|
Loading…
Reference in New Issue