Skip to content

Fix incorrect sample reading when precision == 16 by alternating FIFO sources #56

@Bianco95

Description

@Bianco95

Description

There is an issue in the data reading logic when precision == 16.

In this configuration, each 32-bit word is split into two 16-bit samples:

  • Bits 15:0stream_data_fifo
  • Bits 31:16stream_data_fifo_backup

However, the current implementation reads samples only from stream_data_fifo, causing half of the samples to be skipped.

Current Behavior

When precision == 16:

  • Samples are read in the following order:

    • Sample 0, Sample 2, Sample 4, …
  • Samples stored in stream_data_fifo_backup are ignored

    • Sample 1, Sample 3, Sample 5, … are never read

This results in incomplete and incorrect data processing.

Expected Behavior

  • Samples should be read in the correct order:

    • Sample 0 → stream_data_fifo
    • Sample 1 → stream_data_fifo_backup
    • Sample 2 → stream_data_fifo
    • Sample 3 → stream_data_fifo_backup
  • No samples should be skipped when precision == 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions