Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4239b7f
[bazel] Remove internal bazel repos from airgap list
jwnrt Oct 15, 2024
470c4da
[bazel] Enable bzlmod in hybrid mode
jwnrt Jul 16, 2024
6362f9b
[bazel] Use `bazel vendor` in airgap prep
jwnrt Jun 11, 2025
30a8b0a
[bazel] Move `rules_rust` and Rust toolchain to bzlmod
jwnrt Dec 10, 2024
9685ee0
[bazel] Move Rust crates to bzlmod
jwnrt Dec 10, 2024
771b723
[bazel] Move Tock crates to bzlmod
jwnrt Dec 10, 2024
0c0f17f
[bazel] Move bindgen toolchain to bzlmod
jwnrt Dec 10, 2024
ccc2fc1
[bazel] Remove old vendored Rust crate files
jwnrt Dec 17, 2024
6d6c675
[bazel] Remove temporarily bazelignore entries for now deleted files
jwnrt Dec 17, 2024
35baa9c
[bazel] Add bzlmod support for `lowrisc_misc_linters`
jwnrt Dec 13, 2024
6a57246
[bazel] Add bzlmod support for `rules_fuzzing`
jwnrt Dec 13, 2024
e5ccda6
[bazel] Add bzlmod support for `rules_python`
jwnrt Dec 13, 2024
2acdfc6
[bazel] Add bzlmod support for `rules_cc`
jwnrt Dec 14, 2024
a670e42
[bazel] Remove python dependency from `bare_repository_rule`
pamaury Dec 16, 2024
e231040
[python] fold tockloader into top-level pyproject.toml
nbdd0121 Sep 17, 2024
8ee7e8c
[bazel] Remove Python dependency vendoring mechanism
jwnrt Jun 6, 2025
961f5e1
[bazel] Migrate `rules_python` and dependents to bzlmod
jwnrt Dec 13, 2024
f895a6a
[bazel] Move buildifier to bzlmod
jwnrt Dec 17, 2024
f2087e0
[bazel] Migrate Google dependencies to bzlmod
jwnrt Dec 17, 2024
1aa83fd
[bazel] Remove unused lint repos
jwnrt Dec 19, 2024
f0c449d
[bazel] Remove `rules_protobuf` dependency
jwnrt Dec 19, 2024
39d51c2
[bazel] Migrate source repositories to bzlmod
jwnrt Dec 17, 2024
e11469f
[bazel] Move third party patch files into `patches` subdirectories
jwnrt Dec 19, 2024
40d47aa
[bazel] Remove `local` parameter from `bare_repository`
jwnrt Dec 19, 2024
1d19cfa
[bazel] Remove `http_archive_or_local` rule
jwnrt Jan 2, 2025
bc4430d
[bazel] Migrate manufacturer hooks to bzlmod
jwnrt Jan 3, 2025
f5dd2eb
[bazel] Migrate nonhermetic repo to bzlmod
jwnrt Jan 3, 2025
3a70707
[bazel] Migrate local toolchains to bzlmod
jwnrt Jan 3, 2025
e82d4de
[ci] Remove `//external` usage from banned rule script
jwnrt Jan 11, 2025
b6a41dc
[doc] Add documentation for external dependencies
jwnrt Jan 10, 2025
3bba2cf
[bazel] Enable `--legacy_external_runfiles` in `.bazelrc`
jwnrt Jul 9, 2025
0c0337e
[bazel] Update test constant locations
jwnrt Oct 18, 2024
7412ca9
[bazel] Update platform const locations
jwnrt Oct 18, 2024
7d24dfa
[bazel] Move key consts and utils to opentitan rules
jwnrt Oct 18, 2024
957eaa9
[bazel] Fix constant exports
jwnrt Oct 18, 2024
663cf53
[bazel] Move `manual_test` to `//rules/opentitan`
jwnrt Oct 18, 2024
011daf6
[bazel] Move `obj_transform` rule to `cc.bzl`
jwnrt Oct 18, 2024
5873a19
[bazel] Move `vmem_file` rules to `cc.bzl`
jwnrt Oct 18, 2024
15f10ce
[bazel] Move `scramble_flash_vmem` to `cc.bzl`
jwnrt Oct 18, 2024
1d14c7f
[bazel] Remove unused loads of `elf_to_disassembly`
jwnrt Oct 18, 2024
8d5528e
[bazel] Remove legacy opentitan_test.bzl
jwnrt Oct 18, 2024
a06fb2c
[bazel] Remove legacy `opentitan.bzl`
jwnrt Oct 18, 2024
0eebe6f
[bazel] Import lowRISC toolchain repo directly
jwnrt Jan 8, 2025
cec7bfb
[bazel] Change how tools are pulled from cc_toolchains
jwnrt Jan 8, 2025
fc5cf6e
[bazel] Replace features with explicit flags in coremark lib
jwnrt Jan 9, 2025
054e1c1
[bazel] Add `cc_rules`-based lowRISC toolchain
jwnrt Jan 8, 2025
81dffb0
[bazel] Switch lowRISC toolchain from CRT to local version
jwnrt Jan 8, 2025
dc527f7
[doc] Add documentation for Bazel RISC-V toolchain
jwnrt Jan 8, 2025
320a8be
[bazel] Use `MODULE.bazel` as repo root in rules
jwnrt Jan 10, 2025
9c03a5d
[bazel] Replace `bazel sync` with `bazel fetch`
jwnrt Jan 10, 2025
eadda05
[bazel] Hotswap deprecated `sync` command in bazelisk.sh
jwnrt Jan 12, 2025
dae7479
[bazel] Remove `bazel fetch` from airgap preparation
jwnrt Jun 12, 2025
edf18ee
[bazel] Remove empty WORKSPACE.bzlmod disabling hybrid mode
jwnrt Jan 10, 2025
cde1469
[bazel] Disable WORKSPACE system
jwnrt Jan 10, 2025
bc53c50
[bazel] Resolve incompatible_disallow_empty_glob errors
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++14"
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
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