-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add dual-core configuration in testbench - Add number of cores parameter for consistent CLINT/PLIC generation - Add PLIC configuration file generation according to number of cores - Bump nonfree to version with baremetal SMP tests
- Loading branch information
Showing
6 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ VLOG_ARGS ?= -suppress 2583 -suppress 13314 -timescale 1ns/1ps | |
|
||
# Common Bender flags for Cheshire RTL | ||
CHS_BENDER_RTL_FLAGS ?= -t rtl -t cva6 -t cv64a6_imafdcsclic_sv39 | ||
NUM_CORES ?= 1 | ||
|
||
# Define used paths (prefixed to avoid name conflicts) | ||
CHS_ROOT ?= $(shell $(BENDER) path cheshire) | ||
|
@@ -62,7 +63,7 @@ chs-clean-deps: | |
###################### | ||
|
||
CHS_NONFREE_REMOTE ?= [email protected]:pulp-restricted/cheshire-nonfree.git | ||
CHS_NONFREE_COMMIT ?= fd3526f | ||
CHS_NONFREE_COMMIT ?= 1deb6804931b6ded1ec282b0766d0501ff8ce734 | ||
|
||
CHS_PHONY += chs-nonfree-init | ||
chs-nonfree-init: | ||
|
@@ -86,12 +87,15 @@ $(CHS_ROOT)/hw/regs/cheshire_reg_pkg.sv $(CHS_ROOT)/hw/regs/cheshire_reg_top.sv: | |
$(REGTOOL) -r $< --outdir $(dir $@) | ||
|
||
# CLINT | ||
CLINTCORES ?= 1 | ||
CLINTCORES ?= $(NUM_CORES) | ||
include $(CLINTROOT)/clint.mk | ||
$(CLINTROOT)/.generated: | ||
flock -x $@ $(MAKE) clint && touch $@ | ||
|
||
# OpenTitan peripherals | ||
$(CHS_ROOT)/hw/rv_plic.cfg.hjson: $(CHS_ROOT)/util/gen_pliccfg.py | ||
$(CHS_ROOT)/util/gen_pliccfg.py --num-cores $(NUM_CORES) > $@ | ||
|
||
include $(OTPROOT)/otp.mk | ||
$(OTPROOT)/.generated: $(CHS_ROOT)/hw/rv_plic.cfg.hjson | ||
flock -x $@ sh -c "cp $< $(dir $@)/src/rv_plic/; $(MAKE) -j1 otp" && touch $@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Paul Scheffler <[email protected]> | ||
// Enrico Zelioli <[email protected]> | ||
// AUTOMATICALLY GENERATED by gen_pliccfg.py; edit the script instead. | ||
|
||
{ | ||
instance_name: "rv_plic", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright 2022 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Nicole Narr <[email protected]> | ||
# Christopher Reinwardt <[email protected]> | ||
# | ||
# Fabian Schuiki <[email protected]> | ||
# Florian Zaruba <[email protected]> | ||
# Stefan Mach <[email protected]> | ||
# Thomas Benz <[email protected]> | ||
# Paul Scheffler <[email protected]> | ||
# Wolfgang Roenninger <[email protected]> | ||
# Gianna Paulin <[email protected]> | ||
# Tim Fischer <[email protected]> | ||
# Enrico Zelioli <[email protected]> | ||
|
||
import os | ||
import argparse | ||
|
||
# Parse arguments. | ||
parser = argparse.ArgumentParser(description="Generate rv_plic.cfg.hjson") | ||
parser.add_argument( | ||
"--num-cores", | ||
"-n", | ||
dest="num_cores", | ||
default=1, | ||
type=int, | ||
help= | ||
"Number of cores attached to the PLIC. The number of PLIC targets is set accordingly (2 * num-cores)" | ||
) | ||
args = parser.parse_args() | ||
|
||
num_targets = args.num_cores * 2 | ||
|
||
# Emit the code. | ||
print(""" | ||
// Copyright 2022 ETH Zurich and University of Bologna. | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Paul Scheffler <[email protected]> | ||
// Enrico Zelioli <[email protected]> | ||
// AUTOMATICALLY GENERATED by {script}; edit the script instead. | ||
{{ | ||
instance_name: \"rv_plic\", | ||
param_values: {{ | ||
src: 58, | ||
target: {targets}, // We need *two targets* per hart: M and S modes | ||
prio: 7, | ||
nonstd_regs: 0 // Do *not* include these: MSIPs are not used and we use a 64 MiB address space | ||
}}, | ||
}} | ||
""".strip().format( | ||
script=os.path.basename(__file__), | ||
targets=num_targets | ||
)) |