Skip to content

Commit

Permalink
Trap DV plan: first version
Browse files Browse the repository at this point in the history
  • Loading branch information
ASintzoff committed Nov 10, 2023
1 parent 7872d01 commit 619c0c4
Show file tree
Hide file tree
Showing 16 changed files with 1,572 additions and 0 deletions.
664 changes: 664 additions & 0 deletions verif/docs/VerifPlans/source/dvplan_traps.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions verif/docs/VerifPlans/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ CV32A6-step1 Design Verification Plan
dvplan_AXI
dvplan_FENCEI
dvplan_csr-access
dvplan_traps

34 changes: 34 additions & 0 deletions verif/docs/VerifPlans/traps/VP_IP000.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
!Feature
next_elt_id: 1
name: Illegal Instruction
id: 0
display_order: 0
subfeatures: !!omap
- 000_illegal_instr: !Subfeature
name: 000_illegal_instr
tag: VP_traps_F000_S000
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F000_S000_I000
description: Opcodes that do not decode to a valid, supported instruction
for the CVA6 core configuration shall raise an illegal instruction exception.
reqt_doc: Unprivileged ISA Version 20191213, Chapter 1.5
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when executing any illegal instruction, an exception
is raised with `mcause` CSR set to 0x2.
pfc: 3
test_type: 3
cov_method: 3
cores: 56
coverage_loc: ''
comments: Covered by ISACOV
vptool_gitrev: '$Id: b0efb3ae3f9057b71a577d43c2b77f1cfb2ef82f $'
io_fmt_gitrev: '$Id: 7ee5d68801f5498a957bcbe23fcad87817a364c5 $'
config_gitrev: '$Id: 0422e19126dae20ffc4d5a84e4ce3de0b6eb4eb5 $'
ymlcfg_gitrev: '$Id: 286c689bd48b7a58f9a37754267895cffef1270c $'
33 changes: 33 additions & 0 deletions verif/docs/VerifPlans/traps/VP_IP001.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
!Feature
next_elt_id: 1
name: Load x0
id: 1
display_order: 1
subfeatures: !!omap
- 000_load_x0: !Subfeature
name: 000_load_x0
tag: VP_traps_F001_S000
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F001_S000_I000
description: '`x0` register cannot have a value loaded into it but does not
generate an exception when that is attempted, as the exception is not implemented.'
reqt_doc: Unprivileged ISA Version 20191213, Chapter 2.6
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that loading to `x0` register does not cause an exception.
pfc: 3
test_type: 3
cov_method: 1
cores: 56
coverage_loc: ''
comments: ''
vptool_gitrev: '$Id: b0efb3ae3f9057b71a577d43c2b77f1cfb2ef82f $'
io_fmt_gitrev: '$Id: 7ee5d68801f5498a957bcbe23fcad87817a364c5 $'
config_gitrev: '$Id: 0422e19126dae20ffc4d5a84e4ce3de0b6eb4eb5 $'
ymlcfg_gitrev: '$Id: 286c689bd48b7a58f9a37754267895cffef1270c $'
54 changes: 54 additions & 0 deletions verif/docs/VerifPlans/traps/VP_IP002.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
!Feature
next_elt_id: 1
name: CSR Access
id: 2
display_order: 2
subfeatures: !!omap
- 000_CSR_access: !Subfeature
name: 000_CSR_access
tag: VP_traps_F002_S000
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F002_S000_I000
description: Attempted access to non-existent CSRs will generate an illegal
instruction exception.
reqt_doc: Privileged Architecture Version 20211203, Chapter 2.1
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when accessing any non-existent CSR, an exception
is raised with `mcause` set to 0x2.
pfc: -1
test_type: -1
cov_method: -1
cores: 56
coverage_loc: ''
comments: "Covered by CSR DV plan.\nVerify if `mcause` value check is covered\
\ by CSR DV plan."
- '001': !VerifItem
name: '001'
tag: VP_traps_F002_S000_I001
description: Attempted store to read-only CSRs will generate an illegal instruction
exception.
reqt_doc: Privileged Architecture Version 20211203, Chapter 2.1
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when storing to any read-only CSR, an exception is
raised with `mcause` set to 0x2.
pfc: -1
test_type: -1
cov_method: -1
cores: 56
coverage_loc: ''
comments: "Covered by CSR DV plan.\nVerify if `mcause` value check is covered\
\ by CSR DV plan."
vptool_gitrev: '$Id: b0efb3ae3f9057b71a577d43c2b77f1cfb2ef82f $'
io_fmt_gitrev: '$Id: 7ee5d68801f5498a957bcbe23fcad87817a364c5 $'
config_gitrev: '$Id: 0422e19126dae20ffc4d5a84e4ce3de0b6eb4eb5 $'
ymlcfg_gitrev: '$Id: 286c689bd48b7a58f9a37754267895cffef1270c $'
36 changes: 36 additions & 0 deletions verif/docs/VerifPlans/traps/VP_IP003.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
!Feature
next_elt_id: 1
name: Machine Trap Vector
id: 3
display_order: 3
subfeatures: !!omap
- 000_mtvec: !Subfeature
name: 000_mtvec
tag: VP_traps_F003_S000
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F003_S000_I000
description: '`mtvec` provides the starting value of the Interrupt Vector
Table as well as the mode (Direct or Vectored) number at the time. Mode
number is not relevant to exceptions as it only affects the value jumped
to by interrupts.'
reqt_doc: Privileged Architecture Version 20211203, Chapter 3.1.7
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that exceptions jump to the base value defined in `mtvec`
CSR.
pfc: 3
test_type: 3
cov_method: 1
cores: 56
coverage_loc: ''
comments: ''
vptool_gitrev: '$Id: b0efb3ae3f9057b71a577d43c2b77f1cfb2ef82f $'
io_fmt_gitrev: '$Id: 7ee5d68801f5498a957bcbe23fcad87817a364c5 $'
config_gitrev: '$Id: 0422e19126dae20ffc4d5a84e4ce3de0b6eb4eb5 $'
ymlcfg_gitrev: '$Id: 286c689bd48b7a58f9a37754267895cffef1270c $'
32 changes: 32 additions & 0 deletions verif/docs/VerifPlans/traps/VP_IP004.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
!Feature
next_elt_id: 1
name: Machine Cause
id: 4
display_order: 4
subfeatures: !!omap
- 000_mcause: !Subfeature
name: 000_mcause
tag: VP_traps_F004_S000
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F004_S000_I000
description: '`mcause` is set to exception cause upon entry into exception.'
reqt_doc: Privileged Architecture Version 20211203, 3.1.15
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that `mcause` correctly identifies the exception taken.
pfc: 3
test_type: 3
cov_method: 1
cores: 56
coverage_loc: ''
comments: ''
vptool_gitrev: '$Id: b0efb3ae3f9057b71a577d43c2b77f1cfb2ef82f $'
io_fmt_gitrev: '$Id: 7ee5d68801f5498a957bcbe23fcad87817a364c5 $'
config_gitrev: '$Id: 0422e19126dae20ffc4d5a84e4ce3de0b6eb4eb5 $'
ymlcfg_gitrev: '$Id: 286c689bd48b7a58f9a37754267895cffef1270c $'
34 changes: 34 additions & 0 deletions verif/docs/VerifPlans/traps/VP_IP005.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
!Feature
next_elt_id: 1
name: Machine Exception Program Counter
id: 5
display_order: 5
subfeatures: !!omap
- 000_mepc: !Subfeature
name: 000_mepc
tag: VP_traps_F005_S000
next_elt_id: 2
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F005_S000_I000
description: '`mepc` is set to the `pc` value of the instruction that generates
an exception.'
reqt_doc: Privileged Architecture Version 20211203, Chapter 3.1.15
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when an exception is raised, `mepc` CSR contains the
correct `pc`.
pfc: 3
test_type: 3
cov_method: 1
cores: 56
coverage_loc: ''
comments: ''
vptool_gitrev: '$Id: b0efb3ae3f9057b71a577d43c2b77f1cfb2ef82f $'
io_fmt_gitrev: '$Id: 7ee5d68801f5498a957bcbe23fcad87817a364c5 $'
config_gitrev: '$Id: 0422e19126dae20ffc4d5a84e4ce3de0b6eb4eb5 $'
ymlcfg_gitrev: '$Id: 286c689bd48b7a58f9a37754267895cffef1270c $'
106 changes: 106 additions & 0 deletions verif/docs/VerifPlans/traps/VP_IP006.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
!Feature
next_elt_id: 1
name: Machine Trap Value
id: 6
display_order: 6
subfeatures: !!omap
- 000_mtval_illegal: !Subfeature
name: 000_mtval_illegal
tag: VP_traps_F006_S000
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F006_S000_I000
description: When an illegal instruction exception is raised, the corresponding
instruction is stored into `mtval` CSR.
reqt_doc: Privileged Architecture Version 20211203, Chapter 3.1.16
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when any illegal instruction exception is raised,
`mtval` CSR contains the faulting instruction.
pfc: -1
test_type: -1
cov_method: -1
cores: 56
coverage_loc: ''
comments: ZERO_TVAL parameter value?
- 001_mtval_misaligned: !Subfeature
name: 001_mtval_misaligned
tag: VP_traps_F006_S001
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F006_S001_I000
description: When an address misaligned exception is raised, the corresponding
address is stored into `mtval` CSR.
reqt_doc: Privileged Architecture Version 20211203, Chapter 3.1.16
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when any address misaligned exception is raised, `mtval`
CSR contains the address of the portion of the access causing the fault.
pfc: -1
test_type: -1
cov_method: -1
cores: 56
coverage_loc: ''
comments: ZERO_TVAL parameter value?
- 002_mtval_access: !Subfeature
name: 002_mtval_access
tag: VP_traps_F006_S002
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F006_S002_I000
description: When an access fault exception is raised, the corresponding address
is stored into `mtval` CSR.
reqt_doc: Privileged Architecture Version 20211203, Chapter 3.1.16
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when any access fault exception is raised, `mtval`
CSR contains the address of the portion of the access causing the fault.
pfc: -1
test_type: -1
cov_method: -1
cores: 56
coverage_loc: ''
comments: ZERO_TVAL parameter value?
- 003_mtval_page: !Subfeature
name: 003_mtval_page
tag: VP_traps_F006_S003
next_elt_id: 1
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F006_S003_I000
description: When an page fault exception is raised, the corresponding address
is stored into `mtval` CSR.
reqt_doc: Privileged Architecture Version 20211203, Chapter 3.1.16
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when any page fault exception is raised, `mtval` CSR
contains the address of the portion of the access causing the fault.
pfc: -1
test_type: -1
cov_method: -1
cores: 56
coverage_loc: ''
comments: ZERO_TVAL parameter value? Only with MMU support
vptool_gitrev: '$Id: b0efb3ae3f9057b71a577d43c2b77f1cfb2ef82f $'
io_fmt_gitrev: '$Id: 7ee5d68801f5498a957bcbe23fcad87817a364c5 $'
config_gitrev: '$Id: 0422e19126dae20ffc4d5a84e4ce3de0b6eb4eb5 $'
ymlcfg_gitrev: '$Id: 286c689bd48b7a58f9a37754267895cffef1270c $'
41 changes: 41 additions & 0 deletions verif/docs/VerifPlans/traps/VP_IP007.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
!Feature
next_elt_id: 1
name: Exception Priority
id: 7
display_order: 7
subfeatures: !!omap
- 000_exception priority: !Subfeature
name: 000_exception priority
tag: VP_traps_F007_S000
next_elt_id: 2
display_order: 0
items: !!omap
- '000': !VerifItem
name: '000'
tag: VP_traps_F007_S000_I000
description: "Exceptions are of lower priority than all interrupts.\nException\
\ priority (high to low)\n- code=0x3: Instruction address breakpoint\n-\
\ code=0xC, 0x1: Instruction page fault, instruction access fault\n- code=0x2:\
\ Illegal instruction\n- code=0x8, 0x9, 0xB: Environment call from U-mode,\
\ from S-mode, from M-mode\n- code=0x3: Environment break\n- code=0x3: Load/store/AMO\
\ address breakpoint\n- code=0x4, 0x6: Load address misaligned, store/AMO\
\ address misaligned (CHECK IF NOT LOWEST PRIORITY ON CVA6)\n- code=0xD,\
\ 0xF, 0x5, 0x7: Load page fault, store/AMO page fault, load access fault,\
\ store/AMO access fault"
reqt_doc: Privileged Architecture Version 20211203, Chapter 3.1.15
ref_mode: page
ref_page: ''
ref_section: ''
ref_viewer: firefox
verif_goals: Check that when raising an exception together with a lower priority
one the cause of the higher priority exception is written in `mcause` register.
pfc: -1
test_type: 2
cov_method: 0
cores: 56
coverage_loc: ''
comments: ''
vptool_gitrev: '$Id: b0efb3ae3f9057b71a577d43c2b77f1cfb2ef82f $'
io_fmt_gitrev: '$Id: 7ee5d68801f5498a957bcbe23fcad87817a364c5 $'
config_gitrev: '$Id: 0422e19126dae20ffc4d5a84e4ce3de0b6eb4eb5 $'
ymlcfg_gitrev: '$Id: 286c689bd48b7a58f9a37754267895cffef1270c $'
Loading

0 comments on commit 619c0c4

Please sign in to comment.