CORES = 4 glitches = np.zeros([CORES]) #for i in range(1000000): i = 0 while (True): try: test_vec = np.array( adc.get_test_vector(r, ['feng_snapshot_adc%d' % ADC])) #pylab.subplot(2,1,1) #[pylab.plot(test_vec[core]) for core in range(4)] #pylab.subplot(2,1,2) #[pylab.plot(gray[test_vec[core]]) for core in range(4)] #pylab.show() for core in range(CORES): glitches[core] += adc.total_glitches(test_vec[core], 8) #for j in range(100): # for core in range(CORES): # print "%3d"%test_vec[core,j], # print '' print "Glitches after %d runs:" % i, glitches i += 1 sys.stdout.flush() except KeyboardInterrupt: print "unsetting test mode and leaving" adc.unset_test_mode(r, 0) adc.unset_test_mode(r, 1) exit()
print "setting delay", delay set_io_delay(r,0,0,delay) set_io_delay(r,0,1,delay) set_io_delay(r,0,2,delay) set_io_delay(r,0,3,delay) core_a, core_b, core_c, core_d = adc.get_test_vector(r, ['snapshot_adc0']) #for i in range(4096): # print np.binary_repr(core_a[i],width=8), # print np.binary_repr(core_b[i],width=8), # print np.binary_repr(core_c[i],width=8), # print np.binary_repr(core_d[i],width=8) # print core_a[i], # print core_b[i], # print core_c[i], # print core_d[i] glitches_a += [adc.total_glitches(core_a, 8)] glitches_b += [adc.total_glitches(core_b, 8)] glitches_c += [adc.total_glitches(core_c, 8)] glitches_d += [adc.total_glitches(core_d, 8)] print "GLITCHES IN CORE A B C D BY IODELAY" for delay in range(32): print "%2d %4d %4d %4d %4d"%(delay, glitches_a[delay], glitches_b[delay], glitches_c[delay], glitches_d[delay]) set_io_delay(r,0,0,13)#14) set_io_delay(r,0,1,13)#14) set_io_delay(r,0,2,13)#2) set_io_delay(r,0,3,10)#10) core_a, core_c, core_b, core_d = adc.get_test_vector(r, ['snapshot_adc0']) print "core A glitches:", adc.total_glitches(core_a, 8)
#print opt0, glitches0 CORES = 4 glitches = np.zeros([CORES]) #for i in range(1000000): i = 0 while(True): try: test_vec = np.array(adc.get_test_vector(r, ['feng_snapshot_adc%d'%ADC])) #pylab.subplot(2,1,1) #[pylab.plot(test_vec[core]) for core in range(4)] #pylab.subplot(2,1,2) #[pylab.plot(gray[test_vec[core]]) for core in range(4)] #pylab.show() for core in range(CORES): glitches[core] += adc.total_glitches(test_vec[core],8) #for j in range(100): # for core in range(CORES): # print "%3d"%test_vec[core,j], # print '' print "Glitches after %d runs:"%i, glitches i += 1 sys.stdout.flush() except KeyboardInterrupt: print "unsetting test mode and leaving" adc.unset_test_mode(r, 0) adc.unset_test_mode(r, 1) exit()