| Customize Help

Cascaded and parallel processing



When designing a primitive function for your application, you might encounter situations where the entire operation must be carried out by two or more PUs. For example, your application might require a Bayer filter as well as a LUT mapping.

Depending on the application, you might want specific PU operations to be cascaded (the result of one PU transferred directly to another PU) or carried out in parallel, or a combination of both to reduce the number of memory accesses. If the PUs are appropriately interconnected in the FPGA configuration, MIL allows you to do so. Refer to your FPGA documentation for more information.

Cascaded processing operation

You can cascade the processing operations of the PUs associated with two command contexts using MfpgaSetLink().

When you link two command contexts, the stream output of one PU is used as the stream input for the other PU. To transfer image data between two PUs, the stream output of the source PU and the stream input of the destination PU must be configured to the same image data format.

To cascade several PUs, you must create a command context for each PU and then link the command contexts two at a time. Note that calling MfpgaSetLink() to route the output of one PU to the stream input of another PU requires that this path is available between the PUs in the FPGA configuration.

To ensure that the cascaded processing operations start at the right moment in time, there are special considerations when queuing their commands. For more information, see the Issuing commands to the Processing FPGA and retrieving results section later in this chapter.

Parallel processing operation

You can also send data simultaneously from memory or from a PU to two or more different PUs. To do so, the FPGA configuration must include a specialized PU called a splitter PU. The splitter PU receives image data at its stream input port and copies this data to all its stream output ports. If you cascade the stream output ports of the splitter PU with the stream input ports of the required PUs, the required PUs will simultaneously process the same data. For example, you can simultaneously send the result of a PU that performs a Bayer operation to a PU that performs a gain and offset operation and a PU that performs a min/max operation.

Note that a path between the stream output ports of the splitter PU and the stream input ports of the required PUs must exist. The number of output ports of the splitter PU, included in your FPGA configuration, depends on the PU's subfunction identifier. In addition, the stream outputs of the splitter PU and the stream input(s) of the destination PU(s) must be configured to the same image data format.

Similar to when cascading processing operations, to ensure that the processing operations are performed in parallel, there are special considerations when queuing their commands. For more information, see the Issuing commands to the Processing FPGA and retrieving results section later in this chapter.

Note that you must set up the splitter PU just like any other PU. This means that you must create a command context for each required splitter PU present in the FPGA configuration.