rules_verilog 1.2.0Latest published 1h ago
MODULE.bazel
bazel_dep(name = "rules_verilog", version = "1.2.0")
README

rules_verilog

BCR CI

The primary goal of rules_verilog is to provide only the most foundational verilog/systemverilog interfaces (e.g., verilog_library).

[!TIP]

How this is different from https://github.com/hdl/bazel_rules_hdl? Why your repository basically only has one rule and a couple of providers?

Please check https://github.com/bazelbuild/bazel-central-registry/pull/7852 and https://github.com/MrAMS/bazel_rules_verilog/issues/1 for more details

What This Module Does

verilog_library collects:

  • srcs (.v, .sv) — Verilog/SystemVerilog source files
  • hdrs (.vh, .svh) — Verilog/SystemVerilog header files
  • includes — include search paths (auto-derived from hdrs locations + explicit paths)
  • data — data files needed during compilation or simulation
  • deps — other verilog_library targets
  • top_module — the local top module of this library (optional; empty string means "unspecified")
  • standard — Verilog/SystemVerilog standard version (optional; empty string means "unspecified")

and propagates a transitive VerilogInfo provider that downstream rules can consume, like rules_verilator and rules_vivado.

Installation (Bzlmod)

Add to MODULE.bazel:

bazel_dep(name = "rules_verilog", version = "1.2.0")

Usage

load("@rules_verilog//verilog:defs.bzl", "verilog_library")

verilog_library(
    name = "core",
    srcs = ["core.sv"],
    hdrs = ["core_defines.svh"],
    standard = "2012",
)

verilog_library(
    name = "bus_headers",
    hdrs = ["axi_params.svh"],
    includes = ["include/bus"], # Explicitly add to include search paths
)

verilog_library(
    name = "soc",
    srcs = ["soc_top.sv"],
    deps = [
        ":core",
        ":bus_headers",
    ],
    data = ["rom_init.hex"], # Data files needed for simulation/compilation
    top_module = "soc_top",  # Specifies the local top module name of soc for downstream rules
)

VerilogInfo is exported from @rules_verilog//verilog:defs.bzl for custom rule authors.

Development

Run all checks locally:

bazel test //...

License

Apache-2.0.

About

Provide foundational verilog/sv interfaces for Bazel rulesets (e.g., verilog_library).

@hw-bzl/bazel_rules_verilog@hw-bzl
Homepage
4stars
9:02 PM (1 hour ago)
@hw-bzl-bot#9256 rules_verilog@1.2.0 (#9256)

Languages

Python20.4%
SystemVerilog1.1%

Maintainers

@MrAMS
@UebelAndre

Compatibility

Versions

1.2.0 +2.5mo2026-06-12
1.1.1 +19h50% 72026-03-29
1.1.0 +5d36% 52026-03-28
1.0.0 +12d7% 12026-03-23
0.1.07% 12026-03-10