Skip to content

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

Merged
mikesinouye merged 9 commits into
hdl:mainfrom
antmicro:develop-upstream-foss
Oct 9, 2026
Merged

mikesinouye merged 9 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

@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)

@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?

@mczyz-antmicro

Copy link
Copy Markdown
Contributor Author

@mikesinouye I'd be happy to provide a newer image - older one uses Ubuntu20.04 so to break the least number of things, it could be Ubuntu24.04. Internally we also use modern Debian images. Let me know how to proceed - I'm not sure about the process of updating the image in case of the private build (gcbrun).

@mikesinouye

Copy link
Copy Markdown
Collaborator

If you update the cloudbuild.yaml, I can trigger CI for you - there may be a new image available with a bumped Ubuntu release at gcr.io/cloud-builders/bazel:8.3.1 ?

@mczyz-antmicro

Copy link
Copy Markdown
Contributor Author

@mikesinouye Bumped to gcr.io/bazel-public/bazel:8.5.0

@mikesinouye

Copy link
Copy Markdown
Collaborator

/gcbrun

@mikesinouye

Copy link
Copy Markdown
Collaborator

Hmm, I'm seeing this error:

Status: Downloaded newer image for gcr.io/bazel-public/bazel:8.5.0
gcr.io/bazel-public/bazel:8.5.0
Reading package lists...
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/

@mczyz-antmicro

mczyz-antmicro commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor Author

To create a local reproduction I had to modify the cloudbuild to remove the secrets.

Local reproduction:

cloud-build-local --config=cloudbuild.yaml --dryrun=false  .

cloudbuild.yaml:


steps:

- name: marketplace.gcr.io/google/ubuntu2204 # Ubuntu 22.04
  entrypoint: 'bash'
  args:
  - '-c'
  - |
    set -e
    export DEBIAN_FRONTEND=noninteractive
    apt-get update
    echo "DOING"
    apt-get install -y libtinfo5 clang libc6-dev curl git

    curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.29.0/bazelisk-linux-amd64
    echo "5a408715e932c0250d28bd84555f12edbf70117de42f9181691c736eacc4a992  /usr/local/bin/bazel" | sha256sum -c -
    chmod +x /usr/local/bin/bazel

    export USE_BAZEL_VERSION=8.5.0

    tools/test_everything.py
  timeout: 10800s

I figured that since the images provided by the bazel team are not running as root and I do not have insight into how the private runner is actually configured (to tinker with root configurations), we could just:

  • depend on standard gcr marketplace ubuntu 22.04
  • add installation of bazelisk to manage bazel (added git and curl as missing dependencies)

and that's what I added to the cloudbuild. Locally the build goes into the test_everything.py script and begins the actual build. Can I get another /gcbrun, @mikesinouye ?

@mikesinouye

Copy link
Copy Markdown
Collaborator

/gcbrun

@mikesinouye

Copy link
Copy Markdown
Collaborator

env change looks good, but there's a functional error now:

Step #1: [WARNING STA-0351] clock '*' not found.
Step #1: [ERROR STA-0307] -activity requires a clock to be defined
Step #1: Error: verilog_counter-sky130-sc_hd-ff-1v650_m40c-step2-place_and_route__global_routing_script.tcl, 21 STA-0307
Step #1: [WARNING STA-1171] bazel-out/k8-fastbuild/bin/external/+pdks_extension+com_google_skywater_pdk_sky130_fd_sc_hd/timing/sky130_fd_sc_hd__ss_n40C_1v35.lib line 24, default_fanout_load is 0.0.
Step #1: [WARNING STA-1140] bazel-out/k8-fastbuild/bin/external/+pdks_extension+com_google_skywater_pdk_sky130_fd_sc_hd/timing/sky130_fd_sc_hd__ss_n40C_1v35.lib line 1, library sky130_fd_sc_hd__ss_n40C_1v35 already exists.
Step #1: [WARNING STA-1171] bazel-out/k8-fastbuild/bin/external/+pdks_extension+com_google_skywater_pdk_sky130_fd_sc_hd/timing/sky130_fd_sc_hd__ss_n40C_1v35.lib line 24, default_fanout_load is 0.0.
Step #1: No paths found.
Step #1: wns max 0.00
Step #1: tns max 0.00
Step #1:  time 1ns
Step #1:  capacitance 1pF
Step #1:  resistance 1kohm
Step #1:  voltage 1v
Step #1:  current 1mA
Step #1:  power 1nW
Step #1:  distance 1um
Step #1: [WARNING STA-0351] clock '*' not found.
Step #1: [ERROR STA-0307] -activity requires a clock to be defined
Step #1: Error: verilog_counter-sky130-sc_hd-ss-1v350_m40c-step2-place_and_route__global_routing_script.tcl, 21 STA-0307
Step #1: INFO: Elapsed time: 2325.025s, Critical Path: 325.52s
Step #1: INFO: 18349 processes: 8 action cache hit, 98 remote cache hit, 6122 internal, 12129 linux-sandbox.
Step #1: ERROR: Build did NOT complete successfully
Step #1: INFO: Streaming build results to: https://app.buildbuddy.io/invocation/32679f88-9d85-11f1-af94-0242c0a80a02
Step #1: bazel build --build_metadata=USER=mczyz-antmicro     --config=ciremotebuild     --bes_results_url=https://app.buildbuddy.io/invocation/     --noshow_progress --invocation_id=32679f88-9d85-11f1-af94-0242c0a80a02 //... @at_clifford_yosys//... @com_google_skywater_pdk//... @com_google_skywater_pdk_sky130_fd_sc_ms//... @com_google_skywater_pdk_sky130_fd_sc_ls//... @com_google_skywater_pdk_sky130_fd_sc_lp//... @com_google_skywater_pdk_sky130_fd_sc_hvl//... @com_google_skywater_pdk_sky130_fd_sc_hs//... @com_google_skywater_pdk_sky130_fd_sc_hdll//... @com_google_skywater_pdk_sky130_fd_sc_hd//... @com_icarus_iverilog//... @org_theopenroadproject_asap7_pdk_r1p7//... @org_theopenroadproject_asap7sc6t_26//... @org_theopenroadproject_asap7sc7p5t_27//... @org_theopenroadproject_asap7sc7p5t_28//...
Finished Step #1
ERROR
ERROR: build step 1 "marketplace.gcr.io/google/ubuntu2204" failed: step exited with non-zero status: 1

are you able to repro? Possibly related to the openroad.bzl SDC change?

mikex-oss added a commit to mikex-oss/bazel_rules_hdl that referenced this pull request Aug 24, 2026
…d GLIBC not found errors in gperf compilation.
mikex-oss added a commit to mikex-oss/bazel_rules_hdl that referenced this pull request Aug 24, 2026
…d GLIBC not found errors in gperf compilation.
mikex-oss added a commit to mikex-oss/bazel_rules_hdl that referenced this pull request Aug 24, 2026
…d GLIBC not found errors in gperf compilation.
mikesinouye pushed a commit that referenced this pull request Aug 25, 2026
…#446)

* Upgrade LLVM toolchain version so it does not depend on libtinfo.so.5.

* Cherry pick CI container upgrade fix in #444 to address GLIBCXX and GLIBC not found errors in gperf compilation.
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>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
@mczyz-antmicro

mczyz-antmicro commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@mikesinouye:

  1. the SDC fail was related to our changes, fixed it in 5f8d1a4
  2. I opened another PR to include the changes to cloudbuild to make it easier for other developers to reproduce these issues locally Add local cloudbuild #448. With this setup I was able to run test_everything until completion and see all tests pass
  3. I rebased on top of latest main to include the cherry-picked changes to cloudbuild

@mikesinouye

Copy link
Copy Markdown
Collaborator

/gcbrun

@mczyz-antmicro
mczyz-antmicro marked this pull request as ready for review August 27, 2026 13:20
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
Signed-off-by: Michal Czyz <mczyz@antmicro.com>
@mikesinouye

Copy link
Copy Markdown
Collaborator

/gcbrun

@mikesinouye
mikesinouye merged commit 3998e10 into hdl:main Oct 9, 2026
4 checks passed
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