parser.add_argument('-c', '--core', dest='core', action='store', default='gbe0', type=str, help='the core to query') parser.add_argument('-d', '--direction', dest='direction', action='store', default='tx', type=str, help='tx or rx stream') parser.add_argument('-s', '--spead', dest='spead', action='store_true', default=False, help='try and decode spead in this 10Gbe stream') args = parser.parse_args() # create the device and connect to it fpga = KatcpClientFpga(args.hostname, 7147) time.sleep(0.2) if not fpga.is_connected(): fpga.connect() fpga.test_connection() fpga.get_system_information() verbose = False # list the cores we find if args.listcores: cores = fpga.tengbes.names() numgbes = len(cores) print 'Found %i ten gbe core%s:' % (numgbes, '' if numgbes == 1 else 's') for core in cores: print '\t', core fpga.disconnect() sys.exit(0)
polltime = args.polltime num_spead_headers = 4 xeng_hosts = args.hosts.lstrip().rstrip().replace(' ', '').split(',') xeng_hosts = ['roach020921', 'roach020927', 'roach020919', 'roach020925', 'roach02091a', 'roach02091e', 'roach020923', 'roach020924'] # create the devices and connect to them xfpgas = [] for host in xeng_hosts: xeng_fpga = KatcpClientFpga(host) time.sleep(0.3) if not xeng_fpga.is_connected(): xeng_fpga.connect() xeng_fpga.test_connection() xeng_fpga.get_system_information() numgbes = len(xeng_fpga.tengbes) if numgbes < 1: raise RuntimeError('Cannot have an xengine with no 10gbe cores?') print '%s: found %i 10gbe core%s.' % (host, numgbes, '' if numgbes == 1 else 's') xfpgas.append(xeng_fpga) def print_headers(scr): '''Print the table headers. ''' scr.addstr(2, 2, 'xhost') scr.addstr(2, 20, 'tap') scr.addstr(2, 30, 'TX') scr.addstr(3, 30, 'cnt')
#feng_hosts = ['roach02091b', 'roach020914',]# 'roach020915', 'roach020922', ## 'roach020921', 'roach020927', 'roach020919', 'roach020925'] #feng_hosts = ['roach020915'] feng_hosts = args.hosts.lstrip().rstrip().replace(' ', '').split(',') feng_hosts = ['roach02091b', 'roach020914', 'roach020915', 'roach020922'] # create the devices and connect to them ffpgas = [] for host in feng_hosts: feng_fpga = KatcpClientFpga(host) time.sleep(0.3) if not feng_fpga.is_connected(): feng_fpga.connect() feng_fpga.test_connection() feng_fpga.get_system_information() numgbes = len(feng_fpga.tengbes) if numgbes < 1: raise RuntimeError('Cannot have an fengine with no 10gbe cores?') print '%s: found %i 10gbe core%s.' % (host, numgbes, '' if numgbes == 1 else 's') if args.rstcnt: feng_fpga.registers.control.write(cnt_rst='pulse') ffpgas.append(feng_fpga) def fengine_gbe(fpga): '''Get 10gbe data from the fpga. ''' cores = fpga.tengbes returndata = {}