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

Support for cross combination coverpoint test generation #44

Merged
merged 53 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
dec9db8
cross_comb definition
edwin7026 May 5, 2022
4b3c081
Data-structure
edwin7026 May 5, 2022
64e4320
Supporting Datastructures for cross_comb
edwin7026 May 5, 2022
ca72105
Moved supporting datastructures for cross_comb
edwin7026 May 5, 2022
35e097b
Instruction selection CSP
edwin7026 May 5, 2022
b0d8b08
Choosing instructions from alias yaml
edwin7026 May 13, 2022
fe0d151
Restore to earlier version
edwin7026 May 15, 2022
2fbe8d8
Move cross_comb to separate file
edwin7026 May 15, 2022
30d9cc4
Cleanup
edwin7026 May 15, 2022
e4be67e
Generate operand values
edwin7026 May 17, 2022
2bcb9aa
Complete operand value generation
edwin7026 May 19, 2022
d222ce5
Generation of immediates
edwin7026 May 19, 2022
e2489b4
Handle instruction lists
edwin7026 May 19, 2022
5625995
Comments
edwin7026 May 19, 2022
c34716b
Code cleanup
edwin7026 May 19, 2022
a18b3ae
Cleanup
edwin7026 May 25, 2022
3bf0007
Generate test
edwin7026 May 25, 2022
bd43afd
Upstream fetch
edwin7026 May 25, 2022
5b9495c
Say hello to cross-comb :)
edwin7026 May 25, 2022
2bad0da
Banner for cross-comb
edwin7026 May 25, 2022
c81e79c
Integration
edwin7026 May 25, 2022
94c6890
Cleanup
edwin7026 May 25, 2022
6032524
Handle dataset node
edwin7026 May 27, 2022
9d10270
Instruction formats
edwin7026 May 29, 2022
33b2453
Floating point support and limit initialization
edwin7026 May 30, 2022
525da04
Support for floating point instructions
edwin7026 Jun 2, 2022
7cacdf7
Correction to register initialization
edwin7026 Jun 2, 2022
836099a
Formatting
edwin7026 Jun 6, 2022
a348f52
Remove Instruction Alias
edwin7026 Jun 6, 2022
b784845
Documentation
edwin7026 Jun 6, 2022
3b11580
Formatting
edwin7026 Jun 6, 2022
fe5373d
Format
edwin7026 Jun 7, 2022
bf20ead
Format
edwin7026 Jun 7, 2022
94982f4
Code block formatting
edwin7026 Jun 7, 2022
1de5afa
Code cleanup
edwin7026 Jun 7, 2022
5eb7b69
Link
edwin7026 Jun 7, 2022
62d479b
Formatting
edwin7026 Jun 7, 2022
29fdc0d
More info
edwin7026 Jun 7, 2022
2273cdf
Report invalid instruction error appropriately
edwin7026 Jun 7, 2022
3639627
Floating point instruction rd initialization
edwin7026 Jun 7, 2022
1fc8e8c
Note about load/store/branch
edwin7026 Jun 7, 2022
7bf67f2
File path correction
edwin7026 Jun 7, 2022
79a444f
File path correction
edwin7026 Jun 7, 2022
158d536
Comments and TODOs
edwin7026 Jun 7, 2022
2eedab9
Merge branch 'master' into cross_comb
edwin7026 Aug 25, 2022
8a889c6
Merge pull request #1 from edwin7026/cross_comb
edwin7026 Aug 25, 2022
7637484
Load mutilple template files for cross
edwin7026 Aug 25, 2022
0acc2ce
Template files integration to cross_comb.py
edwin7026 Aug 25, 2022
1400bad
Bug fixes
edwin7026 Aug 25, 2022
a88a7d9
Update CHANGELOG.md
edwin7026 Aug 25, 2022
5a27ce0
Merge pull request #2 from edwin7026/cross_comb
edwin7026 Aug 25, 2022
3fe1582
Bump version: 0.8.0 → 0.9.0
edwin7026 Aug 25, 2022
7668daa
Fixed hardcoded flen value bug.
pawks Aug 29, 2022
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

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

## [0.9.0] - 2022-08-25
- Added support for cross_comb coverpoint test generation

## [0.8.0] - 2022-08-08
- Added support for a distributed template database.
- Added generic mechanisms to generate data sections based on test instances.
Expand Down
35 changes: 35 additions & 0 deletions docs/source/cross_comb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
************************************************
Test Generation using Cross Coverage Coverpoints
************************************************

Coverpoints constituting multiple instructions can help identify interesting instruction
sequences which have architectural significance such as structural hazards and data hazards.
The coverpoint node associated with the test generation is ``cross_comb`` defined `here <https://riscv-isac.readthedocs.io/en/stable/cgf.html>`_.

The test generator employs a constraint solver to generate relevant instruction sequence for a
``cross_comb`` coverpoint.

Example
-------

**Coverpoint Definition**

An example cross combination coverpoint is given below: ::

add:
cross_comb:
"[add : ? : rv32i_arith : ? : sub] :: [a=rd : ? : ? : ? : ?] :: [? : rs1==a or rs2==a : rs1==a or rs2==a : rs1==a or rs2==a : rd==a]"

**Possible assembly sequence**

A possible sequence of instructions CTG would generate is: ::

add x3, x3, x4
addi x5, x3, 1
sub x6, x4, x3
addi x4, x3, -3
sub x3, x5, x6

The test generator also embeds appropriate macros for initialization of registers and signature region pointing registers.

Note: The cross-combination test generator as of now, does not support load, store and branch instructions
2 changes: 1 addition & 1 deletion riscv_ctg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

__author__ = """InCore Semiconductors Pvt Ltd"""
__email__ = '[email protected]'
__version__ = '0.8.0'
__version__ = '0.9.0'

29 changes: 29 additions & 0 deletions riscv_ctg/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ def gen_bitmanip_dataset(bit_width,sign=True):
// This assembly file tests the $opcode instruction of the RISC-V $extension extension for the $label covergroup.
// '''

cross_comment_template = '''
// This assembly file is used for the test of cross-combination coverpoint described in $label covergroup.
'''

test_template = Template(copyright_string + comment_template+'''
#include "model_test.h"
#include "arch_test.h"
Expand All @@ -240,6 +244,31 @@ def gen_bitmanip_dataset(bit_width,sign=True):
$sig
RVMODEL_DATA_END
''')

cross_test_template = Template(copyright_string + cross_comment_template+'''
#include "model_test.h"
#include "arch_test.h"
RVTEST_ISA("$isa")

.section .text.init
.globl rvtest_entry_point
rvtest_entry_point:
RVMODEL_BOOT
RVTEST_CODE_BEGIN
$test

RVTEST_CODE_END
RVMODEL_HALT

RVTEST_DATA_BEGIN
$data
RVTEST_DATA_END

RVMODEL_DATA_BEGIN
$sig
RVMODEL_DATA_END
''')

case_template = Template('''
RVTEST_CASE($num,"//$cond;def TEST_CASE_1=True;",$cov_label)
''')
Expand Down
Loading