Matlab crashing when invoking matlab code via a shared object from UVM testbench.

조회 수: 2 (최근 30일)
Satya Vardhan
Satya Vardhan 2022년 11월 4일
댓글: Oded 2025년 6월 25일
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
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 CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by