Advice on custom NIOS packet, and allocating NIOS memory
Posted: Tue Mar 07, 2017 7:25 pm
I'm working on a project to scan the entire spectrum 0.3 - 3.8 GHz and detect spectrum holes. This project performs all processing inside the FPGA and involves 125 frequency retune operations. The NIOS II processor will be used to tune to each frequency and instruct the FPGA datapath to process X samples before tuning to the next frequency.
To kick off an iteration of this scanner, I want send a custom packet from the host PC to the NIOS (through UART) which contains a big list of precalculated frequencies to tune to along with some other information (DC offset, gain, etc. for each frequency). This packet will be around 1250 bytes long. The NIOS will store the list in memory somewhere. Then, a special START packet will be sent to tell the NIOS to do the scan.
Now, after digging through bladeRF codebase, I realized that the packets which are sent between the host PC and the NIOS are fixed at 16 bytes. Even if you change the software, the packet size is fixed to 16 bytes in the HDL in command_uart.vhd as well as the NIOS system in general. It seems like it would be a bit of a pain to make the changes to allow for a 1250-byte packet to be sent.
So instead I can split my 1250-byte packet into a bunch of 16-byte custom packets which I send over to the NIOS one-by-one. I'll need to allocate a 1250-byte chunk of memory in the NIOS - and write to this memory as the packets come in. A question I have here is, how should I go about declaring this 1250-byte chunk of memory in the NIOS? Can I just declare a stack memory buffer in the code? Or would a heap buffer be better? Or would I need to add separate RAM/register memory to the NIOS system which connects to the processor through the Avalon interface?
TL;DR: Need to send 1250 bytes from PC to NIOS and store them in NIOS memory.
Any advice on how I should do this?
Ian
To kick off an iteration of this scanner, I want send a custom packet from the host PC to the NIOS (through UART) which contains a big list of precalculated frequencies to tune to along with some other information (DC offset, gain, etc. for each frequency). This packet will be around 1250 bytes long. The NIOS will store the list in memory somewhere. Then, a special START packet will be sent to tell the NIOS to do the scan.
Now, after digging through bladeRF codebase, I realized that the packets which are sent between the host PC and the NIOS are fixed at 16 bytes. Even if you change the software, the packet size is fixed to 16 bytes in the HDL in command_uart.vhd as well as the NIOS system in general. It seems like it would be a bit of a pain to make the changes to allow for a 1250-byte packet to be sent.
So instead I can split my 1250-byte packet into a bunch of 16-byte custom packets which I send over to the NIOS one-by-one. I'll need to allocate a 1250-byte chunk of memory in the NIOS - and write to this memory as the packets come in. A question I have here is, how should I go about declaring this 1250-byte chunk of memory in the NIOS? Can I just declare a stack memory buffer in the code? Or would a heap buffer be better? Or would I need to add separate RAM/register memory to the NIOS system which connects to the processor through the Avalon interface?
TL;DR: Need to send 1250 bytes from PC to NIOS and store them in NIOS memory.
Any advice on how I should do this?
Ian