MATLAB DESIGN HDL CODER RELEASE NOTES User's Guide Page 276

  • Download
  • Add to my manuals
  • Print
  • Page
    / 410
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 275
276 www.xilinx.com System Generator for DSP User Guide
UG640 (v 12.2) July 23, 2010
Chapter 3: Using Hardware Co-Simulation
Reloading the Kernel
The filter data path is designed so that the filter kernel can be reloaded dynamically while
hardware co-simulation is running. Once the simulation is running, you may use the
xlReloadFilterCoef function to load a new kernel. The function accepts a string kernel
identifier (e.g., sobelxy) as an input parameter. A list of available filter kernels can be
viewed by typing help xlReloadFilterCoef in the MATLAB console. The function is
supplied as a MATLAB source file and can be found in the
$SYGEN/examples/shared_memory/hardware_cosim/conv5x5_video
directory.
Note:
Once you have reloaded the filter, you may choose to adjust the coefficient gain. The gain can
be adjusted using the Coefficient Adjust slider control at the top-level of the testbench model. This
also demonstrates how System Generator's traditional, port-based, hardware co-simulation
interfacing can be used in conjunction with the shared memory hardware co-simulation interfaces.
It is worthwhile to note that System Generator provides a MATLAB object interface to
shared memory objects. The xlReloadFilterCoef function uses this object interface to
write new coefficients into the unprotected shared memory named coef_buffer running in
the FPGA. The function is fully annotated with comments that explain how the shared
memory object is created, written to, and released when the operation is complete.
Note:
The source code for the MATLAB object interface is supplied with the System Generator
software installation, and can be found in the $SYGEN/examples/shared_memory/mex_function
directory. Also included in this directory is MATLAB M-code that demonstrates how the mex-function
source code was built.
14. After ensuring the testbench design is running, load the SobelXY filter kernel into the
FPGA by typing xlReloadFilterCoef('sobelxy') from the MATLAB command
window.
You will now see the video output generated using the SobelX-Y kernel.
Page view 275
1 2 ... 271 272 273 274 275 276 277 278 279 280 281 ... 409 410

Comments to this Manuals

No comments