2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 11:18:27 +08:00

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
def print_min_period(p):
print("Minimum square wave output period: {} ns".format(p))
class PulsePerformance(AutoDB):
class PulseRate(AutoDB):
class DBKeys:
ttl0 = Device()
pulse_rate = Result()
@kernel
def run(self):
@ -22,6 +19,5 @@ class PulsePerformance(AutoDB):
T += 1
self.core.recover_underflow()
else:
print_min_period(int(cycles_to_time(2*T)/(1*ns)))
self.pulse_rate = cycles_to_time(2*T)
break

View File

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