Interfacing to Hardware from M-Code - 2025.2 English - UG1483

Vitis Model Composer User Guide (UG1483)

Document ID
UG1483
Release Date
2025-11-20
Version
2025.2 English

After compiling a model for hardware co-simulation, you can use the generated bitstream in 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: The hardware co-simulation configuration is persistent and is saved in the hwc file. You do not need to run this step if the co-simulation interface is not changed.
  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.