Giter Site home page Giter Site logo

Comments (7)

jhauser-us avatar jhauser-us commented on August 24, 2024 1

Your example is correct. A read of a *topi or *topei CSR always returns the most recent information available.

from riscv-aia.

jhauser-us avatar jhauser-us commented on August 24, 2024

@yichanfeng, I do not understand the scenario you describe. Software doesn't know what the external interrupt is until it reads *topei (which it should also write at the same time to claim the interrupt). Only by reading *topei does software learn the priority of the interrupt. So, what is this?:

If a hart asks IMSIC for the interrupt arbitration, leading a trap handler to a lower priority interrupt handling (e.g. IID=4)

I don't recognize that step, which you say precedes reading *topei to claim the interrupt.

from riscv-aia.

yichanfeng avatar yichanfeng commented on August 24, 2024

@jhauser-us
Thanks for your reply.

Yes, SW doesn't know what the external interrupt is until it reads *topei.

I am asking if HW needs to retain the older value of non-zero *topei until SW reads its value in the trap handler when the following scenario occurs.

  1. In the machine-level interrupt file of IMSIC, interrupt 4 (ID = 4) is pending-and-enabled. Then, the hart receives the external
    interrupt and traps to M-mode.
  2. Before SW executes the CSR instruction to read mtopei in the trap handler, the interrupt 1 (ID = 1, has higher priority) of
    machine-level interrupt file becomes pending-and-enabled due to an MSI write.
  3. When SW executes the CSR instruction in the trap handler,
    the read value of mtopei will be 0x10001 (ID = 1, Prio = 1) instead of 0x4004 (ID = 4, Prio = 4).
    => Does this result match expectation (always return the latest value) ?

from riscv-aia.

yichanfeng avatar yichanfeng commented on August 24, 2024

@jhauser-us

Thanks for your reply.

from riscv-aia.

umcann123 avatar umcann123 commented on August 24, 2024

Hi @jhauser-us! I also have a question about *topei. What should the expected or suggested behavior be when we read/write the *topei while eidelivery=0? Should it assume that there are no valid external interrupts when eidelivery=0, causing the IMSIC to ignore the *topei access and only read it as 0? Or should it retain its original behavior, allowing harts to read/write the *topei, clean the highest priority eip pending bit, and only prevent the *EIP from being sent to harts?

from riscv-aia.

jhauser-us avatar jhauser-us commented on August 24, 2024

An interrupt file's eidelivery register has no effect on a *topei register. See new issues #56 and #57.

Note the similarity also with what the AIA spec says about the *topi CSRs:

The value of mtopi is not affected by the global interrupt enable MIE in CSR mstatus.

The value of stopi is not affected by the global interrupt enable SIE in CSR sstatus.

from riscv-aia.

umcann123 avatar umcann123 commented on August 24, 2024

@jhauser-us Thanks!

from riscv-aia.

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.