-
Notifications
You must be signed in to change notification settings - Fork 25
Description
My understanding of the iforce CSR is as follows:
When software writes a 1 into this register and the following is true:
(domaincfg.IE == 1) & (domaincfg.DM == 0 & idelivery == 1)
an interrupt is asserted to the corresponding hart.
-
Is this interrupt forced irrespective of the threshold, priority, etc., or are those considered, and only when it becomes the “current highest-priority pending-and-enabled interrupt targeted to this hart that also exceeds the priority threshold specified by ithreshold” is the interrupt forced?
-
Are topi and, as such claimi CSRs updated appropriately based on the interrupt being forced by iforce, or they not updated?
-
Now topi and as such claimi CSRs will only be zero when there is no current highest priority pending and enabled interrupt that exceeds the priority threshold. As such, only then will a read of claimi return a zero, and as such, iforce will be cleared. Is this correct?
-
Given all this, the statement in Section 4.8.1.2, first paragraph, last sentence:
“When topi is zero, this creates a spurious external interrupt for the hart.”
is not clear.
If topi is zero and you set iforce = 1, you end up asserting an interrupt (if the answer to 2 is a yes.) Once the interrupt is asserted, topi will get updated and will not be zero. So it's not clear what the above statement in the specification implies? My point is once the iforce-caused interrupt (spurious interrupt) gets asserted, topi is not zero.
Or is it just being implied by the specification that, given that topi was zero (no real external interrupt meets the criteria of asserting an interrupt), an iforce assertion is asserting an external interrupt and, as such a “spurious external interrupt” is being generated?
-
The next question then is how does iforce get cleared? How does topi end up becoming zero after iforce has been asserted so that reading a zero value in topi clears iforce? Furthermore, does the iforce created interrupt also get affected by the soucecfg.SM field and treated appropriately as an edge-triggered or a level-triggered “external interrupt”?
Thanks!