Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does setting mcontrol6 trigger to NAPOT limit the size of tdata2 due to maskmax restriction? #1073

Open
ThimayaPR opened this issue Oct 8, 2024 · 1 comment

Comments

@ThimayaPR
Copy link

With regards to NAPOT match trigger, if an implementation chooses to support maskmax6 an N.
We would expect tdata2[N-1] to be set to zero to comply with 5.7.12.
Screenshot 2024-10-08 at 3 42 21 PM

e.g:
In a system with XLEN=64.
We setup maxmask6 to be 63 (tdata2[62] will be set to zero) and configure tdata1 to setup a NAPOT trigger.

What is the expected behaviour of tdata2 when we attempt to write tdata2[61:0] with all ones?

Are we expected to read back 0x3fff...ffff [the same value we attempt to write]
or
are we expected to read back 0xbfff...ffff since we are anyway limiting the NAPOT range to 2^63?

@ThimayaPR ThimayaPR changed the title Does setting mcontrol6 trigger to NAPOT limit the size of tdata2 due to maskmax restriction. Does setting mcontrol6 trigger to NAPOT limit the size of tdata2 due to maskmax restriction? Oct 8, 2024
@en-sc
Copy link
Contributor

en-sc commented Oct 8, 2024

AFAIU, from [5.7.12. Match Control Type 6 (mcontrol6, at 0x7a1), match field description ]:

1 (napot): Matches when the top M bits of any compare
value match the top M bits of tdata2. M is XLEN-1 minus the
index of the least-significant bit containing 0 in tdata2.
tdata2 is WARL and if bits maskmax6-1:0 are written with
all ones then bit maskmax6-1 will be set to 0 while the
values of bits maskmax6-2:0 are UNSPECIFIED. Legal
values for tdata2 require M + maskmax6 ≥ XLEN and M > 0.
See above for how to determine maskmax6.

In your example:

  1. M == 63 - 62 == 1
  2. Bit maskmax6 - 1 == 62 is written with zero.

So my understanding is tdata2 will be read back as 0x3fff...ffff since it's a valid value.

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

No branches or pull requests

2 participants