I have the following problem - my embedded system has four fifos consisting of 64-byte chunks of data. These fifo's and the corresponding data chunks are represented in the diagram below. Once all 4 fifo's have been popped, I need to interleave the data chunks. I can do a simple loop but I am concerned this might be too processor intensive. Does anyone have a smarter way that is less processor intensive in which I can rapidly interleave the different chunks of memory?
2
There are 2 best solutions below
0
0___________
On
#define FIFO1 (volatile uint64_t *)FIFO1_ADDRESS
#define FIFO2 (volatile uint64_t *)FIFO2_ADDRESS
#define FIFO3 (volatile uint64_t *)FIFO3_ADDRESS
#define FIFO4 (volatile uint64_t *)FIFO4_ADDRESS
static inline uint64_t *popfifos(uint64_t *data)
{
data[0] = *FIFO1;
data[1] = *FIFO2;
data[2] = *FIFO3;
data[3] = *FIFO4;
return data + 4;
}
void readFIFOS(uint64_t *buff, size_t nreads)
{
while(nreads--)
{
if(fifosReady()) buff = popfifos(buff);
}
}
fifosReady reads some hardware registers waiting for data to be ready.
Related Questions in C
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in MEMORY
- 9 Digit Addresses in Hexadecimal System in MacOS
- Memory location changing from 0 to 1 consistently on Mac
- Would event listeners prevent garbage collecting objects referenced in outer function scopes?
- tensorrt inference problem: CPU memory leak
- How to estimate the memory size of a binary voxelized geometry?
- Java Memory UTF-16 Vs UTF-8
- Spring Boot application container memory footprint (Java 21)
- Low memory Windows CE
- How to throw an error when a program acesses a block of memory created by you that has been deallocated by a call of free?
- Golang bufio.Scanner: token too long
- Get the address and size of a loaded shared object on memory from C
- In Redis Databases how do we need to calculate the table size
- ClickHouse Materialized View consuming a lot of Memory and CPU
- How to reduce memory usage for large matrix calculations?
- How to use memray with Gunicorn or flask dev server?
Related Questions in EMBEDDED
- MSP430F5529 on the MSPEXP430F5529LP: UART is not actually transmitting despite seemingly correct setup. What is wrong?
- A FPGA Project Proposal where I can use both PS and PL
- Program doesn't run after DFU
- Sending struct through queue
- How to generate a VPI warpmap for polynomial distortion correction?
- How to present this example concept in UML: Using 2 LCD displays in C/C++
- CLion: Debug via St-Link
- Portenta H7 Baremetal Development and a Little Guidance on Embedded System Learning Roadmap
- STM32 RTC3 Mixed Mode: Writing TR resets SSR
- Unable to read value from gpio set as input
- Mbed TLS: in-place en-/decryption for OAEP doesn't seem to work
- Shared variable read from low priority thread in preemptive scheduling
- Own Pattern / framework for interfacing with components in C
- Performance Difference Between Global Variable and Local Variable in Embedded Systems
- Comparing analog signal from Electret mic with samples
Related Questions in INTERLEAVE
- spanner interleaved table lock
- How to do combine 2 list without duplicate in Jmeter?
- How does this double loop list creation work?
- Why Won't My Function Interleave Multiple Wave Files Correctly?
- Python, interleaving two or more linspace arrays
- Push static element between every original element of an array
- What is the most efficient way to find parents without childs on Google Spanner interleaved tables?
- error : interleave() got an unexpected keyword argument 'deterministic', when using tensorflow_datasets
- Interleaving Data in C
- Fast interleave and deinterleave of (jagged) arrays of variable lengths
- Can Atomic values change during an "&&" operation?
- Tensorflow tf.data.Dataset interleave() returns Unexpected result
- Change pixel order of a .tiff file from rgbrgb to rrbbgg (interleaved to non-interleaved)
- Efficient loading of packed 16 bit data using AVX2
- Query by Interleaved table fields using Spring Data Spanner
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

Use an array of FIFO pointers:
Then when you read from a FIFO read from the one referenced by
cur_fifo, then increment it with wraparound: