This block implements a ‘breakpoint with trigger count’; useful for breaking and single-stepping through Simulink simulations.
Input is a Boolean signal enabling a counter, which will count up to the parameterised count value, then pause the simulation.
You can then press 'play' to resume simulation from that point.
If the trigger count has not been increased, then the block will cause another pause. This is single stepping mode, and simulation will pause at the next cycle.
This can be useful for debugging designs. For example; run to breakpoint, turn ‘Show port values when hovering’ option on at this point (NB: having this option on permanently will cause slow simulation; so only turn on when stepping through).
Using display blocks, will enable you also to see variables displayed at the paused time: much like watch variables in a software debugger.
You can change the trigger count, say adding 100, to simulate the next 100 cycles.
The color changes to bright red when the pause feature is enabled.
Within DSP Builder Advanced designs the valid signal can be used as the input, so that it counts valid steps only.
Or a different control signal, such as a writeEnable, is used as input to get the system to break when then.
You can easily add other logic blocks to generate a break signal that is used just for debug.
Look under the mask to see the Simulink blocks used and how they are parameterized.