From cbf915c2cc7fac768e0fadd23f22a4fec706c225 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 14 Oct 2014 19:49:39 +0800 Subject: [PATCH] devices/runtime: pretty-print --- artiq/devices/runtime.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/artiq/devices/runtime.py b/artiq/devices/runtime.py index 76e192e67..8d305def1 100644 --- a/artiq/devices/runtime.py +++ b/artiq/devices/runtime.py @@ -5,6 +5,7 @@ from llvm import core as lc from llvm import target as lt from artiq.py2llvm import base_types +from artiq.language import units lt.initialize_all() @@ -138,12 +139,17 @@ def _debug_dump_obj(obj): class Environment(LinkInterface): def __init__(self, ref_period): + self.cpu_type = "or1k" self.ref_period = ref_period # allow 1ms for all initial DDS programming self.initial_time = int(Fraction(1, 1000)/self.ref_period) def emit_object(self): - tm = lt.TargetMachine.new(triple="or1k", cpu="generic") + tm = lt.TargetMachine.new(triple=self.cpu_type, cpu="generic") obj = tm.emit_object(self.llvm_module) _debug_dump_obj(obj) return obj + + def __repr__(self): + return "".format(self.cpu_type, + str(units.Hz/self.ref_period))