Using MATLAB generated models in SystemVerilog testbenches

Hi
Session 20 of the course ‘UVMF, One Bite at a Time’ discusses a technique for reusing both a MATLAB stimulus block and a MATLAB design block in a UVM testbench. Reusing a MATLAB design block in a UVM testbench is really amazing and I’m so excited to learn about it. I think reusing a MATLAB design block is a sufficient alternative for developing a high level model for the design in SystemVerilog. But I have a question about versatility of reusing a MATLAB stimulus block in a UVM testbench. I think such a block can not be used as a substitute for a UVM sequence, in which all the required fields can be randomized with desired constraints. It is not possible to model this constrained randomization in a MATLAB generated stimulus block. It is also not possible to use the factory to override a MATLAB generated stimulus block. As far as I understand, such a block is more useful to directed testing, rather than constrained random testing.
Please correct me if I am mistaken. I think reusing a MATLAB design block in a UVM testbench can be continued throughout the life of the testbench. But reusing a MATLAB stimulus block is more suitable for the initial phases of testbench development, where some directed testing and sanity checks maybe desirable.
This is my understanding, but I’m not sure if I’m getting things right. I would warmly appreciate some guidance here.
Thank you

In reply to Farhad:

Hi Farhad,

  Your statement, "I think reusing a MATLAB design block in a UVM testbench can be continued throughout the life of the testbench. But reusing a MATLAB stimulus block is more suitable for the initial phases of testbench development, where some directed testing and sanity checks maybe desirable." is exactly right.  Generally, the only purpose of the stimulus DPI-C from MATLAB is to provide a sanity check of the block level test bench that uses the prediction DPI-C from MATLAB.  The block level test bench can then be used in higher level simulations with confidence.  In some cases the stimulus DPI-C can be reused in higher level sims if the same data is driven on inputs in those higher level simulations.  The data from the stimulus DPI-C may be interleaved with other data, etc.  That interleaving or other required manipulations of the data from the DPI-C routine would have to be performed by the user.   The DPI-C just provides the a series of valid stimulus values.  

Thank you,
Bob