mirror of https://github.com/m-labs/artiq.git
comm_analyzer: make header error flag more general
This commit is contained in:
parent
553a49e194
commit
2a2f5c4d58
|
@ -92,16 +92,16 @@ DecodedDump = namedtuple(
|
||||||
def decode_dump(data):
|
def decode_dump(data):
|
||||||
parts = struct.unpack(">IQbbb", data[:15])
|
parts = struct.unpack(">IQbbb", data[:15])
|
||||||
(sent_bytes, total_byte_count,
|
(sent_bytes, total_byte_count,
|
||||||
overflow_occured, log_channel, dds_onehot_sel) = parts
|
error_occured, log_channel, dds_onehot_sel) = parts
|
||||||
|
|
||||||
expected_len = sent_bytes + 15
|
expected_len = sent_bytes + 15
|
||||||
if expected_len != len(data):
|
if expected_len != len(data):
|
||||||
raise ValueError("analyzer dump has incorrect length "
|
raise ValueError("analyzer dump has incorrect length "
|
||||||
"(got {}, expected {})".format(
|
"(got {}, expected {})".format(
|
||||||
len(data), expected_len))
|
len(data), expected_len))
|
||||||
if overflow_occured:
|
if error_occured:
|
||||||
logger.warning("analyzer FIFO overflow occured, "
|
logger.warning("error occured within the analyzer, "
|
||||||
"some messages have been lost")
|
"data may be corrupted")
|
||||||
if total_byte_count > sent_bytes:
|
if total_byte_count > sent_bytes:
|
||||||
logger.info("analyzer ring buffer has wrapped %d times",
|
logger.info("analyzer ring buffer has wrapped %d times",
|
||||||
total_byte_count//sent_bytes)
|
total_byte_count//sent_bytes)
|
||||||
|
|
Loading…
Reference in New Issue