From e13d424398678b73bbd26b8dfb4a44050f5db9d0 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 15 Mar 2016 18:33:36 +0800 Subject: [PATCH] analyzer: strip final StoppedMessage for VCD output --- artiq/coredevice/analyzer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/analyzer.py b/artiq/coredevice/analyzer.py index b3db2637f..f32d2cb60 100644 --- a/artiq/coredevice/analyzer.py +++ b/artiq/coredevice/analyzer.py @@ -377,13 +377,19 @@ def decoded_dump_to_vcd(fileobj, devices, dump): logger.warning("unable to determine DDS sysclk") dds_sysclk = 3e9 # guess - messages = sorted(dump.messages, key=get_message_time) + if isinstance(dump.messages[-1], StoppedMessage): + messages = dump.messages[:-1] + else: + logger.warning("StoppedMessage missing") + messages = dump.messages + messages = sorted(messages, key=get_message_time) channel_handlers = create_channel_handlers( vcd_manager, devices, ref_period, dds_sysclk, dump.dds_onehot_sel) vcd_log_channels = get_vcd_log_channels(dump.log_channel, messages) - channel_handlers[dump.log_channel] = LogHandler(vcd_manager, vcd_log_channels) + channel_handlers[dump.log_channel] = LogHandler( + vcd_manager, vcd_log_channels) slack = vcd_manager.get_channel("rtio_slack", 64) vcd_manager.set_time(0)