| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → EDA Simulator Link |
| Contents | Index |
| Learn more about EDA Link Simulator |
| On this page… |
|---|
About Scheduling Options for Component Sessions |
There are two ways to schedule the invocation of a component function:
Using the scheduling arguments of the EDA Simulator Link function matlabcp
Inside the MATLAB M-function using the tnext parameter
You schedule a component session (matlabcp) the same way you schedule a test bench session (matlabtb.
The two types of scheduling are not mutually exclusive. The Oscfilter demo shows a component function that uses both the matlabcp timing arguments and the tnext parameter of an M-function to schedule component session callbacks.
You can find examples of both types of scheduling component sessions in the next sections:
For examples of scheduling test bench sessions, see Examples of Scheduling Options with matlabtband Example of Scheduling with tnext.
See Scheduling Test Bench Session Using matlabtb Arguments for instructions on scheduling test bench function calls using matlabtb and follow the same procedure for scheduling component sessions using matlabcp.
Call Back Function on Rising Edge. Call back function on the rising edge of signal clk1:
matlabtb top -rising clk1 -mfunc matlabt
Call Back Function on Falling Edge. Call back function on the falling edge of signal clk1:
matlabtb top -falling clk1 -mfunc matlabt
Call back function on the falling edge of signal Signal_1:
matlabtb top -falling Signal_1 -mfunc matlabt
Schedule Callbacks Using Explicit Times. Schedule callbacks on the following explicit times:
matlabtb top 15 16 17 Signal_1 -mfunc matlabt
Schedule callbacks on the following explicit times:
matlabtb top 10e6 fs 20e3 ps 21 ns Signal_1 -mfunc matlabt
Schedule callbacks on the following explicit times and repeat those times every 4ns:
matlabtb vlogtestbench_top 1e6 fs 3 2e3 ps -repeat 4 ns -mfunc matlabt
Schedule Callbacks on Signal State Change. Schedule callbacks sensitive to signal outclk1:
matlabtb vlogtestbench_top -sensitivity vlogtestbench_top.outclk1 -mfunc matlabt
See Scheduling Test Bench M-Functions Using the tnext Parameter for instructions on scheduling test function calls using the tnext parameter of an M-function and follow the same procedure for scheduling component sessions using tnext.
In the Oscillator demo, the oscfilter function calculates a time interval at which the HDL simulator calls the callbacks. The component function calculates this interval on the first call to oscfilter and stores the result in the variable fastestrate. The variable fastestrate represents the sample period of the fastest oversampling rate supported by the filter. The function derives this rate from a base sampling period of 80 ns.
The following assignment statement sets the timing parameter tnext. This parameter schedules the next callback to the MATLAB component function, relative to the current simulation time (tnow).
tnext = tnow + fastestrate;
The function returns a new value for tnext each time the HDL simulator calls the function.
See Defining EDA Simulator Link M-Functions and Function Parameters for more about tnext and tnow.
![]() | Invoke matlabcp to Bind MATLAB Component Function Calls | Run MATLAB Component Simulation | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |