Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sival] ROM_EXT PROD SIVAL Configuration #20694

Merged
merged 3 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions hw/top_earlgrey/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ silicon(
},
rom_ext = select({
"//signing:test_keys": "//sw/device/silicon_creator/rom_ext/sival:rom_ext_fake_prod_signed_slot_a",
# TODO: set this to the prod signed SiVAL rom_ext binary.
"//conditions:default": "//sw/device/silicon_creator/rom_ext/sival:rom_ext_fake_prod_signed_slot_a",
"//conditions:default": "//sw/device/silicon_creator/rom_ext/sival/binaries:rom_ext_real_prod_signed_slot_a",
}),
rsa_key = select({
"//signing:test_keys": {"//sw/device/silicon_creator/rom_ext/keys/fake:rom_ext_test_private_key_0": "test_key_0"},
Expand Down
5 changes: 5 additions & 0 deletions rules/opentitan/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def _hacky_tags(env):
# rule's implementation, we have to infer these tag names from the
# label name.
tags.append(suffix[5:])
if suffix.startswith("silicon"):
# We add the entire suffix for silicon exec environments to be able
# to filter tests by them. "silicon_creator" and
# "silicon_owner_sival_rom_ext" have different target configurations.
tags.append(suffix)
return tags

def opentitan_test(
Expand Down
15 changes: 15 additions & 0 deletions sw/device/silicon_creator/rom_ext/sival/binaries/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

package(default_visibility = ["//visibility:public"])

filegroup(
name = "rom_ext_real_prod_signed_slot_a",
srcs = ["rom_ext_real_prod_signed_slot_a_silicon_creator.signed.bin"],
)

filegroup(
name = "rom_ext_real_prod_signed_slot_b",
srcs = ["rom_ext_real_prod_signed_slot_b_silicon_creator.signed.bin"],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Random thought: I wonder if it would be more git-friendly if we committed these in ihex or some other textual format and had bazel do the conversion to binary. I suppose we don't anticipate these to need to support diff, though /shrug

No need to bother for this PR, though!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @a-will, this is a good point. I think we should discuss this in the SW WG. We should consider doing this or alternatively, use something like lfs to manage binaries.

Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions sw/device/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ opentitan_test(
"//hw/top_earlgrey:fpga_cw310_sival": None,
"//hw/top_earlgrey:fpga_cw310_sival_rom_ext": None,
"//hw/top_earlgrey:silicon_creator": None,
"//hw/top_earlgrey:silicon_owner_sival_rom_ext": None,
},
),
deps = [
Expand Down Expand Up @@ -1599,6 +1600,7 @@ opentitan_test(
"//hw/top_earlgrey:fpga_cw310_sival": None,
"//hw/top_earlgrey:fpga_cw310_sival_rom_ext": None,
"//hw/top_earlgrey:silicon_creator": None,
"//hw/top_earlgrey:silicon_owner_sival_rom_ext": None,
},
),
deps = [
Expand Down
23 changes: 21 additions & 2 deletions sw/device/tests/doc/sival/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,34 @@ bazel test --define DISABLE_VERILATOR_BUILD=true \

### Silicon Creator

The following commands runs the `SV2` test suite on the `silicon_creator`
The following command runs the `SV2` test suite using the `silicon_creator`
execution environment. The binaries are signed with the `earlgrey_a0_dev_0`
key using the `nitrokey` signing token configuration.

```console
bazel test --define DISABLE_VERILATOR_BUILD=true \
--//signing:token=//signing/tokens:nitrokey \
--//sw/device/silicon_creator/rom/keys/real/rsa:keyset=earlgrey_a0_dev_0 \
--test_tag_filters=silicon \
--build_tag_filters=silicon_creator \
--test_tag_filters=silicon_creator \
--test_output=streamed \
--define bitstream=gcp_splice \
--cache_test_results=no \
--local_test_jobs 1 \
//sw/device/tests/sival:sv2_tests
```

### Silicon Owner

The following command runs the `SV2` test suite using the
`silicon_owner_sival_rom_ext` execution environment. The binaries are signed
using the `cloud_kms` signing token configuration.

```console
bazel test --define DISABLE_VERILATOR_BUILD=true \
--//signing:token=//signing/tokens:cloud_kms \
--build_tag_filters=silicon_owner_sival_rom_ext \
--test_tag_filters=silicon_owner_sival_rom_ext \
--test_output=streamed \
--define bitstream=gcp_splice \
--cache_test_results=no \
Expand Down
Loading