def main(): args = get_argparser().parse_args() init_logger(args) if not args.print_decoded and args.write_vcd is None and args.write_dump is None: print("No action selected, use -p, -w and/or -d. See -h for help.") sys.exit(1) device_mgr = DeviceManager(DeviceDB(args.device_db)) try: if args.read_dump: with open(args.read_dump, "rb") as f: dump = f.read() else: comm = device_mgr.get("comm") dump = comm.get_analyzer_dump() decoded_dump = decode_dump(dump) if args.print_decoded: print("Log channel:", decoded_dump.log_channel) print("DDS one-hot:", decoded_dump.dds_onehot_sel) for message in decoded_dump.messages: print(message) if args.write_vcd: with open(args.write_vcd, "w") as f: decoded_dump_to_vcd(f, device_mgr.get_device_db(), decoded_dump) if args.write_dump: with open(args.write_dump, "wb") as f: f.write(dump) finally: device_mgr.close_devices()
def main(): args = get_argparser().parse_args() init_logger(args) if (not args.print_decoded and args.write_vcd is None and args.write_dump is None): print("No action selected, use -p, -w and/or -d. See -h for help.") sys.exit(1) device_mgr = DeviceManager(DeviceDB(args.device_db)) try: if args.read_dump: with open(args.read_dump, "rb") as f: dump = f.read() else: comm = device_mgr.get("comm") dump = comm.get_analyzer_dump() decoded_dump = decode_dump(dump) if args.print_decoded: print("Log channel:", decoded_dump.log_channel) print("DDS one-hot:", decoded_dump.dds_onehot_sel) for message in decoded_dump.messages: print(message) if args.write_vcd: with open(args.write_vcd, "w") as f: decoded_dump_to_vcd(f, device_mgr.get_device_db(), decoded_dump) if args.write_dump: with open(args.write_dump, "wb") as f: f.write(dump) finally: device_mgr.close_devices()
def main(): args = get_argparser().parse_args() common_args.init_logger_from_args(args) if (not args.print_decoded and args.write_vcd is None and args.write_dump is None): print("No action selected, use -p, -w and/or -d. See -h for help.") sys.exit(1) device_mgr = DeviceManager(DeviceDB(args.device_db)) if args.read_dump: with open(args.read_dump, "rb") as f: dump = f.read() else: core_addr = device_mgr.get_desc("core")["arguments"]["host"] dump = get_analyzer_dump(core_addr) decoded_dump = decode_dump(dump) if args.print_decoded: print("Log channel:", decoded_dump.log_channel) print("DDS one-hot:", decoded_dump.dds_onehot_sel) for message in decoded_dump.messages: print(message) if args.write_vcd: with open(args.write_vcd, "w") as f: decoded_dump_to_vcd(f, device_mgr.get_device_db(), decoded_dump, uniform_interval=args.vcd_uniform_interval) if args.write_dump: with open(args.write_dump, "wb") as f: f.write(dump)
def main(): args = get_argparser().parse_args() init_logger(args) if (not args.print_decoded and args.write_vcd is None and args.write_dump is None): print("No action selected, use -p, -w and/or -d. See -h for help.") sys.exit(1) device_mgr = DeviceManager(DeviceDB(args.device_db)) if args.read_dump: with open(args.read_dump, "rb") as f: dump = f.read() else: core_addr = device_mgr.get_desc("core")["arguments"]["host"] dump = get_analyzer_dump(core_addr) decoded_dump = decode_dump(dump) if args.print_decoded: print("Log channel:", decoded_dump.log_channel) print("DDS one-hot:", decoded_dump.dds_onehot_sel) for message in decoded_dump.messages: print(message) if args.write_vcd: with open(args.write_vcd, "w") as f: decoded_dump_to_vcd(f, device_mgr.get_device_db(), decoded_dump, uniform_interval=args.vcd_uniform_interval) if args.write_dump: with open(args.write_dump, "wb") as f: f.write(dump)