Skip to content

Conversation

@Gallagator
Copy link
Contributor

@Gallagator Gallagator commented Sep 7, 2025

Verilator 5.034 fails to compile c++ sources as it uses syntax for c++17 while the CFLAGS passed to it specify c++14.

Testing

Before this patch I got the following error when testing my design with:

"UartTx should send" in {
  simulate(new UartTx(8, None, StopBitsOne())) { dut => {} }
}  
[info] g++ -Os  -I. -Wall -Wextra -Wfloat-conversion -Wlogical-op -Werror -MMD -I/usr/share/verilator/include -I/usr/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TIMING=0 -DVM_TRACE=0 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=0 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-shadow -Wno-sign-compare -Wno-subobject-linkage -Wno-tautological-compare -Wno-uninitialized -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable    -std=c++14 -I/home/lg/programming/chisel/chuart/build/chiselsim/UartSpec/UartTx-should-send/workdir-verilator -DSVSIM_ENABLE_VERILATOR_SUPPORT   -c -o VsvsimTestbench__ALL.o VsvsimTestbench__ALL.cpp
[info] simulation-driver.cpp: In function ‘int simulation_final()’:
[info] simulation-driver.cpp:877:9: error: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Werror=c++17-extensions]
[info]   877 |   auto &[command, cycles] = state.outstandingCommand;

After this patch, the test succeeds.

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Bugfix

Desired Merge Strategy

  • Rebase: You will rebase the PR onto master and it will be merged with a merge commit.

Release Notes

Verilator CFLAGS bumped from c++14 to c++17

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.6.x, 5.x, or 6.x depending on impact, API modification or big change: 7.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash) and clean up the commit message.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 7, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Gallagator / name: Liam Gallagher (cb5a766)

@Gallagator Gallagator force-pushed the verilatorUpdateCflags branch from cebe9cd to 95e5a85 Compare September 7, 2025 11:10
@Gallagator
Copy link
Contributor Author

Gallagator commented Sep 7, 2025

Force push fixes typo in commit message. Subsequent force push also rebases onto main. Sorry for the clutter here

Verilator 5.034 fails to compile c++ sources as it uses syntax for
c++17 while the CFLAGS passed to it specify c++14.
@Gallagator Gallagator force-pushed the verilatorUpdateCflags branch from 95e5a85 to cb5a766 Compare September 7, 2025 11:15
@seldridge seldridge added the Bugfix Fixes a bug, will be included in release notes label Sep 7, 2025
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jackkoenig jackkoenig merged commit 54844c3 into chipsalliance:main Sep 7, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix Fixes a bug, will be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants