def calibrate_zdok(hwm): logger.info('Calibrating Z-DOK') roaches = hardware_map.get_roaches(hwm) for roach in roaches: roach.sendUARTCommand(0x4) time.sleep(0.1) roach.fpga.write_int('adc_in_i_scale', 2**7) # set relative IQ scaling to 1 roach.fpga.write_int('run', 1) busDelays = [14, 18, 14, 13] busStarts = [0, 14, 28, 42] busBitLength = 12 for iBus in xrange(len(busDelays)): logger.info('starting iBus {}'.format(iBus)) delayLut = zip( np.arange(busStarts[iBus], busStarts[iBus] + busBitLength), busDelays[iBus] * np.ones(busBitLength)) logger.info('delayLut = '.format(delayLut)) loadDelayCal(roach.fpga, delayLut) logger.info('done with iBus {}'.format(iBus)) calDict = findCal(roach.fpga) logger.info('calDict = '.format(calDict)) roach.sendUARTCommand(0x5) logger.info('switched off ADC ZDOK Cal ramp')
def program_v6(hwm): logger.info("Programming V6 FPGA") roaches = hardware_map.get_roaches(hwm) for roach in roaches: roach.fpga.upload_to_ram_and_program(roach.FPGAFirmwareFile) fpgaClockRate = roach.fpga.estimate_fpga_clock() logger.info("Fpga Clock Rate: {}".format(fpgaClockRate))
def calibrate_qdr(hwm): logger.info('Calibrating QDR') roaches = hardware_map.get_roaches(hwm) for roach in roaches: bFailHard = False results = {} for iQdr, qdr in enumerate(roach.fpga.qdrs): mqdr = myQdr.from_qdr(qdr) results[qdr.name] = mqdr.qdr_cal2(fail_hard=bFailHard) logger.info('Qdr cal results: {}'.format(results))
def initialize_v7(hwm): logger.info('Initializing V7 FPGA') roaches = hardware_map.get_roaches(hwm) for roach in roaches: logger.info('Initializing UART') roach.initializeV7UART(waitForV7Ready=roach.waitForV7Ready) logger.info('UART initialized') logger.info('Initializing V7 MB') roach.initV7MB() logger.info('V7 MB initialized') logger.info('Setting LO to {} GHz'.format(2)) roach.setLOFreq(2.e9) logger.info('LO frequency set to {} GHz'.format(2)) roach.loadLOFreq()
def load_frequencies(hwm): roaches = hardware_map.get_roaches(hwm) for roach in roaches: roach.load_freq(hwm)
def define_dac_lut(hwm): roaches = hardware_map.get_roaches(hwm) for roach in roaches: roach.defineDacLUTs()
def define_roach_lut(hwm): roaches = hardware_map.get_roaches(hwm) for roach in roaches: roach.defineRoachLUTs()
help='Start frequency of LO sweep') P.add_argument('--LOstop', default=None, action='store', type=float, help='Stop frequency of LO sweep') P.add_argument('--LOstep', default=None, action='store', type=float, help='Frequency step of LO sweep') args = P.parse_args() hwm = hardware_map.build(args.configFile) # connect to the roach load_frequencies(hwm) define_roach_lut(hwm) define_dac_lut(hwm) # get some numbers needed for the sweep roaches = hardware_map.get_roaches(hwm) for roach in roaches: LO_freq = roach.LOFreq LO_span = roach.sweeplospan LO_step = roach.sweeplostep if args.LOstart: LO_start = args.LOstart else: LO_start = LO_freq - LO_span/2. if args.LOstop: LO_stop = args.LOstop else: LO_stop = LO_freq + LO_span/2.
def connect(hwm): logger.info("Connecting to roach") roaches = hardware_map.get_roaches(hwm) for roach in roaches: roach.connect()