diff --git a/recipes/verilator/all/conandata.yml b/recipes/verilator/all/conandata.yml index 22a24b588992b..9ef5c43415a04 100644 --- a/recipes/verilator/all/conandata.yml +++ b/recipes/verilator/all/conandata.yml @@ -1,8 +1,18 @@ sources: + "4.038": + url: "https://www.veripool.org/ftp/verilator-4.038.tgz" + sha256: "fa004493216034ac3e26b21b814441bd5801592f4f269c5a4672e3351d73b515" "4.034": url: "https://www.veripool.org/ftp/verilator-4.034.tgz" sha256: "54ed7b06ee28b5d21f9d0ee98406d29a508e6124b0d10e54bb32081613ddb80b" patches: + "4.038": + - patch_file: "patches/0001-split-opt-and-debug-build-install.patch" + base_path: "source_subfolder" + - patch_file: "patches/0004-msvc-patches.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-add-msvc_link-sh.patch" + base_path: "source_subfolder" "4.034": - patch_file: "patches/0001-split-opt-and-debug-build-install.patch" base_path: "source_subfolder" diff --git a/recipes/verilator/all/conanfile.py b/recipes/verilator/all/conanfile.py index d0891706716f4..355a8574b7b7a 100644 --- a/recipes/verilator/all/conanfile.py +++ b/recipes/verilator/all/conanfile.py @@ -167,10 +167,6 @@ def package_id(self): del self.info.settings.compiler.version def package_info(self): - verilator_include_root = os.path.join(self.package_folder, "share", "verilator", "include") - - self.cpp_info.includedirs = [verilator_include_root] - bindir = os.path.join(self.package_folder, "bin") self.output.info("Appending PATH environment variable: {}".format(bindir)) self.env_info.PATH.append(bindir) diff --git a/recipes/verilator/all/patches/0004-msvc-patches.patch b/recipes/verilator/all/patches/0004-msvc-patches.patch new file mode 100644 index 0000000000000..a6c6779c415bb --- /dev/null +++ b/recipes/verilator/all/patches/0004-msvc-patches.patch @@ -0,0 +1,88 @@ +--- src/Makefile_obj.in ++++ src/Makefile_obj.in +@@ -95,6 +95,7 @@ LIBS = $(CFG_LIBS) -lm + CPPFLAGS += -MMD + CPPFLAGS += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir) -I../../include + CPPFLAGS += -DYYDEBUG # Required to get nice error messages ++CPPFLAGS += -DNOMINMAX # suppress the min and max definitions in Windef.h + #CPPFLAGS += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool + CPPFLAGS += $(COPT) + CPPFLAGS += -MP # Only works on recent GCC versions +@@ -278,7 +279,7 @@ V3__CONCAT.cpp: $(addsuffix .cpp, $(basename $(RAW_OBJS))) + + $(TGT): $(PREDEP_H) $(OBJS) + @echo " Linking $@..." +- ${LINK} ${LDFLAGS} -o $@ $(OBJS) $(CCMALLOC) ${LIBS} ++ ${LINK} ${LDFLAGS} -o $@$(EXEEXT) $(OBJS) $(CCMALLOC) ${LIBS} + + V3Number_test: V3Number_test.o + ${LINK} ${LDFLAGS} -o $@ $^ ${LIBS} + +--- src/V3Number.h ++++ melsrc/V3Number.h +@@ -22,6 +22,7 @@ + + #include "V3Error.h" + ++#include + #include + #include + #include + +--- src/V3Os.cpp ++++ src/V3Os.cpp +@@ -63,8 +63,8 @@ string V3Os::getenvStr(const string& envvar, const string& defaultValue) { + #if defined(_MSC_VER) + // Note: MinGW does not offer _dupenv_s + char* envvalue = nullptr; +- _dupenv_s(&envvalue, nullptr, envvar.c_str()); +- if (envvalue != nullptr) { ++ int dupres = _dupenv_s(&envvalue, nullptr, envvar.c_str()); ++ if ((dupres == 0) && (envvalue != nullptr)) { + const std::string result{envvalue}; + free(envvalue); + return result; +@@ -336,6 +336,9 @@ void V3Os::u_sleep(int64_t usec) { + int V3Os::system(const string& command) { + UINFO(1, "Running system: " << command << endl); + const int ret = ::system(command.c_str()); ++#ifdef _MSC_VER ++ return ret; ++#else + if (VL_UNCOVERABLE(ret == -1)) { + v3fatal("Failed to execute command:" // LCOV_EXCL_LINE + << command << " " << strerror(errno)); +@@ -347,4 +350,5 @@ int V3Os::system(const string& command) { + UASSERT(exit_code >= 0, "exit code must not be negative"); + return exit_code; + } ++#endif + } + +--- src/VlcTop.cpp ++++ src/VlcTop.cpp +@@ -14,6 +14,11 @@ + // + //************************************************************************* + ++#if defined(_WIN32) || defined(__MINGW32__) ++#define NOMINMAX ++#include ++#endif ++ + #include "V3Error.h" + #include "V3Os.h" + #include "VlcOptions.h" + +--- include/verilated_imp.h ++++ include/verilated_imp.h +@@ -29,6 +29,7 @@ + #include "verilated_heavy.h" + #include "verilated_syms.h" + ++#include + #include + #include + #include + + diff --git a/recipes/verilator/config.yml b/recipes/verilator/config.yml index 24d2d01ce4cb9..dde09d68ec126 100644 --- a/recipes/verilator/config.yml +++ b/recipes/verilator/config.yml @@ -1,3 +1,5 @@ versions: "4.034": folder: all + "4.038": + folder: all