Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LR/SC need more tests #375

Open
davidharrishmc opened this issue Dec 15, 2024 · 2 comments
Open

LR/SC need more tests #375

davidharrishmc opened this issue Dec 15, 2024 · 2 comments

Comments

@davidharrishmc
Copy link
Collaborator

Systematically check all things that should cancel a reservation, including writes to nearby but not same address, and the list in spec of other things.

@franAyachi
Copy link

Hi! I am also extending tests for LR/SC instructions, in this case with sequences using riscv-dv.

My plan would be add a coverpoint at ISA level for LR/SC instructions that also check all possible combinations of aq and rl bits.

Also test the following plan:

Unaligned/Aligned (riscv_lr_sc_misaligned_instr_stream)
For LR and SC, the Zalrsc extension requires that the address held in rs1 be naturally aligned to the
size of the operand (i.e., eight-byte aligned for doublewords and four-byte aligned for words). If the
address is not naturally aligned, an address-misaligned exception or an access-fault exception will be
generated

Bounded/Non-bounded (riscv_lr_sc_nonbounded_instr_stream)
The loop comprises only an LR/SC sequence and code to retry the sequence in the case of failure,
and must comprise at most 16 instructions placed sequentially in memory.
*Note this only apply for constrained LR/SC

Non-atomic store to same location between pair LR/SC (riscv_lr_sc_invalid_store_instr_stream)
The SC must fail if a store to the reservation set from another hart can be observed to occur
between the LR and SC.

Different address pair LR/SC (riscv_lr_sc_invalid_addr_instr_stream)
The SC must fail if the address is not within the reservation set of the most recent LR in program
order.

Atomic store to same location between pair LR/SC with diff addr (riscv_lr_sc_invalid_sc_instr_stream)
An SC must fail if there is another SC (to any address) between the LR and the SC in program order.

Most recent LR (riscv_lr_sc_recent_lr_instr_stream)
An SC can only pair with the most recent LR in program order.

@davidharrishmc
Copy link
Collaborator Author

Hi @franAyachi.

This repo is in very active development and isn't ready for casual contributions yet. These tests should be written in the next two months.

This isn't really the right forum to do a design review on proposed riscv-dv sequences.

If you need these tests and are looking to partner, please email me and we can chat about your needs (find me through my web page, David Harris at Harvey Mudd College). Otherwise, we hope the tests will be more stable by May.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants