Interfacing to Hardware from M-Code - 2020.2 English

Vivado Design Suite Reference Guide: Model-Based DSP Design Using System Generator (UG958)

Document ID
Release Date
2020.2 English

When a model has been compiled for hardware co-simulation, the generated bitstream can be used in both a model-based Simulink flow, or in M-code executed in MATLAB. The general sequence of operations to access a bitstream in hardware typically follows the sequence described below.

  1. Configure the hardware co-simulation interface. Note that the hardware co-simulation configuration is persistent and is saved in the hwc file. If the co-simulation interface is not changed, there is no need to re-run this step.
  2. Create a M-Hwcosim instance for a particular design.
  3. Open the M-Hwcosim interface.
  4. Repeatedly run the following sub-steps until the simulation ends.
  5. Write simulation data to input ports.
  6. Read simulation data from output ports.
  7. Advance the design clock by one cycle.
  8. Close the M-Hwcosim interface.
  9. Release the M-Hwcosim instance.