Digital FIR Filtering with Circular Buffers to Cut Memory Stalls
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The Von Neumann bottleneck in processor architectures, particularly in digital signal processors (DSPs) and other processors lacking dedicated multiply-accumulate (MAC) units, leads to inefficiencies due to the need for multiple instructions and memory operations, which exacerbate idle times and stalls, especially in algorithms like FIR filters.
Innovation Solution
Implementing a digital filter using a circular buffer and coefficient array with pointers, utilizing a MAC unit to perform multiply-accumulate operations efficiently, reducing the need for frequent memory accesses and optimizing processor utilization.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a processor without dedicated MAC units executes multiplication operations using multiple single instructions (add and shift operations), then the processor can perform the operations, but the processing time increases and the Von Neumann bottleneck worsens
Solution Approach 1:
The patent segments the FIR filter computation into distinct phases: loading input samples into a circular buffer, loading coefficients into registers, performing MAC operations, and storing results. This segmentation allows optimized instruction scheduling and reduces idle time by preparing data in advance for each phase.
Solution Approach 2:
The patent implements preliminary action by pre-loading input samples into a circular buffer and pre-loading coefficients into registers before the main processing loop. This ensures that data is ready in registers when needed, minimizing memory access delays during the critical MAC operation phase.
2Productivity
If multiple memory operations are performed to load samples and coefficients, then data can be accessed, but the Von Neumann bottleneck causes unfavorable stalls and idle times
Solution Approach 1:
The patent performs preliminary loading of input samples into a circular buffer structure and pre-loads coefficients into processor registers before the main filtering loop. This advance preparation ensures that data is already in fast-access memory or registers when the MAC operations need it, eliminating memory access stalls during computation.
Solution Approach 2:
The patent introduces a circular buffer as an intermediary data structure between main memory and the processing units. This buffer acts as a mediator that holds input samples in a readily accessible format, reducing the frequency and impact of memory access operations during the filtering process.
3Ease of operation
If data is frequently shifted between registers and memory, then operations can be performed, but the register files become a bottleneck and more memory accesses are required
Solution Approach 1:
The patent pre-loads coefficients into processor registers before the filtering loop begins. This preliminary action ensures that coefficient data remains in fast register memory throughout the computation, eliminating the need for repeated register-memory transfers and reducing memory access frequency.
Solution Approach 2:
The patent transforms the data access pattern by organizing input samples in a circular buffer structure that allows sequential access with wraparound. This dimensional organization of data in memory space enables the processor to access samples in a predictable pattern, reducing the need for complex register-shifting operations.
Data Source
AI summary
A digital filtering device includes at least one processor, a sample buffer configured to store samples, the sample buffer being a circular buffer, and a coefficient array for storing coefficients of a digital filter. The coefficient array includes a set of digital filter coefficients and a copy of the set of coefficients. For each of a plurality of input samples, the at least one processor can obtain a sample and store the sample as a value in a sample buffer at a position indicated by a buffer pointer, calculate an output sample comprising to perform a multiply-accumulate (MAC) operation with values currently stored in the sample buffer and a subset of the coefficients stored in a coefficient array, wherein a position of the subset of coefficients in the coefficient array is indicated by a coefficient pointer; and update the buffer pointer and the coefficient pointer.


