From: Chris Cappuccio Subject: Re: verilator 5.044 To: ports@openbsd.org Date: Fri, 13 Feb 2026 20:55:16 -0800 With Stuart's examples post-install correction Index: Makefile =================================================================== RCS file: /cvs/ports/lang/verilator/Makefile,v retrieving revision 1.20 diff -u -p -u -r1.20 Makefile --- Makefile 26 Sep 2023 12:02:04 -0000 1.20 +++ Makefile 14 Feb 2026 04:53:20 -0000 @@ -1,30 +1,45 @@ COMMENT= very fast free Verilog HDL simulator -DISTNAME = verilator-3.912 +V = 5.044 +PKGNAME = verilator-${V} + CATEGORIES= lang devel -REVISION = 3 HOMEPAGE= https://www.veripool.org/wiki/verilator/Intro # LGPLv3 or Perl PERMIT_PACKAGE= Yes -SITES= https://www.veripool.org/ftp/ -EXTRACT_SUFX= .tgz +GH_ACCOUNT = verilator +GH_PROJECT = verilator +GH_TAGNAME = v${V} WANTLIB= c m ${COMPILER_LIBCXX} COMPILER = base-clang ports-gcc base-gcc -BUILD_DEPENDS += devel/bison +BUILD_DEPENDS += devel/bison devel/help2man -CONFIGURE_STYLE= gnu +CONFIGURE_STYLE = gnu MAKE_FLAGS= VERILATOR_ROOT=${PREFIX}/share/verilator/ \ COPT="${CFLAGS}" +AUTOCONF_VERSION = 2.72 +AUTOMAKE_VERSION = 1.17 +MAKE_ENV += AUTOCONF_VERSION=${AUTOCONF_VERSION} \ + AUTOMAKE_VERSION=${AUTOMAKE_VERSION} + +CONFIGURE_ENV += YACC="${LOCALBASE}/bin/bison" + USE_GMAKE= Yes TEST_TARGET= test TEST_FLAGS= VERILATOR_ROOT=${WRKSRC} + +pre-configure: + cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-${AUTOCONF_VERSION} + +post-install: + mv ${PREFIX}/share/verilator/examples ${PREFIX}/share/examples/verilator .include Index: distinfo =================================================================== RCS file: /cvs/ports/lang/verilator/distinfo,v retrieving revision 1.7 diff -u -p -u -r1.7 distinfo --- distinfo 5 Oct 2017 08:58:51 -0000 1.7 +++ distinfo 14 Feb 2026 04:53:20 -0000 @@ -1,2 +1,2 @@ -SHA256 (verilator-3.912.tgz) = J8ShF0GVu9c8eWWwGNgySMueeAMk+UBmsF5yVTVI0GQ= -SIZE (verilator-3.912.tgz) = 2052609 +SHA256 (verilator-5.044.tar.gz) = 3tKkqW47g23cn9XQESeZnZga3uTRkTP/gZtxKYl9gBo= +SIZE (verilator-5.044.tar.gz) = 5474674 Index: patches/patch-include_verilatedos_h =================================================================== RCS file: patches/patch-include_verilatedos_h diff -N patches/patch-include_verilatedos_h --- patches/patch-include_verilatedos_h 11 Mar 2022 19:29:18 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,18 +0,0 @@ -__builtin_unreachable() available with gcc>=4.5 - -Index: include/verilatedos.h ---- include/verilatedos.h.orig -+++ include/verilatedos.h -@@ -46,7 +46,11 @@ - # define VL_FUNC __func__ - # define VL_LIKELY(x) __builtin_expect(!!(x), 1) - # define VL_UNLIKELY(x) __builtin_expect(!!(x), 0) --# define VL_UNREACHABLE __builtin_unreachable(); -+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || __GNUC__ > 4 || defined(__clang__) -+# define VL_UNREACHABLE __builtin_unreachable(); -+# else -+# define VL_UNREACHABLE ; -+# endif - # define VL_PREFETCH_RD(p) __builtin_prefetch((p),0) - # define VL_PREFETCH_RW(p) __builtin_prefetch((p),1) - #elif defined(_MSC_VER) Index: patches/patch-src_V3EmitCSyms_cpp =================================================================== RCS file: patches/patch-src_V3EmitCSyms_cpp diff -N patches/patch-src_V3EmitCSyms_cpp --- patches/patch-src_V3EmitCSyms_cpp 15 Nov 2023 19:44:31 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -Index: src/V3EmitCSyms.cpp ---- src/V3EmitCSyms.cpp.orig -+++ src/V3EmitCSyms.cpp -@@ -329,7 +329,7 @@ void EmitCSyms::emitSymHdr() { - { // Scope names - bool did = false; - for (ScopeNames::iterator it = m_scopeNames.begin(); it != m_scopeNames.end(); ++it) { -- if (!did++) puts("\n// SCOPE NAMES\n"); -+ if (!did) { did = true; puts("\n// SCOPE NAMES\n"); } - puts("VerilatedScope __Vscope_"+it->second.m_symName+";\n"); - } - } -@@ -432,7 +432,7 @@ void EmitCSyms::emitSymImp() { - { // Setup scope names - bool did = false; - for (ScopeNames::iterator it = m_scopeNames.begin(); it != m_scopeNames.end(); ++it) { -- if (!did++) puts("// Setup scope names\n"); -+ if (!did) { did = true; puts("// Setup scope names\n"); } - puts("__Vscope_"+it->second.m_symName+".configure(this,name(),"); - putsQuoted(it->second.m_prettyName); - puts(");\n"); Index: patches/patch-src_V3EmitC_cpp =================================================================== RCS file: patches/patch-src_V3EmitC_cpp diff -N patches/patch-src_V3EmitC_cpp --- patches/patch-src_V3EmitC_cpp 15 Nov 2023 19:44:31 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ -Index: src/V3EmitC.cpp ---- src/V3EmitC.cpp.orig -+++ src/V3EmitC.cpp -@@ -1904,7 +1904,8 @@ void EmitCImp::emitInt(AstNodeModule* modp) { - bool did = false; - for (AstNode* nodep=modp->stmtsp(); nodep; nodep = nodep->nextp()) { - if (AstCell* cellp=nodep->castCell()) { -- if (!did++) { -+ if (!did) { -+ did = true; - putsDecoration("// CELLS\n"); - if (modp->isTop()) puts("// Public to allow access to /*verilator_public*/ items;\n"); - if (modp->isTop()) puts("// otherwise the application code can consider these internals.\n"); Index: patches/patch-src_bisonpre =================================================================== RCS file: patches/patch-src_bisonpre diff -N patches/patch-src_bisonpre --- patches/patch-src_bisonpre 11 Mar 2022 19:29:18 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -Index: src/bisonpre ---- src/bisonpre.orig -+++ src/bisonpre -@@ -325,7 +325,7 @@ sub clean_input { - foreach my $line (@linesin) { - $l++; - if ($line =~ /BISONPRE_NOT/) { -- ($line =~ s/BISONPRE_NOT\((\S+)\)\s*({[^}]+})\s*$//) -+ ($line =~ s/BISONPRE_NOT\((\S+)\)\s*(\{[^}]+})\s*$//) - or die "%Error: $filename:$l: Bad form of BISONPRE_NOT: $line\n"; - my $endtok = $1; my $action = $2; - my @endtoks = split (/,/, $endtok); Index: patches/patch-src_verilog_y =================================================================== RCS file: patches/patch-src_verilog_y diff -N patches/patch-src_verilog_y --- patches/patch-src_verilog_y 11 Mar 2022 19:29:18 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,22 +0,0 @@ -Fix build with Bison 3.7 and newer -https://github.com/verilator/verilator/commit/aa39d020d88dd1d5beb3810cf551ff879b7f88a4 - -Index: src/verilog.y ---- src/verilog.y.orig -+++ src/verilog.y -@@ -207,6 +207,15 @@ static void ERRSVKWD(FileLine* fileline, const string& - class AstSenTree; - %} - -+// We run bison with the -d argument. This tells it to generate a -+// header file with token names. Old versions of bison pasted the -+// contents of that file into the generated source as well; newer -+// versions just include it. -+// -+// Since we run bison through ../bisonpre, it doesn't know the correct -+// header file name, so we need to tell it. -+BISONPRE_VERSION(3.7,%define api.header.include {"V3ParseBison.h"}) -+ - // When writing Bison patterns we use yTOKEN instead of "token", - // so Bison will error out on unknown "token"s. - Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/lang/verilator/pkg/PLIST,v retrieving revision 1.8 diff -u -p -u -r1.8 PLIST --- pkg/PLIST 11 Mar 2022 19:29:18 -0000 1.8 +++ pkg/PLIST 14 Feb 2026 04:53:20 -0000 @@ -3,28 +3,86 @@ bin/verilator @bin bin/verilator_bin_dbg bin/verilator_coverage @bin bin/verilator_coverage_bin_dbg +bin/verilator_gantt bin/verilator_profcfunc @man man/man1/verilator.1 @man man/man1/verilator_coverage.1 +@man man/man1/verilator_gantt.1 @man man/man1/verilator_profcfunc.1 +share/examples/verilator/ +share/examples/verilator/cmake_hello_c/ +share/examples/verilator/cmake_hello_c/CMakeLists.txt +share/examples/verilator/cmake_hello_c/Makefile +share/examples/verilator/cmake_hello_sc/ +share/examples/verilator/cmake_hello_sc/CMakeLists.txt +share/examples/verilator/cmake_hello_sc/Makefile +share/examples/verilator/cmake_protect_lib/ +share/examples/verilator/cmake_protect_lib/CMakeLists.txt +share/examples/verilator/cmake_protect_lib/Makefile +share/examples/verilator/cmake_tracing_c/ +share/examples/verilator/cmake_tracing_c/CMakeLists.txt +share/examples/verilator/cmake_tracing_c/Makefile +share/examples/verilator/cmake_tracing_sc/ +share/examples/verilator/cmake_tracing_sc/CMakeLists.txt +share/examples/verilator/cmake_tracing_sc/Makefile +share/examples/verilator/json_py/ +share/examples/verilator/json_py/Makefile +share/examples/verilator/json_py/sub.v +share/examples/verilator/json_py/top.v +share/examples/verilator/json_py/vl_file_copy +share/examples/verilator/json_py/vl_hier_graph +share/examples/verilator/make_hello_binary/ +share/examples/verilator/make_hello_binary/Makefile +share/examples/verilator/make_hello_binary/top.v +share/examples/verilator/make_hello_c/ +share/examples/verilator/make_hello_c/Makefile +share/examples/verilator/make_hello_c/sim_main.cpp +share/examples/verilator/make_hello_c/top.v +share/examples/verilator/make_hello_sc/ +share/examples/verilator/make_hello_sc/Makefile +share/examples/verilator/make_hello_sc/sc_main.cpp +share/examples/verilator/make_hello_sc/top.v +share/examples/verilator/make_protect_lib/ +share/examples/verilator/make_protect_lib/Makefile +share/examples/verilator/make_protect_lib/secret_impl.v +share/examples/verilator/make_protect_lib/sim_main.cpp +share/examples/verilator/make_protect_lib/top.v +share/examples/verilator/make_tracing_c/ +share/examples/verilator/make_tracing_c/Makefile +share/examples/verilator/make_tracing_c/Makefile_obj +share/examples/verilator/make_tracing_c/input.vc +share/examples/verilator/make_tracing_c/sim_main.cpp +share/examples/verilator/make_tracing_c/sub.v +share/examples/verilator/make_tracing_c/top.v +share/examples/verilator/make_tracing_sc/ +share/examples/verilator/make_tracing_sc/Makefile +share/examples/verilator/make_tracing_sc/Makefile_obj +share/examples/verilator/make_tracing_sc/input.vc +share/examples/verilator/make_tracing_sc/sc_main.cpp +share/examples/verilator/make_tracing_sc/sub.v +share/examples/verilator/make_tracing_sc/top.v share/pkgconfig/verilator.pc share/verilator/ share/verilator/bin/ +share/verilator/bin/verilator +share/verilator/bin/verilator_bin +share/verilator/bin/verilator_bin_dbg +share/verilator/bin/verilator_ccache_report +share/verilator/bin/verilator_coverage +share/verilator/bin/verilator_coverage_bin_dbg +share/verilator/bin/verilator_gantt share/verilator/bin/verilator_includer -share/verilator/examples/ -share/verilator/examples/test_c/ -share/verilator/examples/test_c/Makefile -share/verilator/examples/test_c/Makefile_obj -share/verilator/examples/test_c/sim_main.cpp -share/verilator/examples/test_sc/ -share/verilator/examples/test_sc/Makefile -share/verilator/examples/test_sc/Makefile_obj -share/verilator/examples/test_sc/sc_main.cpp -share/verilator/examples/test_v/ -share/verilator/examples/test_v/input.vc -share/verilator/examples/test_v/t.v -share/verilator/examples/test_v/top.v +share/verilator/bin/verilator_profcfunc share/verilator/include/ +share/verilator/include/gtkwave/ +share/verilator/include/gtkwave/fastlz.c +share/verilator/include/gtkwave/fastlz.h +share/verilator/include/gtkwave/fst_config.h +share/verilator/include/gtkwave/fst_win_unistd.h +share/verilator/include/gtkwave/fstapi.c +share/verilator/include/gtkwave/fstapi.h +share/verilator/include/gtkwave/lz4.c +share/verilator/include/gtkwave/lz4.h share/verilator/include/verilated.cpp share/verilator/include/verilated.h share/verilator/include/verilated.mk @@ -36,12 +94,36 @@ share/verilator/include/verilated_cov.h share/verilator/include/verilated_cov_key.h share/verilator/include/verilated_dpi.cpp share/verilator/include/verilated_dpi.h -share/verilator/include/verilated_heavy.h +share/verilator/include/verilated_fst_c.cpp +share/verilator/include/verilated_fst_c.h +share/verilator/include/verilated_fst_sc.cpp +share/verilator/include/verilated_fst_sc.h +share/verilator/include/verilated_funcs.h share/verilator/include/verilated_imp.h +share/verilator/include/verilated_intrinsics.h +share/verilator/include/verilated_probdist.cpp +share/verilator/include/verilated_profiler.cpp +share/verilator/include/verilated_profiler.h +share/verilator/include/verilated_random.cpp +share/verilator/include/verilated_random.h +share/verilator/include/verilated_saif_c.cpp +share/verilator/include/verilated_saif_c.h +share/verilator/include/verilated_saif_sc.h share/verilator/include/verilated_save.cpp share/verilator/include/verilated_save.h share/verilator/include/verilated_sc.h +share/verilator/include/verilated_sc_trace.h +share/verilator/include/verilated_std.sv +share/verilator/include/verilated_std_waiver.vlt +share/verilator/include/verilated_sym_props.h share/verilator/include/verilated_syms.h +share/verilator/include/verilated_threads.cpp +share/verilator/include/verilated_threads.h +share/verilator/include/verilated_timing.cpp +share/verilator/include/verilated_timing.h +share/verilator/include/verilated_trace.h +share/verilator/include/verilated_trace_imp.h +share/verilator/include/verilated_types.h share/verilator/include/verilated_vcd_c.cpp share/verilator/include/verilated_vcd_c.h share/verilator/include/verilated_vcd_sc.cpp @@ -50,6 +132,11 @@ share/verilator/include/verilated_vpi.cp share/verilator/include/verilated_vpi.h share/verilator/include/verilatedos.h @comment share/verilator/include/verilatedos.h.orig +share/verilator/include/verilatedos_c.h share/verilator/include/vltstd/ +share/verilator/include/vltstd/sv_vpi_user.h share/verilator/include/vltstd/svdpi.h +share/verilator/include/vltstd/veriuser.h share/verilator/include/vltstd/vpi_user.h +share/verilator/verilator-config-version.cmake +share/verilator/verilator-config.cmake