TOR after NAPOT

476 views
Skip to first unread message

Richard Herveille

unread,
Mar 30, 2018, 10:22:53 AM3/30/18
to RISC-V HW Dev, Richard Herveille

Hi,

 

Rev1.10 of the privilege spec says “If PMP entry I’s A field is set to TOR, the entry matches any address a such that pmpaddri-1 <= a < pmpaddri.”

However if PMPi-1’s A field is NAPOT, then it shouldn’t be pmpaddri-1, but the top of the NAPOT range, right?

 

Richard

 

 

cid:image001.png@01D348FE.8B6D1030

 

Richard Herveille

Managing Director

Phone +31 (45) 405 5681

Cell +31 (6) 5207 2230

richard....@roalogic.com

 

 

Richard Herveille

unread,
Mar 30, 2018, 10:35:25 AM3/30/18
to RISC-V HW Dev, Richard Herveille

 

Hi,

 

Rev1.10 of the privilege spec says “If PMP entry I’s A field is set to TOR, the entry matches any address a such that pmpaddri-1 <= a < pmpaddri.”

However if PMPi-1’s A field is NAPOT, then it shouldn’t be pmpaddri-1, but the top of the NAPOT range, right?

 

Thinking about this a bit more, the spec is unclear about whether pmpaddr holds the lower or upper bounds for NA4/NAPOT.

So for pmpaddr=aa  and  NA4, what is the range? {(aa-1)00, (aa-1)01, (aa-1)10, (aa-1)11)} or {(aa-1)01, (aa-1)10, (aa-1)11, aa00 or {aa00, aa01, aa10, aa11} }?

I assume it’s the latter.

 

Thanks,

Richard

Andrew Waterman

unread,
Mar 30, 2018, 2:56:32 PM3/30/18
to Richard Herveille, RISC-V HW Dev
On Fri, Mar 30, 2018 at 7:22 AM, Richard Herveille <richard....@roalogic.com> wrote:

Hi,

 

Rev1.10 of the privilege spec says “If PMP entry I’s A field is set to TOR, the entry matches any address a such that pmpaddri-1 <= a < pmpaddri.”

However if PMPi-1’s A field is NAPOT, then it shouldn’t be pmpaddri-1, but the top of the NAPOT range, right?


Funny, I was just talking with someone about this case yesterday.  The spec is correct as written, meaning that TOR after NAPOT isn't an especially useful configuration.

Your alternate definition would be more useful but would add extra circuit delay, and PMP checks can easily end up on the critical path.

 

Richard

 

 

cid:image001.png@01D348FE.8B6D1030

 

Richard Herveille

Managing Director

Phone +31 (45) 405 5681

Cell +31 (6) 5207 2230

richard....@roalogic.com

 

 

--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/05A4D999-7EA7-4C24-960B-29AAA3827856%40roalogic.com.

Andrew Waterman

unread,
Mar 30, 2018, 2:57:38 PM3/30/18
to Richard Herveille, RISC-V HW Dev
When pmpcfgX is NAPOT, pmpaddrX holds the range, and pmpaddr(X-1) plays no role.

--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.

Richard Herveille

unread,
Mar 30, 2018, 3:14:17 PM3/30/18
to Andrew Waterman, RISC-V HW Dev
A bit extra logic, yes, but delay? The upper and lower bounds of the range can be registered, since they’re static. So the delay should be the same. 

I currently actually have a configuration where TOR after NAPOT makes sense. I could probably change the configuration to make it work, but the core (or at least the spec) should be flexible enough to handle all configurations. 

Richard 


Sent from my iPad

Richard Herveille

unread,
Mar 30, 2018, 3:17:11 PM3/30/18
to Andrew Waterman, RISC-V HW Dev


Sent from my iPad

On 30 Mar 2018, at 20:57, Andrew Waterman <wate...@eecs.berkeley.edu> wrote:

When pmpcfgX is NAPOT, pmpaddrX holds the range, and pmpaddr(X-1) plays no role.

Yes, I understand, but what’s the range? I assume starting from aaa00, since that’s the easiest to decode. However range could also mean to end at aaa00

Richard 

Andrew Waterman

unread,
Mar 30, 2018, 3:24:53 PM3/30/18
to Richard Herveille, RISC-V HW Dev
Sorry, I misunderstood your email... the address names the base of the power-of-2-sized region.

If pmpaddr = yyyy011, for example, the range is yyyy00000 .. yyyy11111, inclusive.

I agree the spec should be more explicit about this.

On Fri, Mar 30, 2018 at 12:17 PM, Richard Herveille <richard.herveille@roalogic.com> wrote:


Sent from my iPad

On 30 Mar 2018, at 20:57, Andrew Waterman <wate...@eecs.berkeley.edu> wrote:

When pmpcfgX is NAPOT, pmpaddrX holds the range, and pmpaddr(X-1) plays no role.

Yes, I understand, but what’s the range? I assume starting from aaa00, since that’s the easiest to decode. However range could also mean to end at aaa00

Richard 
On Fri, Mar 30, 2018 at 7:35 AM, Richard Herveille <richard....@roalogic.com> wrote:

 

Hi,

 

Rev1.10 of the privilege spec says “If PMP entry I’s A field is set to TOR, the entry matches any address a such that pmpaddri-1 <= a < pmpaddri.”

However if PMPi-1’s A field is NAPOT, then it shouldn’t be pmpaddri-1, but the top of the NAPOT range, right?

 

Thinking about this a bit more, the spec is unclear about whether pmpaddr holds the lower or upper bounds for NA4/NAPOT.

So for pmpaddr=aa  and  NA4, what is the range? {(aa-1)00, (aa-1)01, (aa-1)10, (aa-1)11)} or {(aa-1)01, (aa-1)10, (aa-1)11, aa00 or {aa00, aa01, aa10, aa11} }?

I assume it’s the latter.

 

Thanks,

Richard

 

 

Richard

 

 

cid:image001.png@01D348FE.8B6D1030

 

Richard Herveille

Managing Director

Phone +31 (45) 405 5681

Cell +31 (6) 5207 2230

richard....@roalogic.com

 

 

--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.

To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
Reply all
Reply to author
Forward
0 new messages