From 906c1e0c71c8ad58934990ebe686adf7496e0dce Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 8 Jul 2020 13:45:39 +0200 Subject: Add harness.energytrace_sync="led" for LA / Timing based sync --- bin/generate-dfa-benchmark.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bin') diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index 1410c28..fdfac35 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -636,8 +636,10 @@ if __name__ == "__main__": elif "energytrace" in opt: # Use barcode sync by default gpio_mode = "bar" + energytrace_sync = None if "sync" in opt["energytrace"] and opt["energytrace"]["sync"] != "bar": gpio_mode = "around" + energytrace_sync = "led" harness = OnboardTimerHarness( gpio_pin=timer_pin, gpio_mode=gpio_mode, @@ -645,6 +647,7 @@ if __name__ == "__main__": counter_limits=runner.get_counter_limits_us(opt["arch"]), log_return_values=need_return_values, repeat=1, + energytrace_sync=energytrace_sync, ) elif "timing" in opt: harness = OnboardTimerHarness( -- cgit v1.2.3 From 0a7917342cf27f18f553afdf4a65d6377f671aad Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 14 Jul 2020 16:49:27 +0200 Subject: support more than one logfile per measurement run --- bin/generate-dfa-benchmark.py | 4 ++-- lib/loader.py | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index fdfac35..6540702 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -393,7 +393,7 @@ def run_benchmark( os.remove(filename) harness.undo(i) else: - files.extend(monitor.get_files()) + files.append(monitor.get_files()) i += 1 harness.restart() @@ -680,7 +680,7 @@ if __name__ == "__main__": "files": list(map(lambda x: x[3], results)), "configs": list(map(lambda x: x[2].get_config(), results)), } - extra_files = flatten(json_out["files"]) + extra_files = flatten(map(flatten, json_out["files"])) if "instance" in pta.codegen: output_prefix = ( opt["data"] + time.strftime("/%Y%m%d-%H%M%S-") + pta.codegen["instance"] diff --git a/lib/loader.py b/lib/loader.py index 65d497b..4934316 100644 --- a/lib/loader.py +++ b/lib/loader.py @@ -974,14 +974,16 @@ class RawData: "state_duration": ptalog["opt"]["sleep"], } ) - for repeat_id, etlog_file in enumerate(ptalog["files"][j]): - member = tf.getmember(etlog_file) + for repeat_id, etlog_files in enumerate(ptalog["files"][j]): + members = list(map(tf.getmember, etlog_files)) offline_data.append( { - "content": tf.extractfile(member).read(), + "content": list( + map(lambda f: tf.extractfile(f).read(), members) + ), "sync_mode": sync_mode, "fileno": j, - "info": member, + "info": members[0], "setup": self.setup_by_fileno[j], "repeat_id": repeat_id, "expected_trace": ptalog["traces"][j], @@ -1238,7 +1240,7 @@ class EnergyTraceWithBarcode: ) return list() - lines = log_data.decode("ascii").split("\n") + lines = log_data[0].decode("ascii").split("\n") data_count = sum(map(lambda x: len(x) > 0 and x[0] != "#", lines)) data_lines = filter(lambda x: len(x) > 0 and x[0] != "#", lines) -- cgit v1.2.3 From 2389623346d6b81477b8775635a0627baa90e31f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 14 Jul 2020 16:59:14 +0200 Subject: Add --no-cache option --- bin/analyze-archive.py | 9 +++++++-- lib/loader.py | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 5c7c97e..10fe304 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -104,6 +104,9 @@ Options: --export-energymodel= Export energy model. Works out of the box for v1 and v2 logfiles. Requires --hwmodel for v0 logfiles. + +--no-cache + Do not load cached measurement results """ import getopt @@ -304,7 +307,7 @@ if __name__ == "__main__": try: optspec = ( - "info " + "info no-cache " "plot-unparam= plot-param= plot-traces= show-models= show-quality= " "ignored-trace-indexes= discard-outliers= function-override= " "export-traces= " @@ -369,7 +372,9 @@ if __name__ == "__main__": sys.exit(2) raw_data = RawData( - args, with_traces=("export-traces" in opt or "plot-traces" in opt) + args, + with_traces=("export-traces" in opt or "plot-traces" in opt), + skip_cache=("no-cache" in opt), ) if "info" in opt: diff --git a/lib/loader.py b/lib/loader.py index 4934316..438bbdb 100644 --- a/lib/loader.py +++ b/lib/loader.py @@ -249,7 +249,7 @@ class RawData: file system, making subsequent loads near-instant. """ - def __init__(self, filenames, with_traces=False): + def __init__(self, filenames, with_traces=False, skip_cache=False): """ Create a new RawData object. @@ -328,7 +328,7 @@ class RawData: self.pta = self.ptalog["pta"] self.set_cache_file() - if not with_traces: + if not with_traces and not skip_cache: self.load_cache() def set_cache_file(self): -- cgit v1.2.3 From c3958b67834268792235faef7cfca86f1d8e8195 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 7 Oct 2020 15:26:10 +0200 Subject: analyze-archive: move trace plotting to a helper function --- bin/analyze-archive.py | 52 ++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'bin') diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 66772e6..ca36745 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -223,6 +223,32 @@ def print_html_model_data(model, pm, pq, lm, lq, am, ai, aq): print("") print("") +def plot_traces(preprocessed_data, sot_name): + traces = list() + for trace in preprocessed_data: + for state_or_transition in trace["trace"]: + if state_or_transition["name"] == sot_name: + traces.extend( + map(lambda x: x["uW"], state_or_transition["offline"]) + ) + if len(traces) == 0: + print( + f"""Did not find traces for state or transition {sot_name}. Abort.""", + file=sys.stderr, + ) + sys.exit(2) + + if len(traces) > 40: + print(f"""Truncating plot to 40 of {len(traces)} traces (random sample)""") + traces = random.sample(traces, 40) + + plotter.plot_y( + traces, + xlabel="t [1e-5 s]", + ylabel="P [uW]", + title=sot_name, + family=True, + ) if __name__ == "__main__": @@ -446,31 +472,7 @@ if __name__ == "__main__": json.dump(data, f) if args.plot_traces: - traces = list() - for trace in preprocessed_data: - for state_or_transition in trace["trace"]: - if state_or_transition["name"] == args.plot_traces: - traces.extend( - map(lambda x: x["uW"], state_or_transition["offline"]) - ) - if len(traces) == 0: - print( - f"""Did not find traces for state or transition {args.plot_traces}. Abort.""", - file=sys.stderr, - ) - sys.exit(2) - - if len(traces) > 40: - print(f"""Truncating plot to 40 of {len(traces)} traces (random sample)""") - traces = random.sample(traces, 40) - - plotter.plot_y( - traces, - xlabel="t [1e-5 s]", - ylabel="P [uW]", - title=args.plot_traces, - family=True, - ) + plot_traces(preprocessed_data, args.plot_traces) if raw_data.preprocessing_stats["num_valid"] == 0: print("No valid data available. Abort.", file=sys.stderr) -- cgit v1.2.3 From 47e6378ad2b5862905a04b8f986404918a3c2a00 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 20 Oct 2020 14:55:35 +0200 Subject: analyze-archive: note that --plot-traces has a wrong X-axis on !MIMOSA --- bin/analyze-archive.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index ca36745..bd1c824 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -223,14 +223,13 @@ def print_html_model_data(model, pm, pq, lm, lq, am, ai, aq): print("") print("") + def plot_traces(preprocessed_data, sot_name): traces = list() for trace in preprocessed_data: for state_or_transition in trace["trace"]: if state_or_transition["name"] == sot_name: - traces.extend( - map(lambda x: x["uW"], state_or_transition["offline"]) - ) + traces.extend(map(lambda x: x["uW"], state_or_transition["offline"])) if len(traces) == 0: print( f"""Did not find traces for state or transition {sot_name}. Abort.""", @@ -250,6 +249,7 @@ def plot_traces(preprocessed_data, sot_name): family=True, ) + if __name__ == "__main__": ignored_trace_indexes = [] @@ -295,7 +295,7 @@ if __name__ == "__main__": "--plot-traces", metavar="NAME", type=str, - help="Plot power trace for state or transition NAME", + help="Plot power trace for state or transition NAME. X axis is wrong for non-MIMOSA measurements", ) parser.add_argument( "--show-models", -- cgit v1.2.3 From 993a3bae7f5c560d8c9c601c9a6b423e9f507785 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 21 Oct 2020 12:35:59 +0200 Subject: --plot-traces: use the correct time base for each backend --- bin/analyze-archive.py | 21 +++++++++++++++------ lib/lennart/DataProcessor.py | 15 +++++++++------ lib/loader.py | 32 ++++++++++++++++++++++---------- lib/plotter.py | 6 +++++- 4 files changed, 51 insertions(+), 23 deletions(-) (limited to 'bin') diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index bd1c824..5d4411b 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -226,10 +226,16 @@ def print_html_model_data(model, pm, pq, lm, lq, am, ai, aq): def plot_traces(preprocessed_data, sot_name): traces = list() + timestamps = list() for trace in preprocessed_data: for state_or_transition in trace["trace"]: if state_or_transition["name"] == sot_name: - traces.extend(map(lambda x: x["uW"], state_or_transition["offline"])) + timestamps.extend( + map(lambda x: x["plot"][0], state_or_transition["offline"]) + ) + traces.extend( + map(lambda x: x["plot"][1], state_or_transition["offline"]) + ) if len(traces) == 0: print( f"""Did not find traces for state or transition {sot_name}. Abort.""", @@ -239,12 +245,15 @@ def plot_traces(preprocessed_data, sot_name): if len(traces) > 40: print(f"""Truncating plot to 40 of {len(traces)} traces (random sample)""") - traces = random.sample(traces, 40) + indexes = random.sample(range(len(traces)), 40) + timestamps = [timestamps[i] for i in indexes] + traces = [traces[i] for i in indexes] - plotter.plot_y( + plotter.plot_xy( + timestamps, traces, - xlabel="t [1e-5 s]", - ylabel="P [uW]", + xlabel="t [s]", + ylabel="P [W]", title=sot_name, family=True, ) @@ -463,7 +472,7 @@ if __name__ == "__main__": if name not in uw_per_sot: uw_per_sot[name] = list() for elem in state_or_transition["offline"]: - elem["uW"] = list(elem["uW"]) + elem["plot"] = list(elem["plot"]) uw_per_sot[name].append(state_or_transition) for name, data in uw_per_sot.items(): target = f"{args.export_traces}/{name}.json" diff --git a/lib/lennart/DataProcessor.py b/lib/lennart/DataProcessor.py index 8373e75..7546128 100644 --- a/lib/lennart/DataProcessor.py +++ b/lib/lennart/DataProcessor.py @@ -256,7 +256,8 @@ class DataProcessor: :return: power measurements in W """ first_index = 0 - all_power = [] + all_power = list() + all_ts = list() for ind in range(self.start_offset, len(self.plot_data_x)): first_index = ind if self.plot_data_x[ind] > start: @@ -272,6 +273,7 @@ class DataProcessor: self.start_offset = ind - 1 break all_power.append(self.plot_data_y[ind]) + all_ts.append(self.plot_data_x[ind]) # TODO Idea remove datapoints that are too far away def removeSD_Mean_Values(arr): @@ -293,10 +295,11 @@ class DataProcessor: if len(all_power) == 0: # print("PROBLEM") all_power.append(self.plot_data_y[nextIndAfterIndex]) + all_ts.append(0) elif len(all_power) == 1: # print("OKAY") pass - return np.array(all_power) + return np.array(all_power), np.array(all_ts) def getStatesdfatool(self, state_sleep, with_traces=False, algorithm=False): """ @@ -324,7 +327,7 @@ class DataProcessor: start_transition_ts_timing = self.reduced_timestamps[ts_index * 2] if end_transition_ts is not None: - power = self.getPowerBetween( + power, timestamps = self.getPowerBetween( end_transition_ts, start_transition_ts, state_sleep ) @@ -348,7 +351,7 @@ class DataProcessor: ), # * 10 ** 6, } if with_traces: - state["uW"] = power * 1e6 + state["plot"] = (timestamps - timestamps[0], power) energy_trace_new.append(state) energy_trace_new[-2]["W_mean_delta_next"] = ( @@ -357,7 +360,7 @@ class DataProcessor: # get energy end_transition_ts end_transition_ts = self.modified_timestamps[ts_index * 2 + 1] - power = self.getPowerBetween( + power, timestamps = self.getPowerBetween( start_transition_ts, end_transition_ts, state_sleep ) @@ -374,7 +377,7 @@ class DataProcessor: "count_dp": len(power), } if with_traces: - transition["uW"] = power * 1e6 + transition["plot"] = (timestamps - timestamps[0], power) if (end_transition_ts - start_transition_ts) * 10 ** 6 > 2_000_000: # TODO Last data set corrupted? HOT FIX!!!!!!!!!!!! REMOVE LATER diff --git a/lib/loader.py b/lib/loader.py index 94a76b3..c981ef7 100644 --- a/lib/loader.py +++ b/lib/loader.py @@ -1431,7 +1431,13 @@ class EnergyTraceWithBarcode: } if self.with_traces: - transition["uW"] = transition_power_W * 1e6 + timestamps = ( + self.interval_start_timestamp[ + transition_start_index:transition_done_index + ] + - self.interval_start_timestamp[transition_start_index] + ) + transition["plot"] = (timestamps, transition_power_W) energy_trace.append(transition) @@ -1451,7 +1457,11 @@ class EnergyTraceWithBarcode: } if self.with_traces: - state["uW"] = state_power_W * 1e6 + timestamps = ( + self.interval_start_timestamp[state_start_index:state_done_index] + - self.interval_start_timestamp[state_start_index] + ) + state["plot"] = (timestamps, state_power_W) energy_trace.append(state) @@ -1690,15 +1700,14 @@ class EnergyTraceWithLogicAnalyzer: dp = DataProcessor(sync_data=self.sync_data, energy_data=self.energy_data) dp.run() - energy_trace_new = list() - energy_trace_new.extend( - dp.getStatesdfatool( - state_sleep=self.state_duration, with_traces=self.with_traces - ) + energy_trace_new = dp.getStatesdfatool( + state_sleep=self.state_duration, with_traces=self.with_traces ) # Uncomment to plot traces - # dp.plot() # <- plot traces with sync annotatons - # dp.plot(names) # <- plot annotated traces (with state/transition names) + if offline_index == 0: + # dp.plot() # <- plot traces with sync annotatons + # dp.plot(names) # <- plot annotated traces (with state/transition names) + pass energy_trace_new = energy_trace_new[4:] energy_trace = list() @@ -2091,7 +2100,10 @@ class MIMOSA: } if self.with_traces: - data["uW"] = range_ua * self.voltage + data["plot"] = ( + np.arange(len(range_ua)) * 1e-5, + range_ua * self.voltage * 1e-6, + ) if isa == "transition": # subtract average power of previous state diff --git a/lib/plotter.py b/lib/plotter.py index 16c0145..929ceb9 100755 --- a/lib/plotter.py +++ b/lib/plotter.py @@ -136,7 +136,11 @@ def plot_xy(X, Y, xlabel=None, ylabel=None, title=None, output=None, family=Fals if family: cm = plt.get_cmap("brg", len(Y)) for i, YY in enumerate(Y): - plt.plot(np.arange(len(YY)), YY, "-", markersize=2, color=cm(i)) + if X: + XX = X[i] + else: + XX = np.arange(len(YY)) + plt.plot(XX, YY, "-", markersize=2, color=cm(i)) else: plt.plot(X, Y, "bo", markersize=2) if output: -- cgit v1.2.3 From b7e25c6ca7746e86ef201b9be7ecec57bf5b2d2a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 22 Oct 2020 15:05:09 +0200 Subject: Improve sync=la timing restoration. There's still something fishy though... --- bin/generate-dfa-benchmark.py | 1 + lib/harness.py | 23 ++++++++++++++-------- lib/lennart/DataProcessor.py | 5 +++-- lib/lennart/SigrokInterface.py | 43 +----------------------------------------- lib/loader.py | 24 ++++++++++++++++++++++- 5 files changed, 43 insertions(+), 53 deletions(-) (limited to 'bin') diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index c8681c5..98c3602 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -647,6 +647,7 @@ if __name__ == "__main__": log_return_values=need_return_values, repeat=1, energytrace_sync=energytrace_sync, + remove_nop_from_timings=False, # kein einfluss auf ungenauigkeiten ) elif "timing" in opt: harness = OnboardTimerHarness( diff --git a/lib/harness.py b/lib/harness.py index 51013e1..04b14eb 100644 --- a/lib/harness.py +++ b/lib/harness.py @@ -355,10 +355,14 @@ class OnboardTimerHarness(TransitionHarness): the dict `offline_aggregates` with the member `duration`. It contains a list of durations (in us) of the corresponding state/transition for each benchmark iteration. I.e. `.traces[*]['trace'][*]['offline_aggregates']['duration'] = [..., ...]` + :param remove_nop_from_timings: If true, remove the nop duration from reported timings + (i.e., reported timings reflect the estimated transition/state duration with the timer call overhea dremoved). + If false, do not remove nop durations, so the timings more accurately reflect the elapsed wall-clock time during the benchmark. """ - def __init__(self, counter_limits, **kwargs): + def __init__(self, counter_limits, remove_nop_from_timings=True, **kwargs): super().__init__(**kwargs) + self.remove_nop_from_timings = remove_nop_from_timings self.trace_length = 0 ( self.one_cycle_in_us, @@ -422,7 +426,6 @@ class OnboardTimerHarness(TransitionHarness): gpio.led_toggle(1); ptalog.stopTransition(); // ======================= LED SYNC ================================ - arch.sleep_ms(250); }\n\n""" return ret @@ -431,14 +434,17 @@ class OnboardTimerHarness(TransitionHarness): if self.energytrace_sync == "led": ret += "runLASync();\n" ret += "ptalog.passNop();\n" + if self.energytrace_sync == "led": + ret += "arch.sleep_ms(250);\n" ret += super().start_benchmark(benchmark_id) return ret def stop_benchmark(self): ret = "" + ret += super().stop_benchmark() if self.energytrace_sync == "led": ret += "runLASync();\n" - ret += super().stop_benchmark() + ret += "arch.sleep_ms(250);\n" return ret def pass_transition( @@ -498,8 +504,9 @@ class OnboardTimerHarness(TransitionHarness): prev_state_duration_us = ( prev_state_cycles * self.one_cycle_in_us + prev_state_overflow * self.one_overflow_in_us - - self.nop_cycles * self.one_cycle_in_us ) + if self.remove_nop_from_timings: + prev_state_duration_us -= self.nop_cycles * self.one_cycle_in_us final_state = self.traces[self.trace_id]["trace"][-1] if "offline_aggregates" not in final_state: final_state["offline_aggregates"] = {"duration": list()} @@ -561,15 +568,15 @@ class OnboardTimerHarness(TransitionHarness): ) ) duration_us = ( - cycles * self.one_cycle_in_us - + overflow * self.one_overflow_in_us - - self.nop_cycles * self.one_cycle_in_us + cycles * self.one_cycle_in_us + overflow * self.one_overflow_in_us ) prev_state_duration_us = ( prev_state_cycles * self.one_cycle_in_us + prev_state_overflow * self.one_overflow_in_us - - self.nop_cycles * self.one_cycle_in_us ) + if self.remove_nop_from_timings: + duration_us -= self.nop_cycles * self.one_cycle_in_us + prev_state_duration_us -= self.nop_cycles * self.one_cycle_in_us if duration_us < 0: duration_us = 0 # self.traces contains transitions and states, UART output only contains transitions -> use index * 2 diff --git a/lib/lennart/DataProcessor.py b/lib/lennart/DataProcessor.py index 8d762e7..90cc54d 100644 --- a/lib/lennart/DataProcessor.py +++ b/lib/lennart/DataProcessor.py @@ -228,9 +228,10 @@ class DataProcessor: def getDataText(x): # print(x) + dl = len(annotateData) for i, xt in enumerate(self.modified_timestamps): - if xt > x: - return "Value: %s" % annotateData[i - 5] + if xt > x and i >= 4 and i - 5 < dl: + return f"SoT: {annotateData[i - 5]}" def update_annot(x, y, name): annot.xy = (x, y) diff --git a/lib/lennart/SigrokInterface.py b/lib/lennart/SigrokInterface.py index 1733b68..32e8fe2 100644 --- a/lib/lennart/SigrokInterface.py +++ b/lib/lennart/SigrokInterface.py @@ -1,4 +1,5 @@ import json +import numpy as np from dfatool.lennart.DataInterface import DataInterface import logging @@ -62,48 +63,6 @@ class SigrokResult: return SigrokResult(data["timestamps"], data["onBeforeFirstChange"]) pass - @classmethod - def fromTraces(cls, traces): - """ - Generates SigrokResult from ptalog.json traces - - :param traces: traces from dfatool ptalog.json - :return: SigrokResult object - """ - timestamps = [0] - for tr in traces: - for t in tr["trace"]: - # print(t['online_aggregates']['duration'][0]) - timestamps.append( - timestamps[-1] + (t["online_aggregates"]["duration"][0] * 10 ** -6) - ) - - # print(timestamps) - # prepend FAKE Sync point - t_neu = [0.0, 0.0000001, 1.0, 1.00000001] - for i, x in enumerate(timestamps): - t_neu.append( - round(float(x) + t_neu[3] + 0.20, 6) - ) # list(map(float, t_ist.split(",")[:i+1])) - - # append FAKE Sync point / eine überschneidung - # [30.403632, 30.403639, 31.407265, 31.407271] - # appendData = [29.144855,30.148495,30.148502,30.403632,30.403639,31.407265,31.407271,] - appendData = [0, 1.000001, 1.000002, 1.25, 1.2500001] - - # TODO future work here, why does the sync not work completely - t_neu[-1] = ( - t_neu[-2] + (t_neu[-1] - t_neu[-2]) * 0.9 - ) # Weird offset failure with UART stuff - - offset = t_neu[-1] - appendData[0] - for x in appendData: - t_neu.append(x + offset) - - # print(t_neu) - print(len(t_neu)) - return SigrokResult(t_neu, False) - class SigrokInterface(DataInterface): def __init__(self, sample_rate, driver="fx2lafw", filename="temp/sigrok.log"): diff --git a/lib/loader.py b/lib/loader.py index 3f6b5ec..2f8e603 100644 --- a/lib/loader.py +++ b/lib/loader.py @@ -1780,9 +1780,31 @@ class EnergyTraceWithTimer(EnergyTraceWithLogicAnalyzer): pass def analyze_states(self, traces, offline_index: int): + + # Start "Synchronization pulse" + timestamps = [0, 10, 1e6, 1e6 + 10] + + # 250ms zwischen Ende der LASync und Beginn der Messungen + # (wegen sleep(250) in der generierten multipass-runLASync-Funktion) + timestamps.append(timestamps[-1] + 240e3) + for tr in traces: + for t in tr["trace"]: + # print(t['online_aggregates']['duration'][0]) + timestamps.append( + timestamps[-1] + t["online_aggregates"]["duration"][offline_index] + ) + + print(timestamps) + + # Stop "Synchronization pulses". The first one has already started. + timestamps.extend(np.array([10, 1e6, 1e6 + 10]) + timestamps[-1]) + timestamps.extend(np.array([0, 10, 1e6, 1e6 + 10]) + 250e3 + timestamps[-1]) + + timestamps = list(np.array(timestamps) * 1e-6) + from dfatool.lennart.SigrokInterface import SigrokResult - self.sync_data = SigrokResult.fromTraces(traces) + self.sync_data = SigrokResult(timestamps, False) return super().analyze_states(traces, offline_index) -- cgit v1.2.3