artiq/artiq/devices/corecom_dummy.py

31 lines
755 B
Python
Raw Normal View History

from operator import itemgetter
from artiq.devices.runtime import LinkInterface
from artiq.language.units import ns
2014-09-05 12:03:22 +08:00
class _RuntimeEnvironment(LinkInterface):
2014-09-05 12:03:22 +08:00
def __init__(self, ref_period):
self.ref_period = ref_period
def emit_object(self):
return str(self.module)
class CoreCom:
2014-09-05 12:03:22 +08:00
def get_runtime_env(self):
return _RuntimeEnvironment(10*ns)
def run(self, kcode):
print("================")
print(" LLVM IR")
print("================")
print(kcode)
def serve(self, rpc_map):
print("================")
print(" RPC map")
print("================")
for k, v in sorted(rpc_map.items(), key=itemgetter(0)):
print(str(k)+" -> "+str(v))