diff --git a/CHANGELOG.md b/CHANGELOG.md index dd555f2..00186d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.24.0] - 2022-0514 +## [1.24.1] - 2022-07-19 +- Account for the same test to be included with both XLEN variants in the isa generation. +- Add markdown report for coverage statistics. + +## [1.24.0] - 2022-05-14 - rename the "master" branch of riscv-arch-test to "main" ## [1.23.4] - 2022-02-24 diff --git a/riscof/__init__.py b/riscof/__init__.py index a92aa25..c29a991 100644 --- a/riscof/__init__.py +++ b/riscof/__init__.py @@ -4,4 +4,4 @@ __author__ = """InCore Semiconductors Pvt Ltd""" __email__ = 'info@incoresemi.com' -__version__ = '1.24.0' +__version__ = '1.24.1' diff --git a/riscof/cli.py b/riscof/cli.py index 404abdb..26af62e 100644 --- a/riscof/cli.py +++ b/riscof/cli.py @@ -432,6 +432,10 @@ def coverage(ctx,config,work_dir,suite,env,no_browser,cgf_file): with open(reportfile, "w") as report: report.write(output) + with open(reportfile.replace("html","md"),"w") as report_md: + template = Template(constants.coverage_report_md) + report_md.write(template.render(report_objects)) + shutil.copyfile(constants.css, os.path.join(work_dir, "style.css")) diff --git a/riscof/constants.py b/riscof/constants.py index 0bbffaa..3cff010 100644 --- a/riscof/constants.py +++ b/riscof/constants.py @@ -40,4 +40,11 @@ pluginpath={1} ''' +coverage_report_md = ''' +|Covergroup|Coverage| +|:--------:|:------:| +{% for result in results %}|{{result.name}}|{{result.coverage}} ({{result.percentage}}%)| +{%endfor%} +''' + diff --git a/riscof/framework/main.py b/riscof/framework/main.py index c74238c..a6bb95f 100644 --- a/riscof/framework/main.py +++ b/riscof/framework/main.py @@ -126,10 +126,15 @@ def run_coverage(base, dut_isa_spec, dut_platform_spec, work_dir, cgf_file=None) 'test_size': [str(entry) for entry in find_elf_size(elf)], 'test_groups': str(set(test_list[entry[0]]['coverage_labels'])) }) + flen = 0 + if 'F' in ispec['ISA']: + flen = 32 + elif 'D' in ispec['ISA']: + flen = 64 if 64 in ispec['supported_xlen']: - results = isac.merge_coverage(cov_files, expand_cgf(cgf_file,64), True, 64) + results = isac.merge_coverage(cov_files, expand_cgf(cgf_file,64,flen), True) elif 32 in ispec['supported_xlen']: - results = isac.merge_coverage(cov_files, expand_cgf(cgf_file,32), True, 32) + results = isac.merge_coverage(cov_files, expand_cgf(cgf_file,32,flen), True) # results_yaml = yaml.load(results) @@ -165,7 +170,7 @@ def run(dut, base, dut_isa_spec, dut_platform_spec, work_dir, cntr_args): :param dut_platform_spec: The absolute path to the checked yaml containing the DUT platform specification. - + :param cntr_args: dbfile, testfile, no_ref_run, no_dut_run :type dut_platform_spec: str @@ -184,7 +189,7 @@ def run(dut, base, dut_isa_spec, dut_platform_spec, work_dir, cntr_args): #Loading Specs ispec = utils.load_yaml(dut_isa_spec) pspec = utils.load_yaml(dut_platform_spec) - + if cntr_args[2]: logger.info("Running Build for DUT") dut.build(dut_isa_spec, dut_platform_spec) diff --git a/riscof/framework/test.py b/riscof/framework/test.py index 3141d3d..8ccde63 100644 --- a/riscof/framework/test.py +++ b/riscof/framework/test.py @@ -298,19 +298,15 @@ def prod_isa(dut_isa, test_isa): isa = set([]) last_prefix = '' atleast_1 = False - + match = re.findall("(?PRV(64|128|32)(I|E))",dut_isa) + prefix = match[0][0] for entry in test_isa: match = re.findall("(?PRV(64|128|32)(I|E))",entry) - prefix = match[0][0] exts = isa_set(re.sub("RV(64|128|32)(I|E)","",entry)) overlap = dut_exts & exts - if overlap == exts: + if overlap == exts and match[0][0] == prefix: atleast_1 = True isa = isa | overlap - if last_prefix: - if last_prefix != prefix: - raise TestSelectError("Incompatiple prefix for valid ISA strings in test.") - last_prefix = prefix if not atleast_1: raise TestSelectError("Test Selected without the relevant extensions being available on DUT.") return prefix+canonicalise(isa) diff --git a/setup.cfg b/setup.cfg index c8ee5d8..3885ae7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.24.0 +current_version = 1.24.1 commit = True tag = True diff --git a/setup.py b/setup.py index b91926d..fb0757c 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ def read_requires(): test_requirements = [ ] setup(name="riscof", - version='1.24.0', + version='1.24.1', description="RISC-V Architectural Test Framework", long_description=readme + '\n\n', classifiers=[