Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e5bcd53
[bazel] Remove internal bazel repos from airgap list
jwnrt Oct 15, 2024
387cc08
[bazel] Enable bzlmod in hybrid mode
jwnrt Jul 16, 2024
f219c68
[bazel] Use `bazel vendor` in airgap prep
jwnrt Jun 11, 2025
137ec75
[bazel] Move `rules_rust` and Rust toolchain to bzlmod
jwnrt Dec 10, 2024
0bb033d
[bazel] Move Rust crates to bzlmod
jwnrt Dec 10, 2024
3b3d6d5
[bazel] Move Tock crates to bzlmod
jwnrt Dec 10, 2024
99b9a7e
[bazel] Move bindgen toolchain to bzlmod
jwnrt Dec 10, 2024
150f68b
[bazel] Remove old vendored Rust crate files
jwnrt Dec 17, 2024
1de8e99
[bazel] Remove temporarily bazelignore entries for now deleted files
jwnrt Dec 17, 2024
f3dcc54
[bazel] Add bzlmod support for `lowrisc_misc_linters`
jwnrt Dec 13, 2024
2915342
[bazel] Add bzlmod support for `rules_fuzzing`
jwnrt Dec 13, 2024
970bc8e
[bazel] Add bzlmod support for `rules_python`
jwnrt Dec 13, 2024
3b3c249
[bazel] Add bzlmod support for `rules_cc`
jwnrt Dec 14, 2024
d615141
[bazel] Remove python dependency from `bare_repository_rule`
pamaury Dec 16, 2024
e096874
[python] fold tockloader into top-level pyproject.toml
nbdd0121 Sep 17, 2024
ea72a6d
[bazel] Remove Python dependency vendoring mechanism
jwnrt Jun 6, 2025
d4c0c35
[bazel] Migrate `rules_python` and dependents to bzlmod
jwnrt Dec 13, 2024
e746542
[bazel] Move buildifier to bzlmod
jwnrt Dec 17, 2024
409b586
[bazel] Migrate Google dependencies to bzlmod
jwnrt Dec 17, 2024
ecc8ec1
[bazel] Remove unused lint repos
jwnrt Dec 19, 2024
fe88d7b
[bazel] Remove `rules_protobuf` dependency
jwnrt Dec 19, 2024
8f0b7fd
[bazel] Migrate source repositories to bzlmod
jwnrt Dec 17, 2024
33d1a26
[bazel] Move third party patch files into `patches` subdirectories
jwnrt Dec 19, 2024
a2303f4
[bazel] Remove `local` parameter from `bare_repository`
jwnrt Dec 19, 2024
e02d154
[bazel] Remove `http_archive_or_local` rule
jwnrt Jan 2, 2025
2184aeb
[bazel] Migrate manufacturer hooks to bzlmod
jwnrt Jan 3, 2025
9a20828
[bazel] Migrate nonhermetic repo to bzlmod
jwnrt Jan 3, 2025
7f8be40
[bazel] Migrate local toolchains to bzlmod
jwnrt Jan 3, 2025
a7cce64
[ci] Remove `//external` usage from banned rule script
jwnrt Jan 11, 2025
5b1622f
[doc] Add documentation for external dependencies
jwnrt Jan 10, 2025
8bffb49
[bazel] Enable `--legacy_external_runfiles` in `.bazelrc`
jwnrt Jul 9, 2025
efa82e9
[bazel] Update test constant locations
jwnrt Oct 18, 2024
431b854
[bazel] Update platform const locations
jwnrt Oct 18, 2024
a0e8312
[bazel] Move key consts and utils to opentitan rules
jwnrt Oct 18, 2024
a086f6f
[bazel] Fix constant exports
jwnrt Oct 18, 2024
86bb3c1
[bazel] Move `manual_test` to `//rules/opentitan`
jwnrt Oct 18, 2024
2627c21
[bazel] Move `obj_transform` rule to `cc.bzl`
jwnrt Oct 18, 2024
e49fde8
[bazel] Move `vmem_file` rules to `cc.bzl`
jwnrt Oct 18, 2024
63b93e1
[bazel] Move `scramble_flash_vmem` to `cc.bzl`
jwnrt Oct 18, 2024
938f453
[bazel] Remove unused loads of `elf_to_disassembly`
jwnrt Oct 18, 2024
86633e0
[bazel] Remove legacy opentitan_test.bzl
jwnrt Oct 18, 2024
0a5c99e
[bazel] Remove legacy `opentitan.bzl`
jwnrt Oct 18, 2024
cdc7058
[bazel] Import lowRISC toolchain repo directly
jwnrt Jan 8, 2025
9f502ad
[bazel] Change how tools are pulled from cc_toolchains
jwnrt Jan 8, 2025
75754dd
[bazel] Replace features with explicit flags in coremark lib
jwnrt Jan 9, 2025
227e2a7
[bazel] Add `cc_rules`-based lowRISC toolchain
jwnrt Jan 8, 2025
e994e6f
[bazel] Switch lowRISC toolchain from CRT to local version
jwnrt Jan 8, 2025
e9348f4
[doc] Add documentation for Bazel RISC-V toolchain
jwnrt Jan 8, 2025
8c9d314
[bazel] Use `MODULE.bazel` as repo root in rules
jwnrt Jan 10, 2025
66c442d
[bazel] Replace `bazel sync` with `bazel fetch`
jwnrt Jan 10, 2025
e8b8213
[bazel] Hotswap deprecated `sync` command in bazelisk.sh
jwnrt Jan 12, 2025
3e44694
[bazel] Remove `bazel fetch` from airgap preparation
jwnrt Jun 12, 2025
669d56e
[bazel] Remove empty WORKSPACE.bzlmod disabling hybrid mode
jwnrt Jan 10, 2025
a7f00ed
[bazel] Disable WORKSPACE system
jwnrt Jan 10, 2025
fe98bfe
[bazel] Resolve incompatible_disallow_empty_glob errors
jwnrt Feb 5, 2025
547797d
[bazel] Use `@python3//:python3` target in `sh_test`s
jwnrt Jun 17, 2025
f8345e8
[bazel] Bump Bazel version to 8.0.1
jwnrt Feb 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build
hw/ip/prim/util/vendor/google_verible_verilog_syntax_py
sw/vendor/google_googletest
util/lowrisc_misc-linters
bazel-airgapped
12 changes: 5 additions & 7 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

# Opt-out of bzlmod for now and continue to use `WORKSPACE`.
common --noenable_bzlmod
# Enable bzlmod with `MODULE.bazel` and disable the `WORKSPACE` system.
common --enable_bzlmod
common --enable_workspace=no

# https://docs.opentitan.org/doc/rm/c_cpp_coding_style/#cxx-version specifies
build --action_env=BAZEL_CXXOPTS="-std=gnu++17"
Expand All @@ -14,11 +15,6 @@ build --conlyopt='-std=gnu11'
# disassemblies when compilation mode is fastbuild.
build --strip='never'

# Override default enablement of flags from @crt//common to control C compiler
# warnings.
build --features=-pedantic_warnings
build --host_features=-pedantic_warnings

# Use --config=disable_hardening to disable hardening to measure the
# impact of the hardened sequences on code size.
build:disable_hardening --features=-guards --copt=-DOT_DISABLE_HARDENING=1
Expand Down Expand Up @@ -148,3 +144,5 @@ build --flag_alias=ckms_cert_endorsement=//sw/device/silicon_creator/manuf/skus/

# cquery output option.
cquery --output=files

common --legacy_external_runfiles
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.1
8.0.1
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ sw/**/*.md doc
sw/**/*.svg doc
sw/**/*.jpg doc
sw/**/*.png doc

# Generated lock files
MODULE.bazel.lock linguist-generated=true
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package(default_visibility = ["//visibility:public"])

exports_files([
"WORKSPACE",
"MODULE.bazel",
"python-requirements.txt",
"tool_requirements.py",
])
Expand Down
154 changes: 154 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

module(name = "lowrisc_opentitan")

# Dependencies:
bazel_dep(name = "abseil-cpp", version = "20240116.1")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_cc", version = "0.1.2")
bazel_dep(name = "rules_foreign_cc", version = "0.9.0")
bazel_dep(name = "rules_fuzzing", version = "0.5.2")
bazel_dep(name = "rules_pkg", version = "1.0.1")

# Dev dependencies:
bazel_dep(
name = "buildifier_prebuilt",
version = "6.4.0",
dev_dependency = True,
)
bazel_dep(
name = "lowrisc_misc_linters",
dev_dependency = True,
)
archive_override(
module_name = "lowrisc_misc_linters",
integrity = "sha256-Nl/mfYFo/uGg/DrqS7gFiL9yHcT8g7QEY7CetQiXzaM=",
strip_prefix = "misc-linters-20240823_01",
urls = ["https://github.com/lowRISC/misc-linters/archive/refs/tags/20240823_01.tar.gz"],
)

# Includes:
include("//third_party/rust:rust.MODULE.bazel")

include("//third_party/python:python.MODULE.bazel")

# Repository rules:
bitstreams_repo = use_repo_rule("//rules:bitstreams.bzl", "bitstreams_repo")

bitstreams_repo(name = "bitstreams")

nonhermetic_repo = use_repo_rule("//rules:nonhermetic.bzl", "nonhermetic_repo")

nonhermetic_repo(name = "nonhermetic")

# Source repositories (not Bazel-aware):
github_tools = use_extension("//third_party/github:extensions.bzl", "github_tools")
use_repo(github_tools, "com_github_gh")

lychee = use_extension("//third_party/lychee:extensions.bzl", "lychee")
use_repo(lychee, "lychee")

serde_annotate = use_extension("//third_party/rust:extensions.bzl", "serde_annotate")
use_repo(serde_annotate, "lowrisc_serde_annotate")

shellcheck = use_extension("//third_party/shellcheck:extensions.bzl", "shellcheck")
use_repo(shellcheck, "shellcheck")

tock = use_extension("//third_party/tock:extensions.bzl", "tock")
use_repo(tock, "elf2tab", "libtock", "tock")

openocd = use_extension("//third_party/openocd:extensions.bzl", "openocd")
use_repo(openocd, "openocd")

freertos = use_extension("//third_party/freertos:extensions.bzl", "freertos")
use_repo(freertos, "freertos")

llvm_compiler_rt = use_extension("//third_party/llvm_compiler_rt:extensions.bzl", "llvm_compiler_rt")
use_repo(llvm_compiler_rt, "llvm_compiler_rt")

riscv_compliance = use_extension("//third_party/riscv-compliance:extensions.bzl", "riscv_compliance")
use_repo(riscv_compliance, "riscv-compliance")

coremark = use_extension("//third_party/coremark:extensions.bzl", "coremark")
use_repo(coremark, "coremark")

xkcp = use_extension("//third_party/xkcp:extensions.bzl", "xkcp")
use_repo(xkcp, "xkcp")

hsm = use_extension("//third_party/hsm:extensions.bzl", "hsm")
use_repo(hsm, "cloud_kms_hsm", "opensc", "sc_hsm", "softhsm2")

nist_cavp = use_extension("//third_party/nist_cavp_testvectors:extensions.bzl", "nist_cavp")
use_repo(
nist_cavp,
"nist_cavp_aes_gcm",
"nist_cavp_aes_kat",
"nist_cavp_aes_kw_sp_800_38f",
"nist_cavp_drbg_sp_800_90a_root",
"nist_cavp_ecdh_sp_800_56a",
"nist_cavp_ecdsa_fips_186_4",
"nist_cavp_hmac_fips_198_1",
"nist_cavp_rsa_fips_186_3",
"nist_cavp_sha2_fips_180_4",
"nist_cavp_sha3_fips_202",
"nist_cavp_shake_fips_202",
)

wycheproof = use_extension("//third_party/wycheproof:extensions.bzl", "wycheproof")
use_repo(wycheproof, "wycheproof")

sphincsplus = use_extension("//third_party/sphincsplus:extensions.bzl", "sphincsplus")
use_repo(
sphincsplus,
"sphincsplus_fips205_ipd",
"sphincsplus_sha256_kat",
"sphincsplus_shake256_kat",
)

open_dice = use_extension("//third_party/open-dice:extensions.bzl", "open_dice")
use_repo(open_dice, "open-dice")

hyperdebug = use_extension("//third_party/hyperdebug:extensions.bzl", "hyperdebug")
use_repo(hyperdebug, "hyperdebug_firmware")

hwtrust = use_extension("//third_party/hwtrust:extensions.bzl", "hwtrust")
use_repo(hwtrust, "hwtrust")

qemu = use_extension("//third_party/qemu:extensions.bzl", "qemu")
use_repo(qemu, "qemu_opentitan")

lowrisc_rv32imcb_toolchain = use_extension("//third_party/lowrisc:extensions.bzl", "lowrisc_rv32imcb_toolchain")
use_repo(lowrisc_rv32imcb_toolchain, "lowrisc_rv32imcb_toolchain")

# Extension for linking in externally managed test and provisioning customizations
# for both secure/non-secure manufacturer domains.
hooks = use_extension("//rules:extensions.bzl", "hooks")
hooks.repo(
name = "manufacturer_test_hooks",
dummy = "sw/device/tests/closed_source",
env = "MANUFACTURER_HOOKS_DIR",
)
hooks.repo(
name = "secure_manufacturer_test_hooks",
dummy = "sw/device/tests/closed_source",
env = "SECURE_MANUFACTURER_HOOKS_DIR",
)
hooks.repo(
name = "provisioning_exts",
dummy = "sw/device/silicon_creator/manuf/extensions",
env = "PROV_EXTS_DIR",
)
use_repo(
hooks,
"manufacturer_test_hooks",
"provisioning_exts",
"secure_manufacturer_test_hooks",
)

register_toolchains("//rules/opentitan:localtools")

register_toolchains("//toolchain:cc_toolchain_opentitan")
Loading
Loading