Skip to content

Commit 55173a2

Browse files
Merge branch 'lowRISC:earlgrey_1.0.0' into earlgrey_1.0.0
2 parents ddbf0cb + 33f27b8 commit 55173a2

File tree

149 files changed

+3523
-680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3523
-680
lines changed

.github/workflows/ci.yml

+16
Original file line numberDiff line numberDiff line change
@@ -713,3 +713,19 @@ jobs:
713713
- name: Check for unrunnable tests
714714
run: ./ci/scripts/check-unrunnable-tests.sh
715715
continue-on-error: true
716+
717+
qemu_smoketest:
718+
name: QEMU smoketest
719+
runs-on: ubuntu-22.04-vivado
720+
needs: quick_lint
721+
steps:
722+
- uses: actions/checkout@v4
723+
with:
724+
fetch-depth: 0
725+
- name: Prepare environment
726+
uses: ./.github/actions/prepare-env
727+
with:
728+
service_account_json: '${{ secrets.BAZEL_CACHE_CREDS }}'
729+
- name: Execute QEMU smoketest
730+
run: |
731+
./bazelisk.sh test //sw/device/tests:rom_exit_immediately_sim_qemu_base

WORKSPACE

+3
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ bitstreams_repo(name = "bitstreams")
153153
load("//third_party/open-dice:repos.bzl", "open_dice_repos")
154154
open_dice_repos()
155155

156+
load("//third_party/qemu:repos.bzl", "qemu_opentitan_repos")
157+
qemu_opentitan_repos()
158+
156159
# Setup for linking in externally managed test and provisioning customizations
157160
# for both secure/non-secure manufacturer domains.
158161
load("//rules:hooks_setup.bzl", "hooks_setup", "provisioning_exts_setup", "secure_hooks_setup")

ci/scripts/build-bitstream-vivado.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,4 @@ BITSTREAM_FNAME="lowrisc_systems_chip_${FLAVOUR}_${TARGET}_0.1.bit"
106106
BITSTREAM_PATH="$OBJ_DIR/hw/synth-vivado/$BITSTREAM_FNAME"
107107
cp "$BITSTREAM_PATH" "$TOPLEVEL_BIN_DIR"
108108

109-
cp "$OBJ_DIR/hw/synth-vivado/rom.mmi" "$TOPLEVEL_BIN_DIR"
110-
if [ $HAS_OTP == 1 ]; then
111-
cp "$OBJ_DIR/hw/synth-vivado/otp.mmi" "$TOPLEVEL_BIN_DIR"
112-
fi
109+
cp "$OBJ_DIR/hw/synth-vivado/memories.mmi" "$TOPLEVEL_BIN_DIR"

doc/contributing/fpga/debugging_with_ila.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ The path to the synthesis log file is usually `bazel-out/k8-fastbuild/bin/hw/bit
237237

238238
Once Vivado has successfully generated a bitstream, locate its directory with `dirname $(./bazelisk.sh outquery-all //hw/bitstream:rom --define bitstream=vivado)` (it will usually be `bazel-out/k8-fastbuild/bin/hw/bitstream/vivado`).
239239
Append `/build.fpga_cw310/synth-vivado` to that path.
240-
In the resulting directory, you should find `otp.mmi`, `rom.mmi`, and `lowrisc_systems_chip_earlgrey_cw310_0.1.bit`.
240+
In the resulting directory, you should find `memories.mmi` and `lowrisc_systems_chip_earlgrey_cw310_0.1.bit`.
241241
We will next copy those files into a local bitstream cache that Bazel can use.
242242

243243
If you don't have a local bitstream cache yet, create one as follows:
@@ -254,7 +254,7 @@ mkdir -p $BAZEL_BITSTREAMS_CACHE/cache
254254
Create a directory with the name of the Git hash for which you have built the bitstream under `$BAZEL_BITSTREAMS_CACHE/cache/` (e.g,. `$BAZEL_BITSTREAMS_CACHE/cache/2e5a31b7d80b6eb97e114b2ca8f9e132ec7c83a6`).
255255
(You can find the relevant Git hash with `git log`, for example.
256256
If you have not committed the changes to implement the ILA yet, we recommend doing so at least locally.)
257-
Copy `otp.mmi` and `rom.mmi` to that directory.
257+
Copy `memories.mmi` to that directory.
258258
Copy `lowrisc_systems_chip_earlgrey_cw310_0.1.bit` also to that directory, then rename the copy to `lowrisc_systems_chip_earlgrey_cw310_0.1.bit.orig`.
259259

260260
Now instruct Bazel to use a bitstream from the local cache by setting an `--offline` argument in the `BITSTREAM` environment variable; for example:

doc/contributing/fpga/ref_manual_fpga.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ The following files are produced as a result:
143143
* `fpga_cw310_rom.bit` (ROM, RMA OTP image)
144144
* `fpga_cw310_rom_otp_dev.bit` (ROM, DEV OTP image)
145145
* `lowrisc_systems_chip_earlgrey_cw310_0.1.bit` (test ROM, RMA OTP image)
146-
* `otp.mmi`
147-
* `rom.mmi`
146+
* `memories.mmi`
148147

149148
If CI is working on the `master` branch, it puts selected build artifacts into a tarball, which it then uploads to the GCS bucket. The latest tarball is available here: https://storage.googleapis.com/opentitan-bitstreams/master/bitstream-latest.tar.gz
150149

hw/bitstream/BUILD

+13-25
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,13 @@ filegroup(
7070
)
7171

7272
filegroup(
73-
name = "rom_mmi",
73+
name = "cw310_mmi",
7474
testonly = True,
7575
srcs = select({
7676
"bitstream_skip": ["//hw/bitstream/universal:none"],
77-
"bitstream_vivado": ["//hw/bitstream/vivado:rom_mmi"],
78-
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_rom_mmi"],
79-
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_rom_mmi"],
80-
}),
81-
tags = ["manual"],
82-
)
83-
84-
filegroup(
85-
name = "otp_mmi",
86-
testonly = True,
87-
srcs = select({
88-
"bitstream_skip": ["//hw/bitstream/universal:none"],
89-
"bitstream_vivado": ["//hw/bitstream/vivado:otp_mmi"],
90-
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_otp_mmi"],
91-
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_otp_mmi"],
77+
"bitstream_vivado": ["//hw/bitstream/vivado:cw310_mmi"],
78+
"bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_mmi"],
79+
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_mmi"],
9280
}),
9381
tags = ["manual"],
9482
)
@@ -99,7 +87,8 @@ bitstream_splice(
9987
testonly = True,
10088
src = ":bitstream",
10189
data = "//sw/device/lib/testing/test_rom:test_rom_fpga_cw310_scr_vmem",
102-
meminfo = ":rom_mmi",
90+
instance = "rom",
91+
meminfo = ":cw310_mmi",
10392
tags = ["manual"],
10493
update_usr_access = True,
10594
)
@@ -109,7 +98,8 @@ bitstream_splice(
10998
testonly = True,
11099
src = ":bitstream",
111100
data = "//sw/device/silicon_creator/rom:mask_rom_fpga_cw310_scr_vmem",
112-
meminfo = ":rom_mmi",
101+
instance = "rom",
102+
meminfo = ":cw310_mmi",
113103
tags = ["manual"],
114104
update_usr_access = True,
115105
)
@@ -121,7 +111,8 @@ bitstream_splice(
121111
testonly = True,
122112
src = ":mask_rom",
123113
data = img_target,
124-
meminfo = ":otp_mmi",
114+
instance = "otp",
115+
meminfo = ":cw310_mmi",
125116
tags = ["manual"],
126117
update_usr_access = True,
127118
)
@@ -133,8 +124,7 @@ bitstream_fragment_from_manifest(
133124
name = "chip_earlgrey_cw310_cached_fragment",
134125
srcs = [
135126
"@bitstreams//:chip_earlgrey_cw310_bitstream",
136-
"@bitstreams//:chip_earlgrey_cw310_otp_mmi",
137-
"@bitstreams//:chip_earlgrey_cw310_rom_mmi",
127+
"@bitstreams//:chip_earlgrey_cw310_mmi",
138128
],
139129
design = "chip_earlgrey_cw310",
140130
manifest = "@bitstreams//:manifest",
@@ -155,8 +145,7 @@ bitstream_fragment_from_manifest(
155145
name = "chip_earlgrey_cw310_hyperdebug_cached_fragment",
156146
srcs = [
157147
"@bitstreams//:chip_earlgrey_cw310_hyperdebug_bitstream",
158-
"@bitstreams//:chip_earlgrey_cw310_hyperdebug_otp_mmi",
159-
"@bitstreams//:chip_earlgrey_cw310_hyperdebug_rom_mmi",
148+
"@bitstreams//:chip_earlgrey_cw310_hyperdebug_mmi",
160149
],
161150
design = "chip_earlgrey_cw310_hyperdebug",
162151
manifest = "@bitstreams//:manifest",
@@ -177,8 +166,7 @@ bitstream_fragment_from_manifest(
177166
name = "chip_earlgrey_cw340_cached_fragment",
178167
srcs = [
179168
"@bitstreams//:chip_earlgrey_cw340_bitstream",
180-
"@bitstreams//:chip_earlgrey_cw340_otp_mmi",
181-
"@bitstreams//:chip_earlgrey_cw340_rom_mmi",
169+
"@bitstreams//:chip_earlgrey_cw340_mmi",
182170
],
183171
design = "chip_earlgrey_cw340",
184172
manifest = "@bitstreams//:manifest",

hw/bitstream/cw340/BUILD

+10-19
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,13 @@ filegroup(
2525
)
2626

2727
filegroup(
28-
name = "rom_mmi",
28+
name = "mmi",
2929
testonly = True,
3030
srcs = select({
3131
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
32-
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_rom_mmi"],
33-
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_rom_mmi"],
34-
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_rom_mmi"],
35-
}),
36-
tags = ["manual"],
37-
)
38-
39-
filegroup(
40-
name = "otp_mmi",
41-
testonly = True,
42-
srcs = select({
43-
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
44-
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:fpga_cw340_otp_mmi"],
45-
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_otp_mmi"],
46-
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_otp_mmi"],
32+
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:cw340_mmi"],
33+
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw340_mmi"],
34+
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw340_mmi"],
4735
}),
4836
tags = ["manual"],
4937
)
@@ -54,7 +42,8 @@ bitstream_splice(
5442
testonly = True,
5543
src = ":bitstream",
5644
data = "//sw/device/lib/testing/test_rom:test_rom_fpga_cw340_scr_vmem",
57-
meminfo = ":rom_mmi",
45+
instance = "rom",
46+
meminfo = ":mmi",
5847
tags = ["manual"],
5948
update_usr_access = True,
6049
)
@@ -65,7 +54,8 @@ bitstream_splice(
6554
testonly = True,
6655
src = ":bitstream",
6756
data = "//sw/device/silicon_creator/rom:mask_rom_fpga_cw340_scr_vmem",
68-
meminfo = ":rom_mmi",
57+
instance = "rom",
58+
meminfo = ":mmi",
6959
tags = ["manual"],
7060
update_usr_access = True,
7161
)
@@ -77,7 +67,8 @@ bitstream_splice(
7767
testonly = True,
7868
src = ":mask_rom",
7969
data = img_target,
80-
meminfo = ":otp_mmi",
70+
instance = "otp",
71+
meminfo = ":mmi",
8172
tags = ["manual"],
8273
update_usr_access = True,
8374
)

hw/bitstream/hyperdebug/BUILD

+10-19
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,13 @@ filegroup(
2121
)
2222

2323
filegroup(
24-
name = "rom_mmi",
24+
name = "mmi",
2525
testonly = True,
2626
srcs = select({
2727
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
28-
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:rom_mmi_hyp"],
29-
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_hyperdebug_rom_mmi"],
30-
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_hyperdebug_rom_mmi"],
31-
}),
32-
tags = ["manual"],
33-
)
34-
35-
filegroup(
36-
name = "otp_mmi",
37-
testonly = True,
38-
srcs = select({
39-
"//hw/bitstream:bitstream_skip": ["//hw/bitstream/universal:none"],
40-
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:otp_mmi_hyp"],
41-
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_hyperdebug_otp_mmi"],
42-
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_hyperdebug_otp_mmi"],
28+
"//hw/bitstream:bitstream_vivado": ["//hw/bitstream/vivado:cw310_hyperdebug_mmi"],
29+
"//hw/bitstream:bitstream_gcp_splice": ["@bitstreams//:chip_earlgrey_cw310_hyperdebug_mmi"],
30+
"//conditions:default": ["@bitstreams//:chip_earlgrey_cw310_hyperdebug_mmi"],
4331
}),
4432
tags = ["manual"],
4533
)
@@ -50,7 +38,8 @@ bitstream_splice(
5038
testonly = True,
5139
src = ":bitstream",
5240
data = "//sw/device/lib/testing/test_rom:test_rom_fpga_cw310_scr_vmem",
53-
meminfo = ":rom_mmi",
41+
instance = "rom",
42+
meminfo = ":mmi",
5443
tags = ["manual"],
5544
update_usr_access = True,
5645
)
@@ -61,7 +50,8 @@ bitstream_splice(
6150
testonly = True,
6251
src = ":bitstream",
6352
data = "//sw/device/silicon_creator/rom:mask_rom_fpga_cw310_scr_vmem",
64-
meminfo = ":rom_mmi",
53+
instance = "rom",
54+
meminfo = ":mmi",
6555
tags = ["manual"],
6656
update_usr_access = True,
6757
)
@@ -73,7 +63,8 @@ bitstream_splice(
7363
testonly = True,
7464
src = ":mask_rom",
7565
data = img_target,
76-
meminfo = ":otp_mmi",
66+
instance = "otp",
67+
meminfo = ":mmi",
7768
tags = ["manual"],
7869
update_usr_access = True,
7970
)

hw/bitstream/universal/BUILD

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ label_flag(
2929
universal_splice(
3030
name = "splice",
3131
testonly = True,
32-
# When the src bitstream, rom_mmi and otp_mmi fields are empty,
33-
# the rule will use values from the exec_env.
32+
# When the src bitstream and mmi fields are empty, the rule will use values
33+
# from the exec_env.
3434
exec_env = ":env",
3535
otp = ":otp",
3636
rom = ":rom",

0 commit comments

Comments
 (0)