After compiling a model for hardware co-simulation, you can use the generated bitstream in a model-based Simulink flow. Alternatively, you can use the bitstream in M-code executed in MATLAB. The general sequence of operations to access a bitstream in hardware is as follows:
- Configure the hardware co-simulation interface. Note: The hardware co-simulation configuration is persistent and is saved in the
hwcfile. You do not need to run this step if the co-simulation interface did not change. - Create a M-Hwcosim instance for a particular design.
- Open the M-Hwcosim interface.
- Repeatedly run the following sub-steps until the simulation ends.
- Write simulation data to input ports.
- Read simulation data from output ports.
- Advance the design clock by one cycle.
- Close the M-Hwcosim interface.
- Release the M-Hwcosim instance.