User guide
System Generator for DSP User Guide www.xilinx.com 263
UG640 (v 12.2) July 23, 2010
Frame-Based Acceleration using Hardware Co-Simulation
17. Open macfir_hw_w_frames_tb.mdl from the MATLAB console.
This design is a very similar to the previous design, with a few modifications made to
support the Shared Memory Read and Write blocks. Before simulating the design, you
consider each of these modifications. Most importantly, Shared Memory Read and Write
blocks have been substituted in place of the To and From FIFO testbench blocks in the
previous design. By specifying CA and VA as the Write and Read shared memory names,
respectively, an association is automatically made to the input and output FIFO buffers in
the FPGA hardware during simulation.
A Simulink Buffer block builds a frame of scalar input samples by sequentially buffering
the unfiltered input data. A simple analogy is that the Buffer block is performing a serial to
parallel conversion. Recalling that you compiled the FIFO buffers with a depth of 4K, you
choose a frame size of 4095.
Note that the buffer block introduces a sample rate change in the design. For every 4095
inputs, there is only one output. Thus if the data input sample period is 1, the buffer data
output sample period is 4095. This means that the Shared Memory Write block need only
send a new frame of data to the FPGA on every 4095th simulation cycle (which is
considerably more efficient than initiating a hardware transaction during every simulation
cycle).
Because the Buffer block introduces a rate change, you must adjust the downstream blocks
to accommodate the slower sample period. You begin by telling the Shared Memory Read
block to read a frame of data every 4095th simulation cycle.
18. Double-click on the Shared Memory Read block to open its parameters dialog box.
On the Type field under the Basic tab, you have configured the block to use shared FIFOs.
To ensure a new frame is read at the appropriate time, you configure the Shared Memory
Read block with a Sample time value of 4095.
The Shared Memory Read block allows you to specify the output data type and
dimensions.