예제 #1
0
args = parser.parse_args()

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')
예제 #2
0
파일: test_x_rx.py 프로젝트: TCioms/corr2
                    help='list cores on this device')
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)