I hope this is not too broad a question, I try to be as specific as I can. I am using a Zynq SoC with FPGA and CPU. I am using the FPGA for a lot of DSP, that depends on many register values. In most of the operation, the CPU code issues register changes, which works in a (I think) usual way:
- Various parts of the CPU code issue variable length instructions which are sent in packed form through a DMA FIFO to the FPGA.
- The FPGA has an operation decoder, which dispatches the CPU instructions to the respective registers as they come in
- The FPGA decoder needs no buffering (other than the FIFO itself), no arbitration and can run at a fixed clock rate, making it rather simple
simulate this circuit – Schematic created using CircuitLab
Now my question is about the other way:
Various parts of the DSP can cause irregular register value changes in the FPGA registers. Such updates could occur maximum 1000 times per second under regular operation conditions, usually much more rarely. Now I am not very experienced with such things, but I would like to set up some efficient and scalable method inside the FPGA to push these updates to the CPU. What I have at the moment is described below.
- The FPGA constantly monitors all interesting register value and detects value changes. There are ~100 such interesting registers.
- These value changes are flagged and issued for transmission to the CPU. I.e. several changes might be detected in a single clock cycle.
- Only one update is sent out each clock cycle via a FIFO. To realize (or rather avoid) arbitration, they are explicitly ordered by priority.
- If many updates occur simultaneously, the most important ones will be transmitted first. If important updates arrive extremely frequently, unimportant ones may be significantly delayed (which is acceptable).
- Another issue is a long decision chain (N-1 steps for N registers), to decide which register update to transmit
My feeling is that this is clunky and not very scalable, especially when there will be very many monitored registers. So I am wondering what the "professional" approach was to such a task