Esempio n. 1
0
    # start tx
    print 'Starting TX on %s' % dhost.host,
    sys.stdout.flush()
    dhost.enable_data_output(enabled=True)
    dhost.registers.control.write(gbe_txen=True)
    print 'done.'
    sys.stdout.flush()
    something_happened = True

if args.stop:
    dhost.enable_data_output(enabled=False)
    print 'Stopped transmission on %s.' % dhost.host
    something_happened = True

if args.pulse:
    dhost.pulse_data_output(args.pulse_packets)
    print 'Pulsed {} packets per polarisation'.format(args.pulse_packets)
    something_happened = True

if args.sine_source:
    for sine_name, xscale_s, yfreq_s in args.sine_source:
        xscale = float(xscale_s)
        yfreq = float(yfreq_s)
        try:
            sine_source = getattr(dhost.sine_sources, 'sin_{}'.format(sine_name))
        except AttributeError:
            print "You can only select between sine sources: {}".format([
                ss.name for ss in dhost.sine_sources])
            sys.exit(1)
        try:
            sine_source.set(scale=xscale, frequency=yfreq)
Esempio n. 2
0
        after = dfpga.registers.gbe0_txctr.read()['data']['reg']

    if before == after:
        print('Digitiser tx raw data failed.')
    else:
        print('Digitiser tx raw data success.')
    sys.stdout.flush()
    something_happened = True

if args.stop:
    dfpga.enable_data_output(enabled=False)
    print('Stopped transmission on {}.'.format(dfpga.host))
    something_happened = True

if args.pulse:
    dfpga.pulse_data_output(args.pulse_packets)
    print('Pulsed {} packets per polarisation'.format(args.pulse_packets))
    something_happened = True

if args.sine_source:
    for sine_name, xscale_s, yfreq_s in args.sine_source:
        xscale = float(xscale_s)
        yfreq = float(yfreq_s)
        try:
            sine_source = getattr(dfpga.sine_sources,
                                  'sin_{}'.format(sine_name))
        except AttributeError:
            print('You can only select between sine sources: {}'.format(
                [ss.name for ss in dfpga.sine_sources]))
            sys.exit(1)
        try: