def execute_and_test_in_log(self, experiment, string): core_addr = self.device_mgr.get_desc("core")["arguments"]["host"] mgmt = CommMgmt(core_addr) mgmt.clear_log() self.execute(experiment) log = mgmt.get_log() self.assertIn(string, log) mgmt.close()
def test_address_collision(self): core_addr = self.device_mgr.get_desc("core")["arguments"]["host"] mgmt = CommMgmt(core_addr) mgmt.clear_log() self.execute(AddressCollision) log = mgmt.get_log() self.assertIn("RTIO collision", log) mgmt.close()
def test_compile(self): core_addr = self.device_mgr.get_desc("core")["arguments"]["host"] mgmt = CommMgmt(core_addr) mgmt.clear_log() with tempfile.TemporaryDirectory() as tmp: db_path = os.path.join(artiq_root, "device_db.py") subprocess.call([sys.executable, "-m", "artiq.frontend.artiq_compile", "--device-db", db_path, "-e", "CheckLog", "-o", os.path.join(tmp, "check_log.elf"), __file__]) subprocess.call([sys.executable, "-m", "artiq.frontend.artiq_run", "--device-db", db_path, os.path.join(tmp, "check_log.elf")]) log = mgmt.get_log() self.assertIn("test_artiq_compile", log) mgmt.close()
def main(): args = get_argparser().parse_args() init_logger(args) core_addr = DeviceDB(args.device_db).get("core")["arguments"]["host"] mgmt = CommMgmt(core_addr) try: if args.action == "allocator": mgmt.debug_allocator() else: print("An action needs to be specified.", file=sys.stderr) sys.exit(1) finally: mgmt.close()
def main(): args = get_argparser().parse_args() init_logger(args) core_addr = DeviceDB(args.device_db).get("core")["arguments"]["host"] mgmt = CommMgmt(core_addr) try: if args.action == "reboot": mgmt.reboot() elif args.action == "hotswap": mgmt.hotswap(args.image.read()) else: print("An action needs to be specified.", file=sys.stderr) sys.exit(1) finally: mgmt.close()
def main(): args = get_argparser().parse_args() init_logger(args) core_addr = DeviceDB(args.device_db).get("core")["arguments"]["host"] mgmt = CommMgmt(core_addr) try: if args.action == "set_level": mgmt.set_log_level(args.level) elif args.action == "set_uart_level": mgmt.set_uart_log_level(args.level) elif args.action == "clear": mgmt.clear_log() else: print(mgmt.get_log(), end="") finally: mgmt.close()
def test_compile(self): core_addr = self.device_mgr.get_desc("core")["arguments"]["host"] mgmt = CommMgmt(core_addr) mgmt.clear_log() with tempfile.TemporaryDirectory() as tmp: db_path = os.path.join(artiq_root, "device_db.py") subprocess.call([ sys.executable, "-m", "artiq.frontend.artiq_compile", "--device-db", db_path, "-e", "CheckLog", "-o", os.path.join(tmp, "check_log.elf"), __file__ ]) subprocess.call([ sys.executable, "-m", "artiq.frontend.artiq_run", "--device-db", db_path, os.path.join(tmp, "check_log.elf") ]) log = mgmt.get_log() self.assertIn("test_artiq_compile", log) mgmt.close()
def main(): args = get_argparser().parse_args() init_logger(args) core_addr = DeviceDB(args.device_db).get("core")["arguments"]["host"] mgmt = CommMgmt(core_addr) try: if args.action == "start": mgmt.start_profiler(args.interval, args.hits_size, args.edges_size) elif args.action == "stop": mgmt.stop_profiler() elif args.action == "save": hits, edges = mgmt.get_profile() writer = CallgrindWriter(args.output, args.firmware, not args.no_compression) writer.header() for addr, count in hits.items(): writer.hit(addr, count) for (caller, callee), count in edges.items(): writer.edge(caller, callee, count) finally: mgmt.close()