Skip to content

Commit d00a6c8

Browse files
committed
[verilator,bazel] Move Englishbreakfast to new Verilator Bazel flow
Signed-off-by: Robert Schilling <[email protected]>
1 parent 152fdc2 commit d00a6c8

File tree

15 files changed

+247
-64
lines changed

15 files changed

+247
-64
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ jobs:
304304
service_account_json: '${{ secrets.BAZEL_CACHE_CREDS }}'
305305
- name: Build simulator with Verilator
306306
run: |
307-
./bazelisk.sh build //hw/top_englishbreakfast:verilator_sim
308-
sim_binary_path=$(./bazelisk.sh cquery --output=files //hw/top_englishbreakfast:verilator_sim)
307+
./bazelisk.sh build --//hw/top=englishbreakfast //hw:verilator_real
308+
sim_binary_path=$(./bazelisk.sh cquery --//hw/top=englishbreakfast --output=files //hw:verilator_real)
309309
mkdir -p build-bin/hw/top_englishbreakfast
310310
cp ${sim_binary_path} build-bin/hw/top_englishbreakfast/
311311
- name: Upload binary

hw/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fusesoc_build(
102102
data = ["//hw/ip/otbn:rtl_files"],
103103
make_options = ":make_options",
104104
output_groups = opentitan_select_top_attr("top_verilator_binary"),
105-
systems = ["lowrisc:dv:chip_verilator_sim"],
105+
systems = opentitan_select_top_attr("top_verilator_core"),
106106
tags = [
107107
"manual",
108108
"verilator",

hw/top_darjeeling/defs.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ DARJEELING = opentitan_top(
1212
hjson = "//hw/top_darjeeling/data/autogen:top_darjeeling.gen.hjson",
1313
top_lib = "//hw/top_darjeeling/sw/autogen:top_darjeeling",
1414
top_rtl = "//hw/top_darjeeling:rtl_files",
15+
top_verilator_core = ["lowrisc:dv:top_darjeeling_chip_verilator_sim"],
1516
top_verilator_binary = {"binary": ["lowrisc_dv_top_darjeeling_chip_verilator_sim_0.1/sim-verilator/Vchip_sim_tb"]},
1617
top_ld = "//hw/top_darjeeling/sw/autogen:top_darjeeling_memory",
1718
otp_map = "//hw/top_darjeeling/data/otp:otp_ctrl_mmap.hjson",

hw/top_darjeeling/dv/verilator/chip_sim.core

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ CAPI=2:
44
# SPDX-License-Identifier: Apache-2.0
55
name: "lowrisc:dv:top_darjeeling_chip_verilator_sim:0.1"
66
description: "Darjeeling toplevel for simulation with Verilator"
7-
virtual:
8-
- lowrisc:dv:chip_verilator_sim
97

108
filesets:
119
files_sim_verilator:

hw/top_earlgrey/defs.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ EARLGREY = opentitan_top(
1212
hjson = "//hw/top_earlgrey/data/autogen:top_earlgrey.gen.hjson",
1313
top_lib = "//hw/top_earlgrey/sw/autogen:top_earlgrey",
1414
top_rtl = "//hw/top_earlgrey:rtl_files",
15+
top_verilator_core = ["lowrisc:dv:top_earlgrey_chip_verilator_sim"],
1516
top_verilator_binary = {"binary": ["lowrisc_dv_top_earlgrey_chip_verilator_sim_0.1/sim-verilator/Vchip_sim_tb"]},
1617
top_ld = "//hw/top_earlgrey/sw/autogen:top_earlgrey_memory",
1718
otp_map = "//hw/top_earlgrey/data/otp:otp_ctrl_mmap.hjson",

hw/top_earlgrey/dv/verilator/chip_sim.core

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ CAPI=2:
44
# SPDX-License-Identifier: Apache-2.0
55
name: "lowrisc:dv:top_earlgrey_chip_verilator_sim:0.1"
66
description: "Earl Grey toplevel for simulation with Verilator"
7-
virtual:
8-
- lowrisc:dv:chip_verilator_sim
97

108
filesets:
119
files_sim_verilator:

hw/top_englishbreakfast/BUILD

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,9 @@ filegroup(
1111
srcs = glob(
1212
["**"],
1313
) + [
14+
"//hw/top_earlgrey:rtl_files", # Add Earlgrey RTL files for alert_handler_pkg and top_pkg
15+
"//hw/top_englishbreakfast/dv/verilator:all_files",
1416
"//hw/top_englishbreakfast/ip:rtl_files",
1517
],
1618
visibility = ["//visibility:public"],
1719
)
18-
19-
fusesoc_build(
20-
name = "verilator_sim",
21-
srcs = [
22-
":rtl_files",
23-
"//hw:dpi_files",
24-
"//hw:dv_common_files",
25-
"//hw:rtl_files",
26-
"//hw:verilator_files",
27-
],
28-
cores = [
29-
"//hw:cores",
30-
],
31-
data = ["//hw/ip/otbn:rtl_files"],
32-
make_options = ":make_options",
33-
output_groups = opentitan_select_top_attr("top_verilator_binary"),
34-
systems = ["lowrisc:systems:chip_englishbreakfast_verilator"],
35-
tags = [
36-
"manual",
37-
"verilator",
38-
],
39-
target = "sim",
40-
verilator_options = ":verilator_options",
41-
)
42-
43-
string_list_flag(
44-
name = "verilator_options",
45-
build_setting_default = [
46-
"--threads",
47-
"2",
48-
],
49-
)
50-
51-
string_list_flag(
52-
name = "make_options",
53-
build_setting_default = [
54-
"-j",
55-
"2",
56-
],
57-
)

hw/top_englishbreakfast/bitstream/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fusesoc_build(
1313
testonly = True,
1414
srcs = [
1515
"//hw:rtl_files",
16+
"//hw/top_earlgrey:rtl_files", # Add Earlgrey RTL files for alert_handler_pkg and top_pkg
1617
"//hw/top_englishbreakfast:rtl_files",
1718
],
1819
cores = ["//hw:cores"],

hw/top_englishbreakfast/defs.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ ENGLISHBREAKFAST = opentitan_top(
1111
hjson = "//hw/top_englishbreakfast/data/autogen:top_englishbreakfast.gen.hjson",
1212
top_lib = "//hw/top_englishbreakfast/sw/autogen:top_englishbreakfast",
1313
top_rtl = "//hw/top_englishbreakfast:rtl_files",
14-
top_verilator_binary = {"binary": ["lowrisc_systems_chip_englishbreakfast_verilator_0.1/sim-verilator/Vchip_englishbreakfast_verilator"]},
14+
top_verilator_core = ["lowrisc:dv:top_englishbreakfast_chip_verilator_sim"],
15+
top_verilator_binary = {"binary": ["lowrisc_dv_top_englishbreakfast_chip_verilator_sim_0.1/sim-verilator/Vchip_sim_tb"]},
1516
top_ld = "//hw/top_englishbreakfast/sw/autogen:top_englishbreakfast_memory",
1617
ips = ENGLISHBREAKFAST_IPS,
1718
secret_cfgs = {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright lowRISC contributors (OpenTitan project).
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
filegroup(
8+
name = "all_files",
9+
srcs = glob(["**"]),
10+
)

0 commit comments

Comments
 (0)