Index | Thread | Search

From:
Benoit Lecocq <blq@arcane-labs.net>
Subject:
Re: verilator 5.044
To:
Chris Cappuccio <chris@nmedia.net>, <ports@openbsd.org>
Date:
Fri, 13 Feb 2026 11:26:39 +0100

Download raw body.

Thread

Le 13/02/2026 à 11:02, Stuart Henderson a écrit :
> On 2026/02/12 19:53, Chris Cappuccio wrote:
>> i need a newer verilator.
>>
>> does this look ok?
>>
>> 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	13 Feb 2026 03:52:09 -0000
>> @@ -1,16 +1,16 @@
>>   COMMENT=	very fast free Verilog HDL simulator
>>   
>> -DISTNAME =	verilator-3.912
>> +V =		5.044
>> +DISTNAME =	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
>> +SITES=			https://github.com/verilator/verilator/archive/refs/tags/
>> +DISTFILES=		v${V}.tar.gz
> 
> if there's a github /archive/.../tags/ URL, use
> 
> GH_ACCOUNT
> GH_PROJECT
> GH_TAGNAME
> 
> instead of SITES/DISTNAME

And add devel/help2man to BUILD_DEPENDS

>>   WANTLIB=		c m ${COMPILER_LIBCXX}
>>   
>> @@ -18,13 +18,28 @@ COMPILER =		base-clang ports-gcc base-gc
>>   
>>   BUILD_DEPENDS +=	devel/bison
>>   
>> -CONFIGURE_STYLE=	gnu
>>   MAKE_FLAGS=		VERILATOR_ROOT=${PREFIX}/share/verilator/ \
>>   			COPT="${CFLAGS}"
>>   
>> +AUTOCONF_VERSION =	2.72
>> +AUTOMAKE_VERSION =	1.17
>> +CONFIGURE_STYLE =	gnu
> 
> you want CONFIGURE_STYLE=autoreconf here, drop AUTO*_VERSION from MAKE_ENV,
> drop pre-configure
> 
>> +MAKE_ENV +=		AUTOCONF_VERSION=${AUTOCONF_VERSION} \
>> +			AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
>> +			YACC="${LOCALBASE}/bin/bison" \
>> +			LEX="${LOCALBASE}/bin/flex"
> 
> YACX/LEX probably not needed in MAKE_ENV (+ LEX points to a file which
> doesn't exist so thatbcan't be doing anything at all)
> 
>> +
>> +CONFIGURE_STYLE =	gnu
>> +CONFIGURE_ENV +=	YACC="${LOCALBASE}/bin/bison" \
>> +			LEX="${LOCALBASE}/bin/flex"
>> +
>>   USE_GMAKE=		Yes
>>   
>>   TEST_TARGET=		test
>>   TEST_FLAGS=		VERILATOR_ROOT=${WRKSRC}
>> +
>> +pre-configure:
>> +	cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-${AUTOCONF_VERSION}
>>   
>>   .include <bsd.port.mk>
>> 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	13 Feb 2026 03:52:09 -0000
>> @@ -1,2 +1,2 @@
>> -SHA256 (verilator-3.912.tgz) = J8ShF0GVu9c8eWWwGNgySMueeAMk+UBmsF5yVTVI0GQ=
>> -SIZE (verilator-3.912.tgz) = 2052609
>> +SHA256 (v5.044.tar.gz) = 3tKkqW47g23cn9XQESeZnZga3uTRkTP/gZtxKYl9gBo=
>> +SIZE (v5.044.tar.gz) = 5474674
> 
> will be fixed by the GH_* mentioned above, but v<numbers> isn't a
> suitable filename in a dir of ~12k files on bulk build machines, too
> high a risk of conflicts
> 
>> 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	13 Feb 2026 03:52:09 -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/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/bin/verilator_profcfunc
>>   share/verilator/examples/
> 
> not new, but that could probably do with moving to the standard dir
> 
> post-install:
> 	mv ${PREFIX}/share/verilator/examples ${PREFIX}/share/examples/verilator
> 
>> -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/examples/cmake_hello_c/
>> +share/verilator/examples/cmake_hello_c/CMakeLists.txt
>> +share/verilator/examples/cmake_hello_c/Makefile
>> +share/verilator/examples/cmake_hello_sc/
>> +share/verilator/examples/cmake_hello_sc/CMakeLists.txt
>> +share/verilator/examples/cmake_hello_sc/Makefile
>> +share/verilator/examples/cmake_protect_lib/
>> +share/verilator/examples/cmake_protect_lib/CMakeLists.txt
>> +share/verilator/examples/cmake_protect_lib/Makefile
>> +share/verilator/examples/cmake_tracing_c/
>> +share/verilator/examples/cmake_tracing_c/CMakeLists.txt
>> +share/verilator/examples/cmake_tracing_c/Makefile
>> +share/verilator/examples/cmake_tracing_sc/
>> +share/verilator/examples/cmake_tracing_sc/CMakeLists.txt
>> +share/verilator/examples/cmake_tracing_sc/Makefile
>> +share/verilator/examples/json_py/
>> +share/verilator/examples/json_py/Makefile
>> +share/verilator/examples/json_py/sub.v
>> +share/verilator/examples/json_py/top.v
>> +share/verilator/examples/json_py/vl_file_copy
>> +share/verilator/examples/json_py/vl_hier_graph
>> +share/verilator/examples/make_hello_binary/
>> +share/verilator/examples/make_hello_binary/Makefile
>> +share/verilator/examples/make_hello_binary/top.v
>> +share/verilator/examples/make_hello_c/
>> +share/verilator/examples/make_hello_c/Makefile
>> +share/verilator/examples/make_hello_c/sim_main.cpp
>> +share/verilator/examples/make_hello_c/top.v
>> +share/verilator/examples/make_hello_sc/
>> +share/verilator/examples/make_hello_sc/Makefile
>> +share/verilator/examples/make_hello_sc/sc_main.cpp
>> +share/verilator/examples/make_hello_sc/top.v
>> +share/verilator/examples/make_protect_lib/
>> +share/verilator/examples/make_protect_lib/Makefile
>> +share/verilator/examples/make_protect_lib/secret_impl.v
>> +share/verilator/examples/make_protect_lib/sim_main.cpp
>> +share/verilator/examples/make_protect_lib/top.v
>> +share/verilator/examples/make_tracing_c/
>> +share/verilator/examples/make_tracing_c/Makefile
>> +share/verilator/examples/make_tracing_c/Makefile_obj
>> +share/verilator/examples/make_tracing_c/input.vc
>> +share/verilator/examples/make_tracing_c/sim_main.cpp
>> +share/verilator/examples/make_tracing_c/sub.v
>> +share/verilator/examples/make_tracing_c/top.v
>> +share/verilator/examples/make_tracing_sc/
>> +share/verilator/examples/make_tracing_sc/Makefile
>> +share/verilator/examples/make_tracing_sc/Makefile_obj
>> +share/verilator/examples/make_tracing_sc/input.vc
>> +share/verilator/examples/make_tracing_sc/sc_main.cpp
>> +share/verilator/examples/make_tracing_sc/sub.v
>> +share/verilator/examples/make_tracing_sc/top.v
>>   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
>>
>