I was wondering if anyone could help me figure out how to stream approximately 64KB/s from a custom module to a PC, or even put that data into the SD card of the Red Pitaya. I have a module which outputs to 32 registers (in the 0x406... mmap area) at approximately 500Hz, and I would like to operate the module for a long time (an hour or so), saving all the data acquired (so close to 250MB).
I was thinking about writing a C program to do this, but I'm a little lost in how to access the mapped memory from the FPGA with C. I understand that you can use a pointer to this memory, but to do this you need to generate a virtual address, and I'm somewhat confused by how to do that.
Code: Select all
void* virt_addr = map_base + (a_addr & MAP_MASK);
Code: Select all
map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, addr & ~MAP_MASK);
Code: Select all
read_result = *((uint32_t *) virt_addr);
This is the code I'm looking at: https://github.com/RedPitaya/RedPitaya/ ... /monitor.c
Thank you,
Corey