Comments (7)
Agreed that mtval
should replace mbadaddr
not only here but in all other tests as well.
Will probably raise a pull-request for the same soon. Thanks for the catch.
I think the problem here is how you have interpreted the spec. I would interpret the following
... or an instruction-fetch, load, or store address-misaligned, access, or page-fault exception occurs, mtval is written with the faulting effective address ...
as:
instruction-fetch-misaligned, load-address-misaligned, store-address-misaligned,
instruction-fetch-access, load-address-access, store-address-access,
instruction-fetch-pagefault, load-address-pagefault and store-address-pagefault exceptions.
Also there is no exception defined as: instruction-fetch-exception.
In which case a jal/jalr
instruction which causes an instruction-fetch-misaligned exception should update mtval with the corresponding instruction-fetch-address.
Also you can find the same behaviour in spike and riscvOPVSim and also quite a few other implementations.
from riscv-arch-test.
Ah, that makes more sense! Thanks for your help!
from riscv-arch-test.
I missed this earlier, but in the paragraph above, the spec states:
"When a trap is taken into M-mode, mtval
is either set to zero or written with exception-specific information to assist software in handling the trap. Otherwise, mtval
is never written by the implementation, though it may be explicitly written by software. The hardware platform will specify which exceptions must set mtval
informatively and which may unconditionally set it to zero."
So the behavior desired by the test isn't actually required by spec. This seems like it would render several tests that use mtval
less useful for some targets. Thoughts?
from riscv-arch-test.
I think the ISA-compliance tests should be revised to permit either zero or the expected nonzero value. These tests will still be useful. Implementations will choose to write the expected nonzero value for exceptions that are meant to be resumable, and we still want to test that they produce the right value if they do produce a value.
Platform-compliance tests should be responsible for checking whether mtval is populated with nonzero values for the exceptions that platform cares about (e.g., misaligned ld/st on platforms that emulate those operations; all page-fault exceptions on platforms that use virtual memory).
from riscv-arch-test.
from riscv-arch-test.
Note that the riscof framework will handle this correctly by dreclaring that MTVAL is unimplemented in the DUT YAML configuration file. The reference model will need to allow that kind of configuration (and many, many others) as well.
from riscv-arch-test.
So, I am unclear: is it possible to modify the test so it works for both MTVAL implemented or not?
I thought the current v.1 framework only allows a single assertion, which make it unfixable in v.1
from riscv-arch-test.
Related Issues (20)
- Test misalign-jal-01.S generates compressed instruction for platforms that support only RV32I HOT 7
- Floating point tests are enormous HOT 4
- jalr-01.S fails with illegal operands on latest binutils 2.42 HOT 2
- misalign-jal-01.S without support for compressed instruction signature mismatch HOT 5
- Zfh's 'flh-align-01' test is executed even if Zfh is not enabled HOT 6
- Extra spaces at the end of a multiline macro causing compile warnings for env/test_macros.h
- RVTEST_CODE_END use of RVTEST_SAVE_GPRS in env/arch_test.h doesn't work HOT 4
- Compliance command failure HOT 4
- Unexpected Zfh's fdiv test appear when no Zfh enable HOT 4
- Zfa tests missing fmvp.d.x
- Regnerated MUL* tests missing Zmmul string in RVTEST_ISA macro
- Zfh tests missing floating-to-float conversions
- Error in CTG commands for generating floating point riscv-tests HOT 4
- Cover Group files are scattered in different directories HOT 2
- Zicsr, Zicboz order is wrong in CMO tests
- ACT should pick different Canary to be the identifier for the end of each test case
- ACT should remove explicit RVMODEL_HALT and instead add it to the end of RVTEST_CODE_END
- 3.9.1 introduces problems with _start HOT 4
- Dup RVMODEL_BOOT macros crashes compile on DUT.
- Missing coverage for compressed illegal instruction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riscv-arch-test.