Skip to content

Upstream updates to verilator, verilog, sdc, pli files - #444

Draft
mczyz-antmicro wants to merge 6 commits into
hdl:mainfrom
antmicro:develop-upstream-foss
Draft

Upstream updates to verilator, verilog, sdc, pli files#444
mczyz-antmicro wants to merge 6 commits into
hdl:mainfrom
antmicro:develop-upstream-foss

Conversation

@mczyz-antmicro

@mczyz-antmicro mczyz-antmicro commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR contains following updates to rules:

  • PLI
    • Added provider to be able to pass libraries to simulators
  • Verilog
    • Added rule to generate .f file from VerilogLibrary
    • Extended to also support PLI libraries
  • Synthesis, P&R
    • Updated handling of the SDC files to new provider SdcLibrary
  • Verilator
    • Bumped to 5.050 and added lz4 dependency (needed for new FST API)
    • Extended to generate and track coverage .dat files
    • Added common WaveformInfo provider for trace files (FSDB, VCD, VPD)
    • Added verilator_lint rule with tests and config_file handling

@PiotrZierhoffer

Copy link
Copy Markdown

/gcbrun

@mikesinouye

Copy link
Copy Markdown
Collaborator

Can you repro this locally?

ERROR: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/+tools_extension+at_clifford_yosys/BUILD.bazel:384:8: Compiling libs/ezsat/demo_vec.cc failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@+tools_extension+at_clifford_yosys//:ezsat_demo_vec) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh -U_FORTIFY_SOURCE '--target=x86_64-unknown-linux-gnu' -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 35 arguments skipped)
ERROR: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/+tools_extension+at_clifford_yosys/BUILD.bazel:452:11: Compiling libs/minisat/Solver.cc failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@+tools_extension+at_clifford_yosys//:minisat) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh -U_FORTIFY_SOURCE '--target=x86_64-unknown-linux-gnu' -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 28 arguments skipped)
ERROR: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/+tools_extension+at_clifford_yosys/BUILD.bazel:421:11: Compiling libs/ezsat/ezsat.cc failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@+tools_extension+at_clifford_yosys//:ezsat) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh -U_FORTIFY_SOURCE '--target=x86_64-unknown-linux-gnu' -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 28 arguments skipped)
ERROR: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/+tools_extension+com_icarus_iverilog/BUILD.bazel:739:11: Compiling vpi/sys_priv.c failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@+tools_extension+com_icarus_iverilog//:v2009_vpi_shared) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh -U_FORTIFY_SOURCE '--target=x86_64-unknown-linux-gnu' -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 30 arguments skipped)
ERROR: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/abseil-cpp+/absl/profiling/BUILD.bazel:72:11: Compiling absl/profiling/internal/exponential_biased.cc [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@abseil-cpp+//absl/profiling:exponential_biased) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh -U_FORTIFY_SOURCE '--target=x86_64-unknown-linux-gnu' -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 82 arguments skipped)
ERROR: /builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/+tools_extension+at_clifford_yosys/BUILD.bazel:441:11: Compiling libs/json11/json11.cpp failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@+tools_extension+at_clifford_yosys//:json11) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh -U_FORTIFY_SOURCE '--target=x86_64-unknown-linux-gnu' -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics ... (remaining 31 arguments skipped)
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 185.648s, Critical Path: 4.71s
INFO: 989 processes: 968 internal, 21 linux-sandbox.
ERROR: Build did NOT complete successfully

@mczyz-antmicro

mczyz-antmicro commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

BuildBuddy logs point to ezsat_demo_vec as the root cause, but unfortunately this target

bazel build @at_clifford_yosys//:ezsat_demo_vec

builds on my machine, so didn't manage to reproduce it yet

EDIT: another member of my team managed to reproduce it, looking into it

@mczyz-antmicro

Copy link
Copy Markdown
Contributor Author

Using NixOS we moved past the error reported in CI after including the headers to glibc (signal.h) in the host environment. Next we ran into an error, which is likely caused by the fact that nixpkgs do not provide libxml2 with so.2:

+tools_extension+at_clifford_yosys/libminisat.so failed: (Exit 1): cc_wrapper.sh failed: error executing CppLink command (from target @@+tools_extension+at_clifford_yosys//:minisat) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh @bazel-out/k8-fastbuild/bin/external/+tools_extension+at_clifford_yosys/libminisat.so-0.params

Since this nixos path is unlikely to occur in the private CI, I propose to check if the CI host has glibc-devel installed or provide logs with the --sandbox_debug flag.

@mikesinouye

Copy link
Copy Markdown
Collaborator

You can try installing what you need here: https://github.com/hdl/bazel_rules_hdl/blob/main/cloudbuild.yaml#L44

I'll retrigger CI

Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
@mczyz-antmicro
mczyz-antmicro force-pushed the develop-upstream-foss branch from 67ce9c5 to 1cf7f08 Compare July 29, 2026 19:51
@mczyz-antmicro

Copy link
Copy Markdown
Contributor Author

@mikesinouye I added libc6-dev, hopefully that's it

@mikesinouye

Copy link
Copy Markdown
Collaborator

/gcbrun

Comment thread common/providers.bzl Outdated
@@ -0,0 +1,31 @@
# Copyright 2024 Antmicro

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here and a few other files use Copyright 2024 Antmicro, can we use "# Copyright 2026 bazel_rules_hdl Authors" such as in vivado/BUILD

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, no problem

@mczyz-antmicro

Copy link
Copy Markdown
Contributor Author

Managed to reproduce the current error, root cause seems to be older GLIBC version - CI runs on 2.31 I believe. My localhost uses 2.36

external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang)
external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang)
external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang)
external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang)
external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by external/toolchains_llvm++llvm+llvm_toolchain/bin/../../toolchains_llvm++llvm+llvm_toolchain_llvm/bin/clang)

Signed-off-by: Michal Czyz <mczyz@antmicro.com>
@mikesinouye

Copy link
Copy Markdown
Collaborator

Hmm, we use an image with bazel here https://github.com/hdl/bazel_rules_hdl/blob/main/cloudbuild.yaml#L37

I wonder if there's a more modern image distro we can use with bazel instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants