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

Merge cv32e40x/dev to cv32e40x/release #583

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
e4298d7
add basic infrastructure for new isa coverage agent
silabs-robin Mar 4, 2021
f3fa565
create skeleton for new isa monitor
silabs-robin Mar 5, 2021
4616d1d
create cntxt objects in uvma_isa_agent
silabs-robin Mar 5, 2021
c41e601
create an interface for isa coverage agent
silabs-robin Mar 5, 2021
16d5d22
connect isa monitor to tracer signals
silabs-robin Mar 5, 2021
88a0ca2
add monitor analysis port
silabs-robin Mar 5, 2021
7cb4b30
create skeleton cov_model and connect ap to monitor
silabs-robin Mar 5, 2021
0659600
send transactions from monitor to cov_model
silabs-robin Mar 5, 2021
0701299
add cfg to isa coverage agent
silabs-robin Mar 11, 2021
63db321
use cfg object within cov_model
silabs-robin Mar 11, 2021
d9ec9f8
fix new() prototypes in agent and mon
silabs-robin Mar 11, 2021
0e5846b
create a logger and connect to monitor
silabs-robin Mar 15, 2021
dd2bbb2
add minimal amount of isa cov logging
silabs-robin Mar 15, 2021
366085c
send instr-representing object from mon to cov
silabs-robin Mar 17, 2021
da1e869
define initial covergroup for instructions
silabs-robin Mar 17, 2021
e803d22
sample addi and ori
silabs-robin Mar 17, 2021
e29a863
add covergroup for u-type
silabs-robin Mar 17, 2021
094a86d
add R-type and S-type with example sampling
silabs-robin Mar 18, 2021
9427923
add cg for mulh and divu
silabs-robin Mar 19, 2021
2e8bb47
create and sample cg based on cfg flags
silabs-robin Mar 19, 2021
aff2736
add cg and sampling for entire i ext
silabs-robin Mar 19, 2021
bff4a9c
cover some RVC instructions
silabs-robin Mar 23, 2021
af53362
add initial coverage for csrrw instr
silabs-robin Mar 23, 2021
cc6f8af
add initial zifencei coverage
silabs-robin Mar 24, 2021
c645ead
add initial cg and sampling of all M instrs
silabs-robin Mar 24, 2021
22ded35
add initial cg and sample for all of Zicsr
silabs-robin Mar 24, 2021
84c6995
add initial cg and sampling for 0th quadrant of RVC
silabs-robin Mar 24, 2021
a9c3b7f
define initial cg and sample for RVC 1st quadrant
silabs-robin Mar 25, 2021
e27ba57
add initial cg and sample for C ext
silabs-robin Mar 25, 2021
46d9c75
run formatter to align expressions
silabs-robin Mar 25, 2021
13ebc5e
Merge remote-tracking branch 'upstream/cv32e40x/dev' into isa_agent_n…
silabs-robin Mar 26, 2021
389671c
apply the uvma_isa changes to 40x dir
silabs-robin Mar 26, 2021
02f6688
revert the uvma_isa changes from 40p dir
silabs-robin Mar 26, 2021
3c5e2f3
set uvma_isa default to disabled
silabs-robin Mar 26, 2021
ccc35a0
make uvma_isa unconditionally default to disabled
silabs-robin Mar 26, 2021
348a680
Merge pull request #540 from strichmo/cv32e40x/merge_rel_to_dev_1
MikeOpenHWGroup Mar 26, 2021
c9490f6
add spdx license ids
silabs-robin Mar 29, 2021
b3833ca
add agent name prefix to instr class
silabs-robin Mar 29, 2021
569b4f9
rename uvma_isa to uvma_isacov
silabs-robin Mar 29, 2021
ab986e7
comment on isacov_if and default cfg disable
silabs-robin Mar 29, 2021
7a85fe4
add CV_CORE_PATH for optionally having rtl repo dir symlinked locally
silabs-robin Mar 29, 2021
5c7e225
add initial dpi_dasm sources
silabs-robin Mar 30, 2021
1a086de
get dpi_dasm compiling to shared object
silabs-robin Mar 30, 2021
d4e543d
export DPI_DASM_ROOT and include dpi_dasm_imports.svh
silabs-robin Mar 30, 2021
8b1dab8
make dpi_dasm optional with the COV flag
silabs-robin Mar 30, 2021
b9baf89
begin replacing ad-hoc decoder w/ integrated disassembler
silabs-robin Mar 30, 2021
e854d26
Merge pull request #543 from silabs-robin/dutpath
MikeOpenHWGroup Mar 30, 2021
6bce30d
use disassembler to identify incoming instruction name
silabs-robin Mar 31, 2021
6974b08
add temporary tie offs to new signals in 40x dutwrap
silabs-robin Mar 31, 2021
dd6bac1
fix check for CV_CORE_PATH undefined
strichmo Mar 31, 2021
3944932
Merge pull request #546 from strichmo/strichmo/pr/make_symlink_fix
strichmo Mar 31, 2021
edde05f
Merge pull request #545 from silabs-robin/missing_wrapper_connections
strichmo Mar 31, 2021
263644d
update the cv32e40x hash
silabs-robin Mar 31, 2021
58b5c38
Merge pull request #547 from silabs-robin/update_40x_hash
strichmo Mar 31, 2021
f35e3f4
Merge pull request #533 from silabs-robin/isa_agent_newcg_repeat_40x
MikeOpenHWGroup Mar 31, 2021
962cf67
make USE_ISS work at run-time
strichmo Apr 2, 2021
29d40b2
point to e40x tracer with run-time iss
strichmo Apr 2, 2021
b84bd1f
test for metrics.json without iss
strichmo Apr 2, 2021
b60ed84
disable COMP option during run in metrics
strichmo Apr 2, 2021
4a40195
add USE_ISS as run-time flag in dsim
strichmo Apr 2, 2021
1b7ff4c
bump local e40x hash
strichmo Apr 3, 2021
5c7ebcb
remove ifdef ISS
strichmo Apr 3, 2021
299eb5e
add --iss switch to enable running without the ISS
strichmo Apr 5, 2021
1feb7f0
remove warnings from using yaml.load with different versions of PyYAML
strichmo Apr 5, 2021
0abb36f
import modified disasm.cc to avoid pseudo instrs
silabs-robin Apr 6, 2021
91cd0e6
refactor into sample_instr()
silabs-robin Apr 6, 2021
703215b
use dpi_dasm for all rv32i fields
silabs-robin Apr 6, 2021
88d6222
update to latest dpi_dasm.cxx
silabs-robin Apr 6, 2021
3406d35
point to proper openhwgroup repo with cv32e40x with run-time iss
strichmo Apr 6, 2021
7445858
Merge pull request #548 from strichmo/strichmo/pr/iss_run_time
MikeOpenHWGroup Apr 6, 2021
6c9c74d
make dpi_dasm usage non-default and document usage in readmes
silabs-robin Apr 6, 2021
ed2cde2
Ported EMBench intergration to 40x
silabs-mateilga Apr 7, 2021
8c14a4c
update the instructions in uvma_isacov/README.md
silabs-robin Apr 7, 2021
2d8b28b
Merge pull request #553 from silabs-mateilga/embench_port
strichmo Apr 7, 2021
64ac198
Merge branch 'cv32e40x/dev' into disasm
silabs-robin Apr 8, 2021
6f1e65c
add comment explaining the empty config file
silabs-robin Apr 9, 2021
a8f6d0a
add license header to the original content dpi_dasm files
silabs-robin Apr 9, 2021
e3ebdb7
fix memory leak by allowing transaction FIFO to continuously fill
strichmo Apr 13, 2021
1bd0fe0
unknown simulator should throw an exit code
strichmo Apr 13, 2021
d3932b8
run_embench will emit log message fro embench script for better debug…
strichmo Apr 13, 2021
3d3c229
do not emit yaml2make debug output by default
strichmo Apr 13, 2021
984b67d
Merge pull request #555 from strichmo/strichmo/pr/isa_cov_mem_leak_fix
MikeOpenHWGroup Apr 13, 2021
96c8e0a
fix coverage option in builds in cv_regress
strichmo Apr 13, 2021
6bb2f18
fix the group name in the vsif to align to the core under test
strichmo Apr 13, 2021
3aed5d3
add initial e40x testbench coverage vRefine file
strichmo Apr 13, 2021
46c4f12
Merge pull request #556 from strichmo/strichmo/pr/embench_log
MikeOpenHWGroup Apr 13, 2021
29022c4
remove no_iss job
strichmo Apr 14, 2021
246c28a
add UNR generated vRefines
strichmo Apr 14, 2021
b93d317
Merge pull request #557 from strichmo/strichmo/pr/e40x_cov
MikeOpenHWGroup Apr 14, 2021
8550874
Updated readme section on porting with .gitignore details
silabs-mateilga Apr 14, 2021
b2ef639
Merge pull request #558 from silabs-mateilga/embench_readme_update
MikeOpenHWGroup Apr 14, 2021
d4be7c6
Added WAVES_MEM option for tracing memories and large vectors
halfdan-dolva Apr 16, 2021
cb1a392
Merge pull request #562 from silabs-halfdan/pr/waves_mem_option
MikeOpenHWGroup Apr 16, 2021
2b52154
Fixed references in uvmt_cv32e40x_tb after moving controller and inte…
silabs-oysteink Apr 19, 2021
5744677
Updated core hash in Common.mk to latest (head).
silabs-oysteink Apr 19, 2021
7830913
Merge pull request #564 from silabs-oysteink/silabs-oysteink_controll…
MikeOpenHWGroup Apr 19, 2021
6b21765
Added a simple cycle count report to dhrystone
silabs-mateilga Apr 20, 2021
e397ca6
Merge pull request #566 from silabs-mateilga/dhrystone_count_update
strichmo Apr 20, 2021
b669ad0
Merge pull request #554 from silabs-robin/disasm
MikeOpenHWGroup Apr 20, 2021
8179c15
add switch to cv_regress to tune outstanding parallel sims with VSIF …
strichmo Apr 20, 2021
1181e54
Merge pull request #567 from strichmo/strichmo/pr/cv_regress_parallel
strichmo Apr 20, 2021
19cc805
add a rvalid_singles_stall config to mm_ram
silabs-robin Apr 21, 2021
ae5a7dc
ifdef guard functions using dpi_dasm
silabs-robin Apr 21, 2021
f7903f4
Merge pull request #568 from silabs-robin/bugfix_isacov_gui
MikeOpenHWGroup Apr 21, 2021
088b66a
Updated the mm_ram cycle counter with a print functionality
silabs-mateilga Apr 21, 2021
1875dc9
removed commented out code
silabs-mateilga Apr 21, 2021
1940982
Merge pull request #569 from silabs-robin/single_cycle_stalls
MikeOpenHWGroup Apr 21, 2021
a046c96
Merge pull request #570 from silabs-mateilga/cycle_counter_update
MikeOpenHWGroup Apr 21, 2021
ec72805
cleanup targets for dpi_dasm shared lib
strichmo Apr 22, 2021
6f5fbca
remove the DPI_DASM define as dpi_dasm should always be linked
strichmo Apr 22, 2021
4b7914e
add UVM field macros
strichmo Apr 22, 2021
9bcb3c0
use DPI_DASM prefix to all SPIKE variables to delineate unique usage …
strichmo Apr 23, 2021
f2298b8
Merge pull request #574 from strichmo/strichmo/pr/covg_dpi
MikeOpenHWGroup Apr 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ cva6/tests/riscv-compliance/
cva6/tests/riscv-tests/
uvm/riscv-dv/
riviera_results/
*/vendor_lib/dpi_dasm_spike/
16 changes: 8 additions & 8 deletions .metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
{
"name": "uvmt_cv32e40p",
"image": "cv32-simulation-tools:20200720.11.0-19102020",
"cmd": "cd cv32e40p/sim/uvmt; make corev-dv CV_CORE=cv32e40p SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results; make comp CV_CORE=cv32e40p SIMULATOR=dsim USE_ISS=YES DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results",
"wavesCmd": "cd cv32e40p/sim/uvmt; make corev-dv CV_CORE=cv32e40p SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results; make comp CV_CORE=cv32e40p SIMULATOR=dsim USE_ISS=YES DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1"
"cmd": "cd cv32e40p/sim/uvmt; make corev-dv CV_CORE=cv32e40p SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results; make comp CV_CORE=cv32e40p SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results",
"wavesCmd": "cd cv32e40p/sim/uvmt; make corev-dv CV_CORE=cv32e40p SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results; make comp CV_CORE=cv32e40p SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1"
},
{
"name": "uvmt_cv32e40p_compliance_build",
"image": "cv32-simulation-tools:20200720.11.0-19102020",
"cmd": "cd cv32e40p/sim/uvmt; make all_compliance; make comp CV_CORE=cv32e40p SIMULATOR=dsim USE_ISS=YES DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results",
"wavesCmd": "cd cv32e40p/sim/uvmt; make all_compliance; make comp CV_CORE=cv32e40p SIMULATOR=dsim USE_ISS=YES DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1"
"cmd": "cd cv32e40p/sim/uvmt; make all_compliance; make comp CV_CORE=cv32e40p SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results",
"wavesCmd": "cd cv32e40p/sim/uvmt; make all_compliance; make comp CV_CORE=cv32e40p SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1"
},
{
"name": "uvmt_cv32e40x",
"image": "cv32-simulation-tools:20200720.11.0-19102020",
"cmd": "cd cv32e40x/sim/uvmt; make corev-dv CV_CORE=cv32e40x SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results; make comp CV_CORE=cv32e40x SIMULATOR=dsim USE_ISS=YES DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results",
"wavesCmd": "cd cv32e40x/sim/uvmt; make corev-dv CV_CORE=cv32e40x SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results; make comp CV_CORE=cv32e40x SIMULATOR=dsim USE_ISS=YES DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1"
"cmd": "cd cv32e40x/sim/uvmt; make corev-dv CV_CORE=cv32e40x SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results; make comp CV_CORE=cv32e40x SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results",
"wavesCmd": "cd cv32e40x/sim/uvmt; make corev-dv CV_CORE=cv32e40x SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results; make comp CV_CORE=cv32e40x SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1"
},
{
"name": "uvmt_cv32e40x_compliance_build",
"image": "cv32-simulation-tools:20200720.11.0-19102020",
"cmd": "cd cv32e40x/sim/uvmt; make all_compliance; make comp CV_CORE=cv32e40x SIMULATOR=dsim USE_ISS=YES DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results",
"wavesCmd": "cd cv32e40x/sim/uvmt; make all_compliance; make comp CV_CORE=cv32e40x SIMULATOR=dsim USE_ISS=YES DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1"
"cmd": "cd cv32e40x/sim/uvmt; make all_compliance; make comp CV_CORE=cv32e40x SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results",
"wavesCmd": "cd cv32e40x/sim/uvmt; make all_compliance; make comp CV_CORE=cv32e40x SIMULATOR=dsim DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1"
}
]
},
Expand Down
4 changes: 4 additions & 0 deletions bin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ simulator for the purposes of ensuring a pull-request can be safely made. Note
be able to be executed in any directory where previously it required the user to *cd* to ci/. Please
refer to *ci_check*'s help utility for more details on options

If required, the step and compare ISS can be disabled for this regression by setting _--iss=0_

*Examples:*
> \# Run CI sanity regression on Xcelium<br>
% ci_check -s xrun<br>
> \# Run CI sanity regression on Xcelium with the ISS disabled<br>
% ci_check -s xrun --iss=0<br>
> \# Get help of all available options<br>
% ci_check --help

Expand Down
8 changes: 7 additions & 1 deletion bin/cfgyaml2make
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ def read_file(file):

stream = open(matches[0], 'r')
logger.debug('Reading cfg specification: {}'.format(matches[0]))
cfg_spec = yaml.load(stream)
# Newer PyYAMLs must specify explicit loader (policy) or will issue warnings
# Older PyYAMLs will not support the Loader argument
# So try the new way first, then catch to the old way
try:
cfg_spec = yaml.load(stream, Loader=yaml.FullLoader)
except AttributeError:
cfg_spec = yaml.load(stream)
stream.close()

# Validation
Expand Down
23 changes: 18 additions & 5 deletions bin/ci_check
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ parser.add_argument("-c", "--check_only", help="Check previosu results (do no
parser.add_argument("-k", "--keep", help="Keep previous cloned or generated files", action="store_true")
parser.add_argument("-v", "--verilator", help="Run Verilator on the CORE testbench", action="store_true")
parser.add_argument("-u", "--no_uvm", help="DO NOT run CI regression on the UVM testbench", action="store_true")
parser.add_argument('--iss', help='Force USE_ISS flag to each test run (use 0 or 1), default: Enabled')
parser.add_argument("--repo", help="Use this repo for the RTL, not one in Makefile", type=str)
parser.add_argument("--branch", help="Use this branch for the RTL, not one in Makefile", type=str)
parser.add_argument("--hash", help="Use this hash for the RTL, not one in Makefile", type=str)
Expand Down Expand Up @@ -183,7 +184,13 @@ def load_regress_yaml(regression):
'''Load the regression yaml and return the dictionary'''
full_regression = os.path.join(topdir, '{}/regress'.format(args.core.lower()), regression + '.yaml')
fh = open(full_regression, 'r')
dict = yaml.load(fh)
# Newer PyYAMLs must specify explicit loader (policy) or will issue warnings
# Older PyYAMLs will not support the Loader argument
# So try the new way first, then catch to the old way
try:
dict = yaml.load(fh, Loader=yaml.FullLoader)
except AttributeError:
dict = yaml.load(fh)
fh.close()

return dict
Expand Down Expand Up @@ -339,10 +346,16 @@ if (uvm):
except KeyError:
num = 1

try:
iss = key['iss']
except KeyError:
iss = 1
# The iss command-line switch takes precedence,
# Otherwise use what is in the regression yaml if defined
# Otherwise set to 1
if args.iss != None:
iss = int(args.iss)
else:
try:
iss = key['iss']
except KeyError:
iss = 1

for n in range(num):
# Add directory
Expand Down
25 changes: 22 additions & 3 deletions bin/cv_regress
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,14 @@ def is_test_indexed(project, name):
for t in test_dirs:
test_yaml = os.path.join(t, name, 'test.yaml')
if os.path.exists(test_yaml):
test_spec = yaml.load(open(test_yaml))
# Newer PyYAMLs must specify explicit loader (policy) or will issue warnings
# Older PyYAMLs will not support the Loader argument
# So try the new way first, then catch to the old way
try:
test_spec = yaml.load(open(test_yaml), Loader=yaml.FullLoader)
except AttributeError:
test_spec = yaml.load(open(test_yaml))

if '<RUN_INDEX>' in test_spec['name']:
return True
else:
Expand All @@ -104,8 +111,14 @@ def read_file(args, file):
'''Read a YAML definition filelist'''
full_regress_file = os.path.join(get_regress_path(args.project), file)
stream = open(full_regress_file, 'r')
logger.info('Reading regression: {}'.format(full_regress_file))
testlist = yaml.load(stream)
logger.info('Reading regression: {}'.format(full_regress_file))
# Newer PyYAMLs must specify explicit loader (policy) or will issue warnings
# Older PyYAMLs will not support the Loader argument
# So try the new way first, then catch to the old way
try:
testlist = yaml.load(stream, Loader=yaml.FullLoader)
except AttributeError:
testlist = yaml.load(stream)
stream.close()
pp = pprint.PrettyPrinter()
logger.debug('Read YAML:')
Expand Down Expand Up @@ -152,6 +165,8 @@ def read_file(args, file):
test.set_cov()
if args.make:
test.sub_make(args.make)
if args.iss != None:
test.iss = args.iss

# Determine if a test is valid, skip for compliance tests
# Since it is not possible to determine apriori if a compliance test is valid
Expand All @@ -173,6 +188,7 @@ DEFAULT_SIMULATOR = 'dsim'
VALID_PROJECTS = ('cv32e40p', 'cv32e40x', 'cv64')
DEFAULT_PROJECT = 'cv32e40p'
DEFAULT_CFG = 'default'
DEFAULT_PARALLEL = '30'

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
Expand All @@ -185,6 +201,8 @@ parser.add_argument('-d', '--debug', help='Emit debug messages from logger', act
parser.add_argument('-s', '--simulator', help='Select simulator', choices=VALID_SIMULATORS, default=DEFAULT_SIMULATOR)
parser.add_argument('-c', '--cov', help='Enable coverage', action='store_true')
parser.add_argument('--cfg', default=DEFAULT_CFG, help='Test configuration to test')
parser.add_argument('--iss', default=None, help='Force USE_ISS flag to each test run')
parser.add_argument('--parallel', default=DEFAULT_PARALLEL, help='For VSIF only, set number of parallel jobs')
parser.add_argument('-m', '--metrics', help='Select Metrics waves output', action='store_true')
parser.add_argument('-n', '--num', help='Force number of iterations for tests with multiple iteration')
parser.add_argument('--lsf', help='If applicable for output format, set LSF args to dispatch jobs')
Expand Down Expand Up @@ -266,6 +284,7 @@ if args.vsif:
out_fh.write(template.render(session=os.path.splitext(os.path.basename(args.outfile))[0],
results_path=get_results_path(args.project),
project=args.project,
parallel=args.parallel,
cfg=args.cfg,
regressions=regressions,
makeargs=' '.join(args.makearg) if args.makearg else '',
Expand Down
18 changes: 17 additions & 1 deletion bin/run_embench.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import sys
import subprocess
import jinja2
import glob
import re


Expand Down Expand Up @@ -216,7 +217,10 @@ def main():
#Check if benchmark run succeeded
if not run_passed(res.stdout, args.type):
logging.fatal(f"EMBench benchmark run failed")

log_file = get_log_file(args.core, paths, args.type)
if log_file:
logging.info('For more debug check EMBench log: {}'.format(log_file))
sys.exit(1)

if check_result(res.stdout, args.target, args.type) and args.target != 0:
print(f"Benchmark run met target")
Expand Down Expand Up @@ -324,6 +328,7 @@ def build_paths(core):
paths['libcfg'] = paths['core'] + '/tests/embench/config/corev32'
paths['libpy'] = paths['core'] + '/tests/embench/pylib'
paths['vlib'] = paths['core'] + '/vendor_lib'
paths['emb_logs'] = paths['core'] + '/vendor_lib/embench/logs'
paths['make'] = paths['core'] + '/sim/uvmt'
paths['embench'] = paths['vlib'] + '/embench'
paths['emcfg'] = paths['embench'] + '/config/corev32'
Expand Down Expand Up @@ -390,6 +395,17 @@ def check_python_version(major, minor):
log.error('ERROR: Requires Python {mjr}.{mnr} or later'.format(mjr=major, mnr=minor))
sys.exit(1)

def get_log_file(core, paths, log_type):
'''Find the log file from EMBench by looking for the latest touched file'''
last_mtime = 0
file = None
for f in glob.glob(os.path.join(paths['emb_logs'], '{}-*.log'.format(log_type))):
if last_mtime < os.stat(f).st_mtime:
last_mtime = os.stat(f).st_mtime
file = f

print('Latest log = {}'.format(file))
return file

#run main
if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions bin/templates/metrics.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

{% import 'regress_macros.j2' as regress_macros %}

{% set common_dsim_make_vars = "CV_CORE=" + project + " DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results" %}
{% set common_dsim_make_vars_waves = "CV_CORE=" + project + " DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1" %}
{% set common_dsim_make_vars = "CV_CORE=" + project + " COMP=0 DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results" %}
{% set common_dsim_make_vars_waves = "CV_CORE=" + project + " COMP=0 DSIM_WORK=/mux-flow/build/repo/dsim_work DSIM_RESULTS=/mux-flow/build/results WAVES=1" %}
[
{% for r in regressions %}
{% for t in r.tests.values()|sort(attribute='name') %}
Expand Down
2 changes: 1 addition & 1 deletion bin/templates/regress_macros.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{%- macro yesorno(val) -%}
{%- if val -%}YES{%- else -%}NO{%- endif -%}
{%- if val == '0' -%}NO{%- elif val == '1' -%}YES{%- elif val == True-%}YES{%- else -%}{{val}}{%- endif -%}
{%- endmacro -%}
2 changes: 1 addition & 1 deletion bin/templates/regress_sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ incr_test_counts () {

{% for b in unique_builds.values() %}
# Build:{{b.name}} {{b.description}}
{% set cmd = b.cmd + ' CV_CORE=' + project + ' CFG=' + cfg + ' SIMULATOR=' + b.simulator + ' USE_ISS=' + regress_macros.yesorno(b.iss) + ' COV=' + regress_macros.yesorno(b.cov) + makeargs %}
{% set cmd = b.cmd + ' CV_CORE=' + project + ' CFG=' + cfg + ' SIMULATOR=' + b.simulator + ' COV=' + regress_macros.yesorno(b.cov) + makeargs %}
echo "{{session}}: Running build: [cd {{b.abs_dir}} && {{cmd}}]"
pushd {{b.abs_dir}} > /dev/null
{{cmd}}
Expand Down
6 changes: 3 additions & 3 deletions bin/templates/regress_vsif.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ session {{session}} {
top_dir: {{results_path}}/vmgr_sessions;
{% if lsf %}
drm: lsf;
max_runs_in_parallel: 30;
max_runs_in_parallel: {{parallel}};
queuing_policy: round_robin;
default_dispatch_parameters: <text>{{lsf}}</text>;
{% endif %}
}

group cv32e40p {
group {{project}} {
{% if sve %}
sve_name: {{sve}};
{% endif %}
{% for b in unique_builds.values() %}
// Build:{{b.name}} {{b.description}}
pre_group_script: 'cd {{b.abs_dir}} && {{b.cmd}} CV_CORE={{project}} CFG={{cfg}} CV_SIM_PREFIX= SIMULATOR={{b.simulator}} USE_ISS={{b.iss}} COV={{regress_macros.yesorno(b.cov)}} {{makeargs}}';
pre_group_script: 'cd {{b.abs_dir}} && {{b.cmd}} CV_CORE={{project}} CFG={{cfg}} CV_SIM_PREFIX= SIMULATOR={{b.simulator}} COV={{regress_macros.yesorno(b.cov)}} {{makeargs}}';

{% endfor %}
{% for r in regressions %}
Expand Down
16 changes: 11 additions & 5 deletions bin/yaml2make
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ def read_file(test, type, run_index):

stream = open(matches[0], 'r')
logger.debug('Reading test specification: {}'.format(matches[0]))
test_spec = yaml.load(stream)
# Newer PyYAMLs must specify explicit loader (policy) or will issue warnings
# Older PyYAMLs will not support the Loader argument
# So try the new way first, then catch to the old way
try:
test_spec = yaml.load(stream, Loader=yaml.FullLoader)
except AttributeError:
test_spec = yaml.load(stream)
stream.close()
test_spec['test_dir'] = os.path.dirname(matches[0])

Expand Down Expand Up @@ -123,12 +129,12 @@ def emit_make(test_spec, prefix):
# Command-line arguments

parser = argparse.ArgumentParser()
parser.add_argument('-t', '--test', help='Test to look for')
parser.add_argument('-d', '--debug', action='store_true', help='Display debug messages')
parser.add_argument('--yaml', choices=VALID_YAMLS, help='Name of YAML test specification to find')
parser.add_argument('--prefix', help='Prefix to add to make variables generated')
parser.add_argument('-t', '--test', help='Required: Test to look for')
parser.add_argument('--yaml', choices=VALID_YAMLS, help='Required: Name of YAML test specification to find')
parser.add_argument('--core', default=DEFAULT_CORE, help='Default core to test')
parser.add_argument('--prefix', help='Prefix to add to make variables generated')
parser.add_argument('--run-index', default='0', help='Add a run index to append to test specifications')
parser.add_argument('-d', '--debug', action='store_true', help='Display debug messages')
args = parser.parse_args()

if args.debug:
Expand Down
14 changes: 13 additions & 1 deletion cv32e40p/tests/embench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,22 @@ unique files, dependencies in the core specific makefiles also exist.
Copy the embench configuration directory from cv32e40p to the new core:
>/core-v-verif/\[core\]/tests/embench

Copy the embench makefile defines(EMBENCH_*) from cv32e40p to the new core:
>/core-v-verif/\[core\]/sim/Common.mk

Copy over the embench directory under *programs*. This should be empty except for a readme file.
>/core-v-verif/\[core\]/tests/programs/embench

If there are no differences in configuration necessary compared to the cv32e40p, you are now done, and can

Make the following changes to the .gitignore files listed:<br>
| File | Add line |
|----------------------------------------------|----------|
| /core-v-verif/\[core\]/tests/.gitignore | emb_*/ |
| /core-v-verif/\[core\]/vendor_lib/.gitignore | embench/ |



<br>If there are no differences in configuration necessary compared to the cv32e40p, you are now done,
run the EMBench scripts in the manner described above. However, if there are notable differences,
a quick description on what to check follows. For full details, please check the EMBench [documentation](https://github.com/embench/embench-iot/blob/master/doc/README.md).<br>

Expand Down
Loading