diff --git a/Makefile.in b/Makefile.in index 3db334b50..304d3f003 100644 --- a/Makefile.in +++ b/Makefile.in @@ -113,6 +113,7 @@ DISTFILES_INC = $(INFOS) .gitignore Artistic COPYING COPYING.LESSER \ include/*.[chv]* \ include/*.in \ include/.*ignore \ + include/vltstd/*.[chv]* \ .*attributes */.*attributes */*/.*attributes \ src/.*ignore src/*.in src/*.cpp src/*.[chly] src/astgen src/bisonpre src/*fix \ src/*.pl src/*.pod \ @@ -258,9 +259,10 @@ installman: $(VL_INST_MAN_FILES) done installdata: - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/include $(DESTDIR)$(pkgdatadir)/examples - cp -r include/* $(DESTDIR)$(pkgdatadir)/include - cp -r ${srcdir}/include/* $(DESTDIR)$(pkgdatadir)/include + $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(pkgdatadir)/include/vltstd $(DESTDIR)$(pkgdatadir)/examples + cp -r include/*.* $(DESTDIR)$(pkgdatadir)/include + cp -r ${srcdir}/include/*.* $(DESTDIR)$(pkgdatadir)/include + cp -r ${srcdir}/include/vltstd/*.* $(DESTDIR)$(pkgdatadir)/include/vltstd cp -r ${srcdir}/test_c $(DESTDIR)$(pkgdatadir)/examples cp -r ${srcdir}/test_sc $(DESTDIR)$(pkgdatadir)/examples cp -r ${srcdir}/test_sp $(DESTDIR)$(pkgdatadir)/examples diff --git a/bin/verilator b/bin/verilator index b0f3529e1..84362e84a 100755 --- a/bin/verilator +++ b/bin/verilator @@ -1286,6 +1286,17 @@ The /*verilator sformat*/ indicates that this function accepts a $display like format specifier followed by any number of arguments to satisfy the format. +=head2 DPI Header Isolation + +Verilator places the IEEE standard header files such as svdpi.h into a +separate include directory, vltstd (VeriLaTor STandarD). When compiling +most applications $VERILATOR_ROOT/include/vltstd would be in the include +path along with the normal $VERILATOR_ROOT/include. However, when +compiling Verilated models into other simulators which have their own +svdpi.h and similar standard files with different contents, the vltstd +directory should not be included to prevent picking up incompatible +definitions. + =head2 Public Functions Instead of DPI exporting, there's also Verilator public functions, which diff --git a/include/verilated.mk.in b/include/verilated.mk.in index 2d8dd2c19..1bd0f40be 100644 --- a/include/verilated.mk.in +++ b/include/verilated.mk.in @@ -26,6 +26,7 @@ SP_INCLUDER = $(PERL) $(VERILATOR_ROOT)/bin/verilator_includer VK_CPPFLAGS_ALWAYS += \ -MMD \ -I$(VERILATOR_ROOT)/include \ + -I$(VERILATOR_ROOT)/include/vltstd \ -DVL_PRINTF=printf \ -DVM_TRACE=$(VM_TRACE) \ -DVM_COVERAGE=$(VM_COVERAGE) \ @@ -44,6 +45,7 @@ CPPFLAGS += -I. $(VK_CPPFLAGS_ALWAYS) $(VK_CPPFLAGS_WALL) VPATH += .. VPATH += $(VERILATOR_ROOT)/include +VPATH += $(VERILATOR_ROOT)/include/vltstd #OPT = -ggdb -DPRINTINITSTR -DDETECTCHANGE #OPT = -ggdb -DPRINTINITSTR diff --git a/include/verilated_dpi.cpp b/include/verilated_dpi.cpp index 1d46a80dd..57c7b4912 100644 --- a/include/verilated_dpi.cpp +++ b/include/verilated_dpi.cpp @@ -32,7 +32,7 @@ #define XXTERN DPI_EXTERN DPI_DLLESPEC #define EETERN DPI_EXTERN DPI_DLLESPEC -#include "svdpi.h" +#include "vltstd/svdpi.h" //====================================================================== // Internal macros diff --git a/include/svdpi.h b/include/vltstd/svdpi.h similarity index 100% rename from include/svdpi.h rename to include/vltstd/svdpi.h