Real-Time Workshop |
 |
Data Transfer Problems
Rate Transition blocks are designed to deal with the following problems that occur in data transfer between blocks running at different rates:
- Data integrity: A problem of data integrity exists when the input to a block changes during the execution of that block. Data integrity problems can be caused by preemption.
- Consider the following scenario: a faster block supplies the input to a slower block. The slower block reads an input value V1 from the faster block and begins computations using that value. These computations are preempted by another execution of the faster block, which computes a new output value V2. A data integrity problem now arises: when the slower block resumes execution, it continues its computations, now using the "new" input value V2.
We will refer to such a data transfer as unprotected. Figure 8-8 illustrates an unprotected data transfer.
In a protected data transfer, the output V1 of the faster block would be held until the slower block finished executing.
- Deterministic vs. non-deterministic data transfer: In a deterministic data transfer, the timing of the data transfer is completely predictable, as determined by the sample rates of the blocks.
- The timing of a non-deterministic data transfer depends on the availability of data, the sample rates of the blocks, and the time at which the receiving block begins to execute relative to the driving block.
You can use the Rate Transition block to ensure that data transfers in your application are both protected and deterministic. These characteristics are considered desirable in most applications. However, the Rate Transition block supports flexible options that allow you to compromise data integrity and determinism in favor of lower latency. The next section summarizes these options.
| Sample Rate Transitions | | Rate Transition Block Options |  |