Hi,
fatal error comes in simulation when I tried .cpp file for DPI example,while same example successfully run with .c extension instead of .cpp
Here is the example I have tried in my Questasim 10.2a::
//----------------System Verilog File: abc.sv------------------------//
program main;
import “DPI-C” function void display();
initial
display();
endprogram
//-----------------------CPP File: xyz.cpp-------------------------//
#include “stdio.h”
#include “svdpi.h”
void display()
printf(“This is CPP Function”);
//------------------Compilation steps---------------------------//
vlog abc.sv xyz.cpp
vopt +acc main -o temp
vsim temp
//===================================================================
//========================Simulation Result==========================
Warning: Failed to find user defined “display” in C/C++ source files.
Fatal error:(abc.sv)Null foreign function pointer encountered when calling “display”
How to solve this error?