Interfacing to Hardware from M-Code - 2024.1 English

Vitis Model Composer User Guide (UG1483)

Document ID
UG1483
Release Date
2024-05-30
Version
2024.1 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: 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.