Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from riscv-software-src/fp-dev
Browse files Browse the repository at this point in the history
Feature support for FP extensions.
  • Loading branch information
neelgala authored Aug 12, 2022
2 parents bb2e6d1 + acd5220 commit b3f81ef
Show file tree
Hide file tree
Showing 10 changed files with 4,349 additions and 4,197 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.14.0] - 2022-08-08
- Add fields to instruction object
- Enable generic coverage evaluation mechanisms for floating point instructions
- Fix coverpoint generation to account for nan boxing of fp instructions.
- Add fields(frm, fcsr, nan_prefix) for fp instructions

## [0.13.2] - 2022-05-23
- Error reporting for missing coverlabel in cgf file

Expand Down
2 changes: 1 addition & 1 deletion riscv_isac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__author__ = """InCore Semiconductors Pvt Ltd"""
__email__ = '[email protected]'
__version__ = '0.13.2'
__version__ = '0.14.0'
17 changes: 11 additions & 6 deletions riscv_isac/cgf_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,24 +548,26 @@ def alternate(var, size, signed=True, fltr_func=None,scale_func=None):
#return [(coverpoint,"Alternate") for coverpoint in coverpoints]


def expand_cgf(cgf_files, xlen):
def expand_cgf(cgf_files, xlen,flen):
'''
This function will replace all the abstract functions with their unrolled
coverpoints. It replaces node
:param cgf_files: list of yaml file paths which together define the coverpoints
:param xlen: XLEN of the riscv-trace
:param xlen: XLEN of the DUT/Configuration
:param flen: FLEN of the DUT/Configuration
:type cgf: list
:type xlen: int
:type flen: int
'''
cgf = utils.load_cgf(cgf_files)
for labels, cats in cgf.items():
if labels != 'datasets':
# If 'opcode' found, rename it to 'mnemonics'
if 'opcode' in cats:
logger.warning("Deprecated node used: 'opcode'. Use 'mnemonics' instead")

temp = cgf[labels]['opcode']
del cgf[labels]['opcode']
cgf[labels].insert(1, 'mnemonics', temp)
Expand All @@ -577,20 +579,23 @@ def expand_cgf(cgf_files, xlen):
if len(cgf[labels]['mnemonics'].keys()) > 1:
logger.error(f'Multiple instruction mnemonics found when base_op label defined in {labels} label.')

l = len(cats.items())
i = 0
for label,node in cats.items():
if isinstance(node,dict):
if 'abstract_comb' in node:
temp = node['abstract_comb']
del node['abstract_comb']

for coverpoints, coverage in temp.items():
i = 0
try:
exp_cp = eval(coverpoints)
except Exception as e:
pass
logger.error("Error evaluating abstract comb: "+(coverpoints)\
+" in "+labels+": "+str(e) )
else:
for cp,comment in exp_cp:
cgf[labels][label].insert(1,cp,coverage,comment=comment)
cgf[labels][label].insert(l+i,cp,coverage,comment=comment)
i += 1
return dict(cgf)

Loading

0 comments on commit b3f81ef

Please sign in to comment.