Skip to content

Move nmi from etrigger to itrigger.#709

Merged
Tim Newsome (timsifive) merged 3 commits into
masterfrom
nmitrigger
Mar 21, 2022
Merged

Move nmi from etrigger to itrigger.#709
Tim Newsome (timsifive) merged 3 commits into
masterfrom
nmitrigger

Conversation

@timsifive

Copy link
Copy Markdown
Contributor

Per mailing list discussion subject:"etrigger.nmi".

Per mailing list discussion subject:"etrigger.nmi".
Based on subject:"NMI trigger and tdata2/tdata3" discussion.
Comment thread xml/hwbp_registers.xml
When set, non-maskable interrupts cause this
trigger to fire, regardless of the values of \FcsrItriggerM,
\FcsrItriggerS, \FcsrItriggerU, \FcsrItriggerVs, and \FcsrItriggerVu.
trigger to fire if the trigger is enabled for the current mode.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And tdata3? Or don't say "if the trigger is enabled for the current mode" and then it's implied that normal filtering applies. (Or is your goal to highlight that there was a change from the draft version?)

Also, something I mentioned in my email was that there can be multiple flavors of NMI and that tdata2 filtering can be useful (an argument that gfavor pointed out to me). If tdata2 is applied then I think that this should be explicitly called out because it might not be obvious that NMI support means that tdata2[0] must be implemented. Because mie[0] is architecturally hardwired to 0, supporting nonzero in that tdata2 bit would otherwise not be necessary and people may miss this additional requirement when supporting NMI.

Maybe something like this (which is similar to how etrigger talks about mcause):

When set, non-maskable interrupts cause this trigger to fire [if the trigger is enabled in the current mode and tdata3]. The trigger may fire on up to XLEN of the Exception Code values in mcause (described in the Privileged Spec section on Non-Maskable Interrupts). Those causes are configured by writing the corresponding bit in tdata2. (E.g. to trap on NMI with mcause Exception Code of 0, the debugger sets bit 0 in tdata2.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll remove the "if enabled" clause.

As for different NMI sources, let's leave that for a separate PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling with this. I don't want to simply remove the clause, because "When set, non-maskable interrupts cause this trigger to fire" can be read to mean the mode bits don't matter at all. If I mention tdata3, then it should really be mentioned for every trigger, which it currently is not. Does that need to be added? It feels obvious to me that if you implement textra, then it applies, and if you don't implement it then it's irrelevant.

Which leaves me with exactly the language that's in the current PR.

What exactly did you intend with the square brackets in your example?

@gfavor

gfavor commented Mar 17, 2022 via email

Copy link
Copy Markdown

@timsifive

Copy link
Copy Markdown
Contributor Author

So, let's merge this change as-is, and I'll create a new change to mention tdata3 (aka textra) in every trigger where it applies.

@pdonahue-ventana

Copy link
Copy Markdown
Collaborator

I'm OK with that.

I agree that mentioning tdata3/textra in more places would improve the spec. It is somewhat in the background today so it's easy to overlook that it plays a role in a lot of things.

@timsifive Tim Newsome (timsifive) merged commit e9994d7 into master Mar 21, 2022
@timsifive Tim Newsome (timsifive) deleted the nmitrigger branch March 21, 2022 16:22
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

Successfully merging this pull request may close these issues.

3 participants