Xilinx/Vitis_Model_Composer

Sine wave HDL bug: output data can't be spectrum analyzed

Closed this issue · 5 comments

By having this: Sinewave -> output gateway -> spectrum analyzer
Hub setting: zynq7000-7020-400-2, FPGA period:1e9/125e6 Simulink period: 1/125e6
Output is visible in scope but not in spectrum analyzer. DSP spectrum analyzer shows nothing, but by checking the propagate data type to output we can see that also in spectrum analyzer, why?

[AMD Official Use Only - General] Make sure you run the simulation long enough to collect enough samples for the spectrum analyzer. Unlike the scope (which can begin displaying in the time domain as you run it) the spectrum analyzer needs sufficient samples to perform the calculations and will not display results until that happens. Also check the sample times in your entire signal path. Sounds lik... are subscribed to this thread.Message ID: @.@.>>

Sorry, collecting more samples nor using convert AMD block does not cure the bug.
test_file.zip
The file uploaded, though this has been run on latest versions, but I have also checked that on 2022.2vivado 2021bMatlab.
The only cure is to check propagate data type to output in output gateway.
image

I've created bug report on support.xilinx.com and I think we can close this issue, since this is not a tutorials bug.
https://support.xilinx.com/s/question/0D54U00008ENHcSSAX/sine-wave-hdl-bug-output-data-cant-be-spectrum-analyzed

Hello @mohammadsdtmnd ,

Thank you for sharing your design. Looking at it more carefully, I noticed that the output of the subsystem has two NaN elements in it. Apparently, Simulink spectrum analyzer does not behave correctly when there is NaN in the signal, yet, it does not complain about it either. So, I added a simple MATLAB function block to remove any NaN from the signal and the Spectrum Analyzer started working.

image

Here is the code in the MATLAB function block:

function y = fcn(u)

if isnan(u)
    y = 0;
else 
    y = u;
end

Hope this answered your question.

Thanks

Dear @abehbood
Absolute answer, THX so much. This means sinewave block has bug that produces NaN in its output. Also have you noticed that the output frequency is double the frequency you have assigned to this block?
This is bug and I can't understand why it is present in 2022.2 and 2023.2 both. Also, no documentation about theory of operation of this block?!
I'm not sure if this place is the right place for reporting bugs?