User guide

246 www.xilinx.com System Generator for DSP User Guide
UG640 (v 12.2) July 23, 2010
Chapter 3: Using Hardware Co-Simulation
When software shared memory objects read or write data to the shared memory, a proxy
seamlessly handles communication with the hardware memory resource.
The following figure shows an example of unprotected shared memory implemented in
the FPGA that is communicating with three shared memory objects running on the host
PC. In this example, the software shared memory objects access the hardware shared
memory by specifying the same shared memory name, my_mem. From the perspective of
the software shared memories, the implementation of the shared memory resource is
irrelevant; the hardware shared memory is treated as any another shared memory object.
Read and writes to the shared memory are handled by the shared memory API.
Note:
Not all shared memory objects need to be created or executed in the Simulink environment.
The C++ application in the figure below is just one example of an external application that may
communicate with the hardware shared memory data using the shared memory API.
Co-Simulating Lockable Shared Memories
In lockable access mode, the System Generator co-simulation hardware must acquire lock
over the shared memory object before it may access its contents. When the hardware
acquires (releases) lock of the shared memory, the memory contents are transferred to
(from) the FPGA using a high-speed data transfer. Using this methodology, it is possible to
implement System Generator hardware co-simulation designs with high memory
bandwidth requirements. For more information on how to do this, refer to the tutorial
entitled Real-Time Signal Processing using Hardware Co-Simulation.
Unlike unprotected shared memories, two images of the shared memory data are used
when a lockable shared memory is co-simulated. One memory image is stored using dual
port memory in the FPGA. This image is accessed by the System Generator hardware co-
simulation design and co-simulation interfacing logic. The other image is implemented as
a shared memory object on the host PC. This software shared memory image is accessed by
any software shared memory objects used in a design.
In lockable mode, a software process or hardware circuit that wishes to access the shared
memory must first obtain the lock. If the hardware has lock of the memory, no software
objects may access the memory contents. Likewise, if a software object controls the
memory, the hardware cannot read or write to the memory. Note that lockable hardware