Hi!!
I am using pynq version 3.0.1 on Xilinx KRIA KR260 (SOM). Vivado 2022.1.
I am trying to implement a 2D FFT on the PL using the following resource:
(886) 4: Reconfigurable FFT Example on PYNQ Z2 #HLS #Jupyter - YouTube
In this, we attach a dma_driver to the config_dma(which sends the configuration information to the FFT IP), so that we can change the FFT size directly from the jupyter notebook and we need not change the .bit file every time we want to change the FFT configuration.
So, this worked fine for the first time(FFT on every row in a 2d matrix) we wanted to configure(setting FFT size) the FFT.
When we transpose the matrix, the FFT size needs to be changed. When I now try to configure the config_dma again (using dma_driver), the cell runs continuously and does not halt.
Could someone please help me with this!!
Any suggestions are appreciated!!.
Thank you
Fig: FFT design
from pynq import DefaultHierarchy
from pynq import allocate
from math import log
import numpy as np
class fft_block_driver(DefaultHierarchy):
def __init__(self,description):
super().__init__(description)
self.configuration=0
self.ff_size=0
def convert_to_data(self,fft_direction,size):
fft_direction.zfill(8)
byte2='0'*8
x=int(log(size,2))
fft_size=bin(x)[2:]
fft_size.zfill(8)
tdata=fft_direction+byte2+fft_size
return int(tdata,2)
def configure(self,fft_direction,fft_size):
self.configuration=self.convert_to_data(fft_direction,fft_size)
temp=allocate(1,np.uint32)
temp[0]=self.configuration
self.config_dma.sendchannel.transfer(temp)
self.config_dma.sendchannel.wait()
del temp
def stream_fft(self,input_buf):
out_buffer=allocate(samples,np.csingle)
self.data_dma.sendchannel.transfer(input_buf)
self.data_dma.recvchannel.transfer(out_buffer)
self.data_dma.sendchannel.wait()
self.data_dma.recvchannel.wait()
return out_buffer
@staticmethod
def checkhierarchy(description):
if 'data_dma' in description['ip']\
and 'config_dma' in description['ip']:
return True
return False
Fig: dma_driver
Fig: input signal
In the above screenshot, the last cell keeps on running and does not give any output.
(chirps and samples values are interchanged after transposing matrix and is not shown here )