User`s guide
Contiguous Copy
5-91
5Contiguous Copy
Purpose Create a discontiguous input in a contiguous block of memory (for RTW code
generation from blocks linked to versions of the DSP Blockset prior to 4.0).
Library Signal Management / Signal Attributes
Description The Contiguous Copy block copies the input to a contiguous block of memory,
and passes this new copy to the output. The output is identical to the input, but
is guaranteed to reside in a contiguous section of memory.
Because Simulink employs an efficient copy-by-reference method for
propagating data in a model, some operations produce outputs with
discontiguous memory locations. An example of such an operation is shown
below with the Simulink Selector block.
Although this does not present a problem during simulation, blocks linked to
versions of the DSP Blockset prior to 4.0 may require contiguous inputs for
code-generation with the Real-Time Workshop (RTW). When such blocks are
used in a model intended for code generation, they should be preceded by the
Contiguous Copy block to ensure that their inputs are contiguous. The DSP
Blockset version 3.1 Autocorrelation block shown below is an example of one
that requires contiguous inputs for code generation.
u
1
u
2
u
3
u
4
u
5
u
6
u
7
u
8
m
1
m
2
m
3
m
4
m
5
m
6
m
7
m
8
m
1
m
2
m
3
m
4
m
5
m
6
m
7
m
8
m
6
m
3
m
7
Memory a
dd
resses
Memory contents
Vector of pointers to
contiguous memory
Vector of pointers to
discontiguous memory