Instrumentation: Update to store sample rate in MeasurementCSV file.
This commit updates existing instruments to store their sample rates
when creating the respective MeasurementCsv files.
diff --git a/devlib/instrument/acmecape.py b/devlib/instrument/acmecape.py
index 103a9f8..e1bb6c1 100644
--- a/devlib/instrument/acmecape.py
+++ b/devlib/instrument/acmecape.py
@@ -120,4 +120,4 @@
# Convert rest into standard units.
output_row.append(float(row[i])/1000)
writer.writerow(output_row)
- return MeasurementsCsv(outfile, self.active_channels)
+ return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)
diff --git a/devlib/instrument/daq.py b/devlib/instrument/daq.py
index 58d2f3e..75e854d 100644
--- a/devlib/instrument/daq.py
+++ b/devlib/instrument/daq.py
@@ -126,7 +126,7 @@
writer.writerow(row)
raw_row = _read_next_rows()
- return MeasurementsCsv(outfile, self.active_channels)
+ return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)
finally:
for fh in file_handles:
fh.close()
diff --git a/devlib/instrument/energy_probe.py b/devlib/instrument/energy_probe.py
index ed502f5..5f47430 100644
--- a/devlib/instrument/energy_probe.py
+++ b/devlib/instrument/energy_probe.py
@@ -113,4 +113,4 @@
continue
else:
not_a_full_row_seen = True
- return MeasurementsCsv(outfile, self.active_channels)
+ return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)
diff --git a/devlib/instrument/frames.py b/devlib/instrument/frames.py
index d43977f..d1899fb 100644
--- a/devlib/instrument/frames.py
+++ b/devlib/instrument/frames.py
@@ -44,7 +44,7 @@
self.collector.process_frames(raw_outfile)
active_sites = [chan.label for chan in self.active_channels]
self.collector.write_frames(outfile, columns=active_sites)
- return MeasurementsCsv(outfile, self.active_channels)
+ return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)
def _init_channels(self):
raise NotImplementedError()
diff --git a/devlib/instrument/gem5power.py b/devlib/instrument/gem5power.py
index 1e392a8..d265440 100644
--- a/devlib/instrument/gem5power.py
+++ b/devlib/instrument/gem5power.py
@@ -73,7 +73,7 @@
for rec, rois in self.target.gem5stats.match_iter(sites_to_match,
[self.roi_label], self._base_stats_dump):
writer.writerow([float(rec[s]) for s in active_sites])
- return MeasurementsCsv(outfile, self.active_channels)
+ return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)
def reset(self, sites=None, kinds=None, channels=None):
super(Gem5PowerInstrument, self).reset(sites, kinds, channels)
diff --git a/devlib/instrument/monsoon.py b/devlib/instrument/monsoon.py
index e373d68..3103618 100644
--- a/devlib/instrument/monsoon.py
+++ b/devlib/instrument/monsoon.py
@@ -129,4 +129,4 @@
row.append(usb)
writer.writerow(row)
- return MeasurementsCsv(outfile, self.active_channels)
+ return MeasurementsCsv(outfile, self.active_channels, self.sample_rate_hz)