Matlab crashing when invoking matlab code via a shared object from UVM testbench.
조회 수: 2 (최근 30일)
이전 댓글 표시
I am trying to integrate a matlab model in my UVM Testbench, for checker (scoreboard) purposes.
- For this purpose I have compiled the matlab model in library compiler using C++ shared library and that created a shared object and a header file. No matter what's the content of the matlab code, there is no error at this stage, except for compilation errors.
- Now I've coded a cpp function which calls the matlab model (whose definition is availabel in the .h and .so files of library compiler output). I have added this cpp function/file in the dut & testbench compilation and have also provided the necessary paths for compilation.
- I am importing this cpp function into my scoreaboard as DPI-C import and calling it in the report phase of my UVM scoreboard.
Now matlab is crashing when it's getting invoked from scorebaord, when I run a testcase in my UVM Testbench. The crash dump is saying
- Fault Count: 1
- Abnormal termination:
- Segmentation violation
- Current Thread: 'MCR 0 interpret' id 46919396607744
- Register State (from fault): <few lines>
- Stack trace (from fault) : <few lines>
This crash is happening if the matlab code has constructs like
- double(bitget())
- double(bitsliceget())
- boolean(bitget());
If I comment those lines, there is no crash. Is it possible that C++ shared library doens't support all matlab constructs? Is there any way around or am I missing anything? Any help is immensely appreciated.
Thanks,
Satya.
댓글 수: 1
Oded
2025년 6월 25일
Did you find a solution? I have very similar issue when trying to use Matlab from my UVM env using DPI and c++
Sometimes I get 'Segmentation violation' when caling the fucnation named mclmcrInitialize();
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!