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 #37 from edwin7026/coverage_calc_time
Browse files Browse the repository at this point in the history
Decrease coverage calculation time
  • Loading branch information
neelgala authored Apr 27, 2022
2 parents 5a70060 + b4213bd commit a4505bc
Show file tree
Hide file tree
Showing 8 changed files with 616 additions and 364 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

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

## [0.12.0] - 2022-04-15
- Parallelized coverage computation.
- Added feature to remove coverpoints when hit.
- Added CLI option to specify number of processes to be spawned.
- Added CLI option to turn on/off feature to remove hit coverpoints.

## [0.11.0] - 2022-04-03
- Added plugins to use new rvopcode format
- Added CLI option to setup rvopcode plugin

## [0.10.2] - 2022-03-15
- Added method to generate data patterns for bitmanip instructions
-

## [0.10.1] - 2022-02-10
- Added vxsat to supported csr_regs
- Added comments to coverpoint functions for P-ext
Expand Down
48 changes: 48 additions & 0 deletions docs/source/isac_cov_calc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
********************************
Performance improvements to ISAC
********************************

Coverage computation in ISAC is an iterative process where all coverpoints
are evaluated for every instruction. This causes an exponential increase in coverage
computation time as the number of coverpoints increases. Following are methods leveraged to produce
performance improvements to ISAC.

Parallelized coverage calculation
#################################

Parallelization is one way to reduce the time taken to compute the coverage.
Parallelization of coverage computation is achieved by the parallelization of ``compute_per_line()``
method in ``coverage.py`` file. The implementation resorts to the use of queues to relay statistics of hit
coverpoint back to the main process.

Usage
*****
The number of processes to be spawned for coverage computation can be provided using,
``--procs`` or ``-p`` option while running ISAC. As an example, ::
riscv_isac --verbose info coverage -d -t add-01.log --parser-name c_sail --decoder-name internaldecoder -o coverage.rpt --sig-label begin_signature end_signature --test-label rvtest_code_begin rvtest_code_end -e add-01.elf -c dataset.cgf -c rv32i.cgf -x 32 -l add --procs 3

The above command partitions the supplied CGF file into three different sets based on the coverlabels. Three processes would be
spawned and are supplied with a part of the partitioned CGF file dictionary. Each of the processes are asynchronously supplied with ``instructionObject``
objects via independent queues. The processes compute coverage independently against the decoded ``instructionObject`` with its own set of coverlabels
and its respective coverpoints. The updated cgf dictionary and coverpoint hit statistics are relayed back to the main process through a queue.
The cgf dictionary and the statistics are merged before continuing further.

The default number of processes spawned is 1

Removal of Hit Coverpoints from CGF Dictionary
##############################################

For architectural testing, it is enough if a coverpoint is hit just once and has impact on the signature. When this feature
is enabled, coverpoints would be deleted from the working CGF dictionary once hit to avoid evaluating it for all subsequent
instructions.

Usage
*****
This feature can be enabled using the ``--no-count`` option while running ISAC. As an example, ::

riscv_isac --verbose info coverage -d -t add-01.log --parser-name c_sail --decoder-name internaldecoder -o coverage.rpt --sig-label begin_signature end_signature --test-label rvtest_code_begin rvtest_code_end -e add-01.elf -c dataset.cgf -c rv32i.cgf -x 32 -l add --no-count

When ``--no-count`` option supplied, the hit coverpoints are stored and are then deleted from the CGF dictionary at the end of every iteration

This feature is off by default.
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.11.0'
__version__ = '0.12.0'
Loading

0 comments on commit a4505bc

Please sign in to comment.