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

WIP: Uniquify core VLNVs + promote englishbreakfast to full topgen #25747

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
432ed05
[topgen] Remove fileset_top and fileset_topgen flags
a-will Dec 23, 2024
0def5b2
[ast.core] Depend on `ast_pkg` instead of including `ast_pkg.sv` in R…
andreaskurth Nov 26, 2024
dcb285d
[fusesoc] Uniquify core VLNVs
andreaskurth Dec 2, 2024
077d16c
[top_darjeeling] Remove FUSESOC_IGNORE
andreaskurth Nov 26, 2024
11a698c
[alert_handler] Template all core files
a-will Dec 24, 2024
dd4aee9
[alert_handler] Move package constants out of logic cores
a-will Dec 24, 2024
04f3a88
[clkmgr] Template all core files
a-will Dec 24, 2024
76e4454
[pinmux] Template all core files
a-will Dec 24, 2024
b780cbe
[pwrmgr] Template all core files
a-will Dec 24, 2024
20f7801
[rstmgr] Template all core files
a-will Dec 24, 2024
cf245ec
[rv_plic] Name component files after the instance too
a-will Dec 24, 2024
6a6d93a
[flash_ctrl] Template all core files
a-will Dec 24, 2024
0b6576b
[pwrmgr,clkmgr,rstmgr] Adjust VLNVs for SVA interfaces
a-will Dec 27, 2024
40a6bbd
[topgen] Generate top-specific tests in their outdirs
a-will Dec 24, 2024
0b7dadc
[top_englishbreakfast] Convert to full topgen flow
a-will Dec 24, 2024
b099ffd
[englishbreakfast,clkmgr,rstmgr] Fix up docs for lint
a-will Dec 27, 2024
400227c
[top,lint] Add special cores for lint, sim for earlgrey
a-will Dec 28, 2024
b7ee37a
[ipgen] Generate cross-module references for top cores
a-will Dec 28, 2024
036c652
[ipgen] Try out a virtual provider library for tops
a-will Dec 29, 2024
b85377f
[ipgen] Move back to single virtual provider
a-will Dec 30, 2024
257ba59
[clkmgr,pwrmgr] Move the shared SVA interfaces out
a-will Jan 2, 2025
76d8893
[prim_mubi] Split off constants to prim_mubi_pkg core
a-will Dec 20, 2024
e74814e
[clkmgr] Remove most virtual VLNVs
a-will Jan 3, 2025
0c5fac8
[pwrmgr] Remove dependency on alert_handler
a-will Jan 1, 2025
d78a4e5
[pwrmgr] Eliminate most uses of virtual VLNVs
a-will Jan 3, 2025
ebd5d8f
[flash_ctrl] Remove most virtual VLNVs
a-will Jan 3, 2025
52f4078
[rstmgr] Clean up VLNVs
a-will Jan 3, 2025
24efb0d
[alert_handler] Clean up VLNVs
a-will Jan 3, 2025
293a88f
[pinmux] Clean up VLNVs
a-will Jan 3, 2025
2b20a3d
[prim] Add hacky prim_flop dependency to prim_flop_2sync
a-will Jan 3, 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
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ hw/foundry/
# ROM_EXT signer vendored in dependencies
sw/host/rom_ext_image_signer/vendored_dependencies

# Autogen files for non-Earlgrey tops
hw/top_englishbreakfast/**/autogen/
hw/top_englishbreakfast/ip/alert_handler/dv/alert_handler_env_pkg__params.sv
hw/top_englishbreakfast/ip/sensor_ctrl/rtl/*
hw/top_englishbreakfast/ip/xbar_main/xbar_main.core
hw/top_englishbreakfast/ip/xbar_peri/xbar_peri.core

# Rust Cargo build system files.
sw/host/**/target
rust-project.json
Expand Down
2 changes: 0 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ filegroup(
name = "cores",
srcs = [
"check_tool_requirements.core",
"topgen.core",
"topgen-reg-only.core",
],
)

Expand Down
11 changes: 1 addition & 10 deletions ci/scripts/build-bitstream-vivado.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ case x"$TOPLEVEL" in
xtop_earlgrey)
HAS_SCRAMBLED_ROM=1
HAS_OTP=1
RUN_TOPGEN_FUSESOC=0
;;
xtop_englishbreakfast)
HAS_SCRAMBLED_ROM=0
HAS_OTP=0
RUN_TOPGEN_FUSESOC=1
;;
*)
usage "Unknown toplevel: $TOPLEVEL"
Expand Down Expand Up @@ -86,17 +84,10 @@ else
OTP_ARG=""
fi

if [ $RUN_TOPGEN_FUSESOC == 1 ]; then
util/topgen-fusesoc.py --files-root=. --topname="$TOPLEVEL"
FILESET=topgen
else
FILESET=top
fi

CORE_NAME="lowrisc:systems:chip_${FLAVOUR}_${TARGET}"

fusesoc --verbose --cores-root=. \
run --flag=fileset_$FILESET --target=synth --setup --build \
run --target=synth --setup --build \
--build-root="$OBJ_DIR/hw" \
"$CORE_NAME" \
--BootRomInitFile="$BOOTROM_VMEM" \
Expand Down
5 changes: 1 addition & 4 deletions ci/scripts/build-chip-verilator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ tl="$1"

case "$tl" in
earlgrey)
fileset=fileset_top
fusesoc_core=lowrisc:dv:chip_verilator_sim
vname=Vchip_sim_tb
verilator_options="--threads 4"
make_options="-j 4"
;;
englishbreakfast)
fileset=fileset_topgen
fusesoc_core=lowrisc:systems:chip_englishbreakfast_verilator
vname=Vchip_englishbreakfast_verilator
# Englishbreakfast on CI runs on a 2-core CPU
verilator_options="--threads 2"
make_options="-j 2"
util/topgen-fusesoc.py --files-root=. --topname=top_englishbreakfast
;;
*)
echo >&2 "Unknown toplevel: $tl"
Expand All @@ -49,7 +46,7 @@ mkdir -p "$OBJ_DIR/hw"
mkdir -p "$BIN_DIR/hw/top_${tl}"

fusesoc --cores-root=. \
run --flag=$fileset --target=sim --setup --build \
run --target=sim --setup --build \
--build-root="$OBJ_DIR/hw" \
$fusesoc_core \
--verilator_options="${verilator_options}" \
Expand Down
2 changes: 1 addition & 1 deletion doc/getting_started/setup_fpga.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The `--no-export` option of FuseSoC disables copying the source files into the s
**Only create Vivado project directory by using FuseSoC directly (skipping Bazel invocation).**
```sh
cd $REPO_TOP
fusesoc --cores-root . run --flag=fileset_top --target=synth --no-export --setup lowrisc:systems:chip_earlgrey_${BOARD}
fusesoc --cores-root . run --target=synth --no-export --setup lowrisc:systems:chip_earlgrey_${BOARD}
```

You can then navigate to the created project directory, and open Vivado
Expand Down
2 changes: 1 addition & 1 deletion hw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ IPS ?= aes \
uart \
usbdev

TOPS ?= top_darjeeling top_earlgrey
TOPS ?= top_darjeeling top_earlgrey top_englishbreakfast

USE_BUFFER ?= 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CAPI=2:
# SPDX-License-Identifier: Apache-2.0
name: "lowrisc:dv:clkmgr_pwrmgr_sva_if:0.1"
description: "CLKMGR to PWRMGR assertion interface."

filesets:
files_dv:
depend:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ CAPI=2:
# SPDX-License-Identifier: Apache-2.0
name: "lowrisc:dv:pwrmgr_rstmgr_sva_if:0.1"
description: "PWRMGR to RSTMGR assertion interface."

filesets:
files_dv:
depend:
- lowrisc:ip_interfaces:pwrmgr_pkg
- lowrisc:prim:assert
files:
- pwrmgr_rstmgr_sva_if.sv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
// This has some assertions that check the inputs from rstmgr react according to
// the pwrmgr outputs. The rstmgr inputs are generated by the base sequences, but
// these assertions will also be useful at full chip level.
interface pwrmgr_rstmgr_sva_if
import pwrmgr_pkg::*, pwrmgr_reg_pkg::*;
(
interface pwrmgr_rstmgr_sva_if #(
parameter int unsigned PowerDomains = 2
) (
input logic clk_i,
input logic rst_ni,
input logic clk_slow_i,
Expand Down
2 changes: 1 addition & 1 deletion hw/ip/lc_ctrl/lc_ctrl.core
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ filesets:
- lowrisc:ip:otp_ctrl_pkg
- lowrisc:ip:kmac_pkg
- lowrisc:ip:rv_dm
- lowrisc:ip_interfaces:alert_handler_reg
- lowrisc:ip_interfaces:alert_handler_pkg
files:
- rtl/lc_ctrl_regs_reg_top.sv
- rtl/lc_ctrl_dmi_reg_top.sv
Expand Down
4 changes: 4 additions & 0 deletions hw/ip/prim/prim_flop_2sync.core
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ filesets:
depend:
- lowrisc:prim:prim_pkg
- lowrisc:prim:primgen
# TODO: This hack should go away with upstream fusesoc support. The
# generic prim_generic_flop_2sync depends on prim:flop, but the generator
# does not appear to run recursively.
- lowrisc:prim:flop

files_verilator_waiver:
depend:
Expand Down
2 changes: 1 addition & 1 deletion hw/ip/prim/prim_mubi.core
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ filesets:
- lowrisc:prim:assert
- lowrisc:prim:buf
- lowrisc:prim:flop
- lowrisc:prim:mubi_pkg
files:
- rtl/prim_mubi_pkg.sv
- rtl/prim_mubi4_sender.sv
- rtl/prim_mubi4_sync.sv
- rtl/prim_mubi4_dec.sv
Expand Down
45 changes: 45 additions & 0 deletions hw/ip/prim/prim_mubi_pkg.core
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CAPI=2:
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
#
# ------------------- W A R N I N G: A U T O - G E N E R A T E D C O D E !! -------------------//
# PLEASE DO NOT HAND-EDIT THIS FILE. IT HAS BEEN AUTO-GENERATED WITH THE FOLLOWING COMMAND:
#
# util/design/gen-mubi.py
#
name: "lowrisc:prim:mubi_pkg:0.1"
description: "Multibit types and functions"
filesets:
files_rtl:
depend:
- lowrisc:prim:assert
files:
- rtl/prim_mubi_pkg.sv
file_type: systemVerilogSource

files_verilator_waiver:
depend:
# common waivers
- lowrisc:lint:common

files_ascentlint_waiver:
depend:
# common waivers
- lowrisc:lint:common
files:
- lint/prim_mubi.waiver
file_type: waiver

files_veriblelint_waiver:
depend:
# common waivers
- lowrisc:lint:common

targets:
default: &default_target
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- tool_veriblelint ? (files_veriblelint_waiver)
- files_rtl
2 changes: 1 addition & 1 deletion hw/ip/prim_generic/prim_generic_flash.core
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ filesets:
- "fileset_partner ? (partner:systems:ast_pkg)"
- "!fileset_partner ? (lowrisc:systems:ast_pkg)"
- lowrisc:ip_interfaces:flash_ctrl_pkg
- lowrisc:ip:flash_ctrl_prim_reg_top
- lowrisc:ip_interfaces:flash_ctrl_prim_reg_top
files:
- rtl/prim_generic_flash_bank.sv
- rtl/prim_generic_flash.sv
Expand Down
2 changes: 1 addition & 1 deletion hw/ip/tlul/headers.core
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ filesets:
depend:
- lowrisc:constants:top_pkg
- lowrisc:prim:secded
- lowrisc:prim:mubi
- lowrisc:prim:mubi_pkg
files:
- rtl/tlul_pkg.sv
file_type: systemVerilogSource
Expand Down
6 changes: 2 additions & 4 deletions hw/ip_templates/alert_handler/alert_handler.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ CAPI=2:
# SPDX-License-Identifier: Apache-2.0
name: ${instance_vlnv("lowrisc:ip:alert_handler:0.1")}
description: "Alert Handler"
virtual:
- lowrisc:ip_interfaces:alert_handler

filesets:
files_rtl:
depend:
- lowrisc:ip:alert_handler_component
- ${instance_vlnv("lowrisc:ip_interfaces:alert_handler_reg:0.1")}
- ${instance_vlnv("lowrisc:ip:alert_handler_component:0.1")}
- ${instance_vlnv("lowrisc:ip:alert_handler_reg:0.1")}
file_type: systemVerilogSource

parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CAPI=2:
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
name: "lowrisc:ip:alert_handler_component:0.1"
name: ${instance_vlnv("lowrisc:ip:alert_handler_component:0.1")}
description: "Alert Handler component without the CSRs"

filesets:
Expand All @@ -17,9 +17,8 @@ filesets:
- lowrisc:prim:buf
- lowrisc:prim:mubi
- lowrisc:prim:sparse_fsm
- lowrisc:ip_interfaces:alert_handler_reg
- ${instance_vlnv("lowrisc:ip:alert_handler_reg")}
files:
- rtl/alert_pkg.sv
- rtl/alert_handler_reg_wrap.sv
- rtl/alert_handler_lpg_ctrl.sv
- rtl/alert_handler_class.sv
Expand Down
44 changes: 44 additions & 0 deletions hw/ip_templates/alert_handler/alert_handler_pkg.core.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
CAPI=2:
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
name: ${instance_vlnv("lowrisc:ip:alert_handler_pkg:0.1")}
description: "Alert Handler constants in packages"
virtual:
- "lowrisc:ip_interfaces:alert_handler_pkg"

filesets:
files_rtl:
depend:
- lowrisc:tlul:headers
files:
- rtl/alert_handler_reg_pkg.sv
- rtl/alert_pkg.sv
file_type: systemVerilogSource

files_verilator_waiver:
depend:
# common waivers
- lowrisc:lint:common
- lowrisc:lint:comportable

files_ascentlint_waiver:
depend:
# common waivers
- lowrisc:lint:common
- lowrisc:lint:comportable

files_veriblelint_waiver:
depend:
# common waivers
- lowrisc:lint:common
- lowrisc:lint:comportable


targets:
default: &default_target
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- tool_veriblelint ? (files_veriblelint_waiver)
- files_rtl
5 changes: 1 addition & 4 deletions hw/ip_templates/alert_handler/alert_handler_reg.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ CAPI=2:
# SPDX-License-Identifier: Apache-2.0
name: ${instance_vlnv("lowrisc:ip:alert_handler_reg:0.1")}
description: "Auto-generated alert handler register sources"
virtual:
- "lowrisc:ip_interfaces:alert_handler_reg"

filesets:
files_rtl:
depend:
- lowrisc:tlul:headers
- lowrisc:prim:subreg
- lowrisc:ip:tlul
- lowrisc:prim:subreg
- ${instance_vlnv("lowrisc:ip:alert_handler_pkg")}
files:
- rtl/alert_handler_reg_pkg.sv
- rtl/alert_handler_reg_top.sv
file_type: systemVerilogSource

Expand Down
4 changes: 4 additions & 0 deletions hw/ip_templates/alert_handler/data/alert_handler.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ chars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
{ name: "N_ESC_SEV",
desc: "Number of escalation severities",
type: "int",
# NOTE: If this value is to be changed, ensure all IPs with
# prim_esc_receiver get updated as well.
default: "4",
local: "true"
},
Expand All @@ -139,6 +141,8 @@ chars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
{ name: "PING_CNT_DW",
desc: "Width of ping counter",
type: "int",
# NOTE: If this value is to be changed, ensure all IPs with
# prim_esc_receiver get updated as well.
default: "16",
local: "true"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,11 @@
type: "object"
default: []
}
{
name: "top_pkg_vlnv"
desc: "Provides the VLNV for the top_pkg used by this clkmgr"
type: "string"
default: "lowrisc:constants:top_pkg"
}
]
}
4 changes: 2 additions & 2 deletions hw/ip_templates/alert_handler/dv/alert_handler_sim.core.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ filesets:
files_dv:
depend:
- lowrisc:dv:ralgen
- lowrisc:dv:alert_handler_tb
- lowrisc:dv:alert_handler_cov
- ${instance_vlnv("lowrisc:dv:alert_handler_tb:0.1")}
- ${instance_vlnv("lowrisc:dv:alert_handler_cov:0.1")}
- ${instance_vlnv("lowrisc:dv:alert_handler_sva:0.1")}
file_type: systemVerilogSource

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ CAPI=2:
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
name: "lowrisc:dv:alert_handler_cov"
name: ${instance_vlnv("lowrisc:dv:alert_handler_cov:0.1")}
description: "ALERT_HANDLER cov bind files"
filesets:
files_dv:
depend:
- lowrisc:ip:alert_handler_component # import alert_pkg
- ${instance_vlnv("lowrisc:ip:alert_handler_component:0.1")} # import alert_pkg
- lowrisc:dv:dv_utils
files:
- alert_handler_cov_bind.sv
Expand Down
Loading
Loading