put benchmarks in separate folder

This commit is contained in:
Sebastien Bourdeauducq 2015-02-17 16:14:18 -07:00
parent 170a626c76
commit 4c015d383d
3 changed files with 21 additions and 15 deletions

16
benchmarks/all.py Normal file
View File

@ -0,0 +1,16 @@
from artiq import *
import pulse_rate, rtio_skew
_units = [pulse_rate.PulseRate, rtio_skew.RTIOSkew]
class AllBenchmarks(AutoDB):
def build(self):
self.se = []
for unit in _units:
self.se.append(unit(self.dbh))
def run(self):
for se in self.se:
se.run()

View File

@ -2,13 +2,10 @@ from artiq import *
from artiq.coredevice.runtime_exceptions import RTIOUnderflow from artiq.coredevice.runtime_exceptions import RTIOUnderflow
def print_min_period(p): class PulseRate(AutoDB):
print("Minimum square wave output period: {} ns".format(p))
class PulsePerformance(AutoDB):
class DBKeys: class DBKeys:
ttl0 = Device() ttl0 = Device()
pulse_rate = Result()
@kernel @kernel
def run(self): def run(self):
@ -22,6 +19,5 @@ class PulsePerformance(AutoDB):
T += 1 T += 1
self.core.recover_underflow() self.core.recover_underflow()
else: else:
print_min_period(int(cycles_to_time(2*T)/(1*ns))) self.pulse_rate = cycles_to_time(2*T)
break break

View File

@ -9,13 +9,7 @@ class RTIOSkew(AutoDB):
class DBKeys: class DBKeys:
pmt0 = Device() pmt0 = Device()
ttl0 = Device() ttl0 = Device()
io_skew = Result() rtio_skew = Result()
@staticmethod
def realtime_results():
return {
"io_skew": "raw"
}
@kernel @kernel
def run(self): def run(self):
@ -28,4 +22,4 @@ class RTIOSkew(AutoDB):
in_t = self.pmt0.timestamp() in_t = self.pmt0.timestamp()
if in_t < 0*s: if in_t < 0*s:
raise PulseNotReceived raise PulseNotReceived
self.io_skew = out_t - in_t self.rtio_skew = out_t - in_t