Ejemplo n.º 1
0
def get_glitches_per_bit(r,
                         zdok,
                         snaps=['snapshot_adc0'],
                         delays=32,
                         bits=8,
                         cores=4,
                         verbose=False):
    set_test_mode(r, zdok, counter=False)
    sync_adc(r)
    glitches = np.zeros([cores, bits, delays], dtype=int)
    for delay in range(delays):
        logger.debug("setting delay %d" % (delay))
        for core in range(cores):
            set_io_delay(r, zdok, core, delay)
        test_vec = np.array(get_test_vector(r, snaps))
        for core in range(cores):
            for bit in range(bits):
                glitches[core, bit,
                         delay] = count_bit_glitches(test_vec[core], bit)
    if verbose:
        for core in range(cores):
            logger.debug("##### GLITCHES FOR CORE %d BY IODELAY #####" % core)
            for delay in range(delays):
                string = ''
                string += "%2d:" % delay
                for bit in range(bits):
                    string += "%4d" % (glitches[core, bit, delay])
                string += "TOTAL %d" % (glitches.sum(axis=1)[core, delay])
                logger.debug(string)
    unset_test_mode(r, zdok)
    return glitches
Ejemplo n.º 2
0
def set_adc_iodelays(r,zdok,delays,verbose=False):
    """
    Pass an NCORES x NDELAYS array to write the delays of the IODELAY blocks
    """
    cores, bits = delays.shape
    for core in range(cores):
        if verbose: print "setting core %d delays"%core, delays[core]
        for bit in range(bits):
            set_io_delay(r,zdok,core,delays[core,bit],bit=bit)
Ejemplo n.º 3
0
def set_adc_iodelays(r, zdok, delays, verbose=False):
    """
    Pass an NCORES x NDELAYS array to write the delays of the IODELAY blocks
    """
    cores, bits = delays.shape
    for core in range(cores):
        logger.info("setting adc %d core %d delays: %s" % (zdok, core, str(delays[core])))
        for bit in range(bits):
            set_io_delay(r, zdok, core, delays[core, bit], bit=bit)
Ejemplo n.º 4
0
def set_adc_iodelays(r, zdok, delays, verbose=False):
    """
    Pass an NCORES x NDELAYS array to write the delays of the IODELAY blocks
    """
    cores, bits = delays.shape
    for core in range(cores):
        if verbose: print "setting core %d delays" % core, delays[core]
        for bit in range(bits):
            set_io_delay(r, zdok, core, delays[core, bit], bit=bit)
Ejemplo n.º 5
0
def set_adc_iodelays(r, zdok, delays, verbose=False):
    """
    Pass an NCORES x NDELAYS array to write the delays of the IODELAY blocks
    """
    cores, bits = delays.shape
    for core in range(cores):
        logger.info("setting adc %d core %d delays: %s" %
                    (zdok, core, str(delays[core])))
        for bit in range(bits):
            set_io_delay(r, zdok, core, delays[core, bit], bit=bit)
Ejemplo n.º 6
0
def get_glitches_per_bit(r,zdok,snaps=['snapshot_adc0'],delays=32,bits=8,cores=4,verbose=False):
    set_test_mode(r,zdok,counter=False)
    sync_adc(r)
    glitches = np.zeros([cores,bits,delays],dtype=int)
    for delay in range(delays):
        if verbose: print "setting delay %d"%(delay)
        for core in range(cores):
            set_io_delay(r,zdok,core,delay)
        test_vec = np.array(get_test_vector(r,snaps))
        for core in range(cores):
            for bit in range(bits):
                glitches[core,bit,delay] = count_bit_glitches(test_vec[core],bit)
    if verbose:
        for core in range(cores):
            print "##### GLITCHES FOR CORE %d BY IODELAY #####"%core
            for delay in range(delays):
                print "%2d:"%delay,
                for bit in range(bits):
                    print "%4d"%glitches[core,bit,delay],
                print "TOTAL %d"%glitches.sum(axis=1)[core,delay]
    unset_test_mode(r,zdok)
    return glitches