One possibility might be that the freezes are due to the Python garbage collector. I’m not sure how to check for that on Python, but some Python experts here might have some ideas.
Is there any way you can reuse pre-allocated buffers to read and unpack into? Cheers, Dave > On Jan 6, 2025, at 10:43, Jose Vargas <jvar...@das.uchile.cl> wrote: > > Hello, > > I'm working on a RFSoC 4x2 board designing a digital sideband separation > spectrometer with the Casper environment. My model is based on the tutorial > 3, using the complex fft in particular. To acquire the data from the BRAMs > and see the spectrum of both sidebands I use the next "for" cycle. If I use > nfft = 8192, for example, it takes about 40 miliseconds to read all the > BRAMs, however sometimes it freezes and it takes more than 6 seconds to read > the BRAMs, which is a problem for observation with the spectrometer. > > for i in range(n_outputs): # Extract data from BRAMs blocks for each > output > > if nfft == 512: # Re_bin spectrum > raw1[i,:] = struct.unpack(f'>{bins_out}{data_type}', > fpga.read(f're_bin_synth0_{i}', add_width * data_width, 0)) > raw2[i,:] = struct.unpack(f'>{bins_out}{data_type}', > fpga.read(f're_bin_synth1_{i}', add_width * data_width, 0)) > > else: # High resolution spectrum > raw1[i,:] = struct.unpack(f'>{bins_out}{data_type}', > fpga.read(f'synth0_{i}', add_width * data_width, 0)) > raw2[i,:] = struct.unpack(f'>{bins_out}{data_type}', > fpga.read(f'synth1_{i}', add_width * data_width, 0)) > > The RFSoC is connected by Ethernet to the same network of my computer. I > tried to connect directly the board to the PC, even deactivating the > Internet, but there is still freezing and delays the data acquisition. What > do you recommend to solve my problem? > > In the image can be see the part of my model with the BRAMs of one sideband > (the other is analogous) > > Best regards, > José Vargas > > -- > You received this message because you are subscribed to the Google Groups > "casper@lists.berkeley.edu" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to casper+unsubscr...@lists.berkeley.edu > <mailto:casper+unsubscr...@lists.berkeley.edu>. > To view this discussion visit > https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/cf670c11-eb04-4af8-a550-8b87c0cac6f5n%40lists.berkeley.edu > > <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/cf670c11-eb04-4af8-a550-8b87c0cac6f5n%40lists.berkeley.edu?utm_medium=email&utm_source=footer>. > <Screenshot from 2025-01-06 15-34-02.png> -- You received this message because you are subscribed to the Google Groups "casper@lists.berkeley.edu" group. To unsubscribe from this group and stop receiving emails from it, send an email to casper+unsubscr...@lists.berkeley.edu. To view this discussion visit https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/7B56636C-0C65-4A90-B3B6-15274BB0A36E%40berkeley.edu.