Testbenches need to exchange data with other applications for reading stimulus from an algorithmic model, or to connect to a reference model for checking DUT responses. Specifically, many communications and storage devices require modulated stimulus to verify a signal processing hardware block whose job it is to demodulate the signal. Matlab or C models may be used to model such algorithms, and of course model whole systems.
To verify such models, Specman has a built-in, flexible C interface that is used to talk to C/C++ models or other applications that provide a C automation API. With this Specman C interface and a little bit of code, we have created a package that makes it easy for users to integrate Matlab models into a Metric Driven Verification environment written in the e language. This “sn_matlab” package has been used and improved by dozens of customers and Application Engineers since it was first written in 2001. The main capabilities of the package are:
* Use Specman to initialize and tear down the Matlab engine in batch mode
* Issue Matlab commands from e-code, use the Specman command prompt to load .m files, initialize variables, and other operational tasks.
* Transfer data to and from the Matlab engine to Specman / an e language test bench
* Compare data of previously retrieved Matlab arrays
* Access Matlab arrays from e-code without converting them to e list data structure
* Convert Matlab arrays into e-lists