This repository contains the SystemVerilog code necessary to run and test a 32-point 16-bit fixed-point FFT in Quartus.
Steps for operation:
-
Ensure you have a working python distribution with Numpy, Matplotlib, and Jupyter installed. It is recommended to use conda/anaconda or Python's virtual environments.
-
Run
rom/twiddle.pyin order to generate twiddle vectors inrom/twiddle.vectorsandsimulation/modelsim/rom/twiddle.vectors. -
Open the
fft_sim_visualization.ipynbjupyter notebook. In this notebook, you can generate pre-existing (or your own) test-case input sequence. Run the notebook until you have bothsimulation/modelsim/rom/test_in.memh(the simulation input sequence) andsimulation/modelsim/rom/gt_test_out.memhwritten.) -
Open the
fft.qpfproject in Quartus, and run the RTL simulation in ModelSim. This should runfft_testbenchinsrc/testbenches.svuntil thestopsignal is raised. The console should show no errors, and "FFT test complete." The output of the FFT computation should be written tosimulation/modelsim/rom/test_out.memh. For a more detailed look at how the FFT is operating, delete the default waveforms and loadsimulation/modelsim/debug.do, which provides most waveforms relevant for debugging. -
Run the rest of the Jupyter notebook to plot the output of the SystemVerilog FFT implementation and compare it to the Python implementation.