mirror of https://github.com/m-labs/artiq.git
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
|
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
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue