Giter VIP home page Giter VIP logo

Comments (7)

neelgala avatar neelgala commented on August 16, 2024

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.

debs-sifive avatar debs-sifive commented on August 16, 2024

Ah, that makes more sense! Thanks for your help!

from riscv-arch-test.

debs-sifive avatar debs-sifive commented on August 16, 2024

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.

aswaterman avatar aswaterman commented on August 16, 2024

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.

allenjbaum avatar allenjbaum commented on August 16, 2024

from riscv-arch-test.

allenjbaum avatar allenjbaum commented on August 16, 2024

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.

allenjbaum avatar allenjbaum commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.