artiq/artiq/coredevice/comm_dummy.py

43 lines
1.1 KiB
Python
Raw Normal View History

from operator import itemgetter
from artiq.language.db import AutoDB
2015-04-19 11:41:20 +08:00
from artiq.language.units import ms
2014-10-19 23:51:49 +08:00
from artiq.coredevice.runtime import LinkInterface
2014-09-05 12:03:22 +08:00
class _RuntimeEnvironment(LinkInterface):
2015-04-19 11:40:49 +08:00
def __init__(self):
self.warmup_time = 1*ms
2014-09-05 12:03:22 +08:00
def emit_object(self):
return str(self.llvm_module)
class Comm(AutoDB):
2014-09-05 12:03:22 +08:00
def get_runtime_env(self):
2015-04-19 11:40:49 +08:00
return _RuntimeEnvironment()
def switch_clock(self, external):
pass
2014-09-05 12:03:22 +08:00
def load(self, kcode):
2014-09-05 12:03:22 +08:00
print("================")
print(" LLVM IR")
print("================")
print(kcode)
def run(self, kname):
print("RUN: "+kname)
2014-09-21 23:36:10 +08:00
def serve(self, rpc_map, exception_map):
2014-09-05 12:03:22 +08:00
print("================")
print(" RPC map")
print("================")
for k, v in sorted(rpc_map.items(), key=itemgetter(0)):
print(str(k)+" -> "+str(v))
2014-09-21 23:36:10 +08:00
print("================")
print(" Exception map")
print("================")
for k, v in sorted(exception_map.items(), key=itemgetter(0)):
print(str(k)+" -> "+str(v))