forked from M-Labs/artiq
put benchmarks in separate folder
This commit is contained in:
parent
170a626c76
commit
4c015d383d
|
@ -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()
|
|
@ -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
|
||||
|
|
@ -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
|
Loading…
Reference in New Issue