How can the CPU/DMA read from a Verilog component implemented in PLDs of UDB Blocks?
There are no hardware registers associated with the PLD-based Verilog Component which can store the values of the signals used inside the Component. Therefore, the CPU/DMA cannot read directly from the Component. One way to read from the Component is to bring the required signals out through output pins and connect a status register to it.
Note: If a UDB Component PLD input or output associate to datapath fixed register by PI/PO bus, it also can be read by CPU/DMA. PI/PO bus shares the same 8-bit bus with the UDB status/control register.
A simple example of a 3-bit counter is as follows:
output [2:0] count;
//`#start body` -- edit after this line, do not edit this line
reg [2:0] count;
always @(posedge clock)
count <= count+1'd1;
As can be seen, ‘count’ has an output signal. A status register connected to the ‘count’ terminal is shown below.
The CPU can read the counts by simply reading the status register. The counts can be transferred to another destination using DMA by setting the source address as the address of the status register.