Skip to content

Commit

Permalink
Merge pull request #2323 from silabs-robin/s_dev2rel
Browse files Browse the repository at this point in the history
Merge - s/dev into s/release
  • Loading branch information
silabs-robin authored Dec 12, 2023
2 parents 26b0c8c + 97aae52 commit 84f314b
Show file tree
Hide file tree
Showing 588 changed files with 32,852 additions and 159,235 deletions.
1 change: 0 additions & 1 deletion backup

This file was deleted.

29 changes: 22 additions & 7 deletions bin/clonetb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@
# (Typical usage does not require these to be set.)
# CV_CORE - Name of the core to use.
# VERIF_ENV_REPO - URL to external verif env repo.
# VERIF_ENV_BRANCH - Branch name of external verif env repo.
# VERIF_ENV_REF - Branch/hash/tag of external verif env repo.


usage() {
echo "usage: $0 [-x] [--clone] [--ignore] [--unignore]"
echo " -x clone cv32e40x subtree"
echo " --clone clone subtree based on env vars"
echo " -x clone cv32e40x subtree, known stable hash"
echo " --x-main clone cv32e40x subtree, latest main branch"
echo " --clone clone a subtree based on env vars"
echo " --ignore tell git to ignore the cloned subtree"
echo " --unignore tell git to not ignore the cloned subtree"

Expand All @@ -62,8 +63,8 @@ check_env_vars() {
exit 1
fi

if [ -z "${VERIF_ENV_BRANCH}" ]; then
echo "error: 'VERIF_ENV_BRANCH' not defined"
if [ -z "${VERIF_ENV_REF}" ]; then
echo "error: 'VERIF_ENV_REF' not defined"
exit 1
fi
}
Expand All @@ -72,13 +73,24 @@ clone() {
check_env_vars

rm -rf ${CV_CORE}
git clone -b ${VERIF_ENV_BRANCH} ${VERIF_ENV_REPO} ${CV_CORE}
git clone ${VERIF_ENV_REPO} ${CV_CORE}
cd ${CV_CORE} && git checkout ${VERIF_ENV_REF} && cd -

}

clone_cv32e40x() {
CV_CORE=cv32e40x
VERIF_ENV_REPO=https://github.com/openhwgroup/cv32e40x-dv.git
VERIF_ENV_BRANCH=main
VERIF_ENV_REF=be17b8902002f91803abde4bfb8caa91088575e1
clone

ignore_cloned_directory
}

clone_cv32e40x_main() {
CV_CORE=cv32e40x
VERIF_ENV_REPO=https://github.com/openhwgroup/cv32e40x-dv.git
VERIF_ENV_REF=main

clone

Expand Down Expand Up @@ -113,6 +125,9 @@ main() {
"-x")
clone_cv32e40x
;;
"--x-main")
clone_cv32e40x_main
;;
"--clone")
clone
;;
Expand Down
81 changes: 81 additions & 0 deletions bin/csv2json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env python3


# Copyright 2023 Silicon Labs, Inc.
#
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
#
# Licensed under the Solderpad Hardware License v 2.1 (the "License"); you may
# not use this file except in compliance with the License, or, at your option,
# the Apache License version 2.0.
#
# You may obtain a copy of the License at
# https://solderpad.org/licenses/SHL-2.1/
#
# Unless required by applicable law or agreed to in writing, any work
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.


"""
Description:
Converts ".csv" vplans to ".json".
Rationale:
It is an alternative to the ".csv" vplans, which in some cases might be
easier to review.
Usage:
Run it on a ".csv" vplan.
"""


import csv
import json
import sys


# Check correct usage

if len(sys.argv) != 2:
message = "usage: {} <csv vplan>".format(sys.argv[0])
sys.exit(message)


# Read ".csv"

csv_filename = sys.argv[1]
csv_file = open(csv_filename, 'r', encoding='utf-8')
csv_reader = csv.DictReader(csv_file)


# Fill empty cells (with value of above cell)

csv_rows = []
csv_row_previous = None

def should_fill_cell(cell_value, previous_row, row_key):
cell_is_empty = not cell_value
previous_row_exists = previous_row
column_should_repeat = row_key in ['Feature', 'Verification Goal']
return cell_is_empty and previous_row_exists and column_should_repeat

for row in csv_reader:
for key, value in row.items():
if should_fill_cell(value, csv_row_previous, key):
row[key] = csv_row_previous[key]

csv_rows.append(row)
csv_row_previous = row


# Write ".json"

json_string = json.dumps(csv_rows, indent = 4)
json_filename = csv_filename.replace(".csv", ".json")
json_file = open(json_filename, 'w', encoding='utf-8')

json_file.write(json_string)
9 changes: 7 additions & 2 deletions bin/cv_regress
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def read_file(args, file):
test.sub_make(args.make)
if args.iss != None:
test.iss = args.iss
else:
args.iss = 'YES'
if args.cfg:
test.cfg = args.cfg
if not test.builds and test.build:
Expand Down Expand Up @@ -255,7 +257,8 @@ if args.sh:
results=args.results,
makeargs=' '.join(args.makearg) if args.makearg else '',
session=os.path.splitext(os.path.basename(args.outfile))[0],
unique_builds=unique_builds))
unique_builds=unique_builds,
iss=''.join(args.iss) if args.iss else ''))
out_fh.close()
os.chmod(args.outfile, 0o775)

Expand All @@ -269,6 +272,7 @@ if args.metrics:
cfg=args.cfg,
toolchain=args.toolchain,
makeargs=' '.join(args.makearg) if args.makearg else '',
iss=''.join(args.iss) if args.iss else '',
unique_builds=unique_builds))
out_fh.close()
os.chmod(args.outfile, 0o775)
Expand All @@ -291,7 +295,8 @@ if args.vsif:
toolchain=args.toolchain,
simulator=args.simulator,
filter_dir=get_filter_dir(),
unique_builds=unique_builds))
unique_builds=unique_builds,
iss=''.join(args.iss) if args.iss else ''))
out_fh.close()

# Generate a Vmanager-compatible SVE
Expand Down
Loading

0 comments on commit 84f314b

Please sign in to comment.