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

Test generation for CSR testing. #28

Open
pawks opened this issue Jan 19, 2022 · 2 comments
Open

Test generation for CSR testing. #28

pawks opened this issue Jan 19, 2022 · 2 comments
Labels
enhancement New feature or request LFX Mentorship Fall-2022 Issues targeted to be completed as a part of LFX Mentorship Fall-2022

Comments

@pawks
Copy link
Collaborator

pawks commented Jan 19, 2022

Summary

The csr coverpoints (csr_comb node defined here) in the CGF correspond to the values present in the CSR. These kinds of tests would try to set the CSR to a particular value either by writing to them or by executing code which causes the CSR to change due to a side effect, interrupts and exceptions. The tests will have to propagate the CSR values to the signature. CTG does not support generating tests for these coverpoints in its current state. Each csr(or csr type) will have to be handled independently.

Changes required

  • Add support to test generator.
  • Add relevant assembly macros necessary to handle most common cases.

Basic example

A coverpoint corresponding to the C bit in misa register:

c_misa:
  opcode:
    c.add: 0
  csr_comb:
    'misa & 0x4 == 0': 0

Assembly Test

la x4, signature_addr
addi x1,x1,0
csrr x2,misa
li x3,~0x4
and x2,x2,x3
csrw misa,x2
c.add x1,x3
c.nop
nop
sw x1, 0(x4)
@pawks pawks added enhancement New feature or request help wanted Extra attention is needed labels Jan 19, 2022
@bilalsakhawat
Copy link
Contributor

Hi @pawks I want to work on this issue. can you please assign this to me ?

@bilalsakhawat
Copy link
Contributor

Thanks!

@pawks pawks added LFX Mentorship Fall-2022 Issues targeted to be completed as a part of LFX Mentorship Fall-2022 and removed help wanted Extra attention is needed labels Jul 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request LFX Mentorship Fall-2022 Issues targeted to be completed as a part of LFX Mentorship Fall-2022
Projects
None yet
Development

No branches or pull requests

2 participants