When using Simulink External Mode with an AXI4-Stream IIO Read block, if the timeout value is greater than zero, it cause the simulation time to be slower than actual time

4 views (last 30 days)
I started implementing AXI4-stream IIO Read block and HDL FIFO block to aqcuire the ADC sampling data in externl mode.
ADC Acquisition(SPI interface) is designed with HDL Coder
The ADC sampling Hz is hundreds of times that of external mode sampling(1kHz).
So, frame size of HDL FIFO has a value of several hundred.
When the time out value of AXI4-Stream IIO Read block is greater than zero, Time goes slowly waiting for the results of AXI4-Stream IIO Read block. And the valid output of AXI4-Stream IIO Read block is false. The time out value is set to 10 seconds.
I don't know why AXI4-Stream IIO Read block can't read the data even though it's a long time out.
But, Sometimes it worked properly and I saw the desired result. I think it is unstable.
One suspect point is that this may happen if the data size is too large.
It was designed by referring to the link below.

Accepted Answer

Jack on 30 Mar 2023
It sounds like you are experiencing some issues with the AXI4-Stream IIO Read block in your implementation. Without more specific details, it is difficult to pinpoint the exact cause of the problem, but here are a few general suggestions that may help:
  1. Check the AXI4-Stream IIO Read block configuration: Make sure that the block is configured correctly, including the sample size, number of channels, and data type. Verify that the data being read from the ADC matches the configuration of the block.
  2. Check the FIFO configuration: Since you mentioned that the frame size of the HDL FIFO block is several hundred, make sure that the FIFO block is configured properly to accommodate this size. Ensure that the FIFO depth is large enough to hold the data.
  3. Check the clocking and synchronization: Make sure that the clocking and synchronization between the ADC and the AXI4-Stream IIO Read block are correct. Verify that the clocking of the ADC is properly synchronized with the AXI4-Stream interface clock.
  4. Check for potential issues with data size: It's possible that the data size is too large for the AXI4-Stream IIO Read block to handle properly. You may need to reduce the data size or consider using multiple AXI4-Stream IIO Read blocks in parallel to handle the data.
  5. Check for intermittent issues: Since you mentioned that the issue is intermittent, it's possible that there are occasional communication issues between the ADC and the AXI4-Stream IIO Read block. Try to identify any patterns or specific conditions when the issue occurs.
If these suggestions do not resolve the issue, it may be helpful to provide more specific details about your implementation, such as block diagram and configuration settings. This can help to identify potential issues or provide more targeted solutions.

More Answers (1)

Kiran Kintali
Kiran Kintali on 1 Apr 2023
The timeout behavior is expected, the timeout leads to overrun in the software task and so the time step will get out of sync with real time. There may be an issue with the hardware design. Please check the problematic logic around the FIFO or sorrounding logic.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!