[libre-riscv-dev] LD/ST address matcher

Luke Kenneth Casson Leighton lkcl at lkcl.net
Tue Jun 4 05:49:43 BST 2019

On Tuesday, June 4, 2019, Jacob Lifshay <programmerjake at gmail.com> wrote

> Jacob what do you think, is there a hash algorithm out there that works on
> > say 9 or even 16 bits, reducing them down to say 4 or 5?
> >
> Yes, CRCs. Most other hash functions will also work if the 9 or 16 bits are
> zero padded.


> >
> > And did you see that Mitch confirms that the AGEN detection needs to be
> on
> > the PHYS addr as well ad the Virt one?
> >
> > So it is no longer 64 bits to hash it is well over 100.
> If the physical address is not in the hash, you have to fall back to only
> comparing the bits that can't be mapped to the same physical address, the
> least significant 12 bits. If you check additional more significant virtual
> address bits, you can accidentally think that two different virtual address
> don't map to the same physical memory location when they actually do.

Ok so this is why only up to bit 12 according to Mitch.

Jacob can I check that the algorithm you are referring to is like this:

For (i = 0 to 10000)
    For (j = 0 to 10000)
       Struct1 = texture[i]
       Struct2 = texture[j]

Where sizeof(struct1) == exactly 1MiB
Or is it

For i = 0 to 10000
    Struct1 = texture[i]
    Struct2 = texture[i+1]

If the former, the number of AGEN misses will be such a small percentage we
can ignore them. It really is not worth the hassle to eke out fractions of
a percentage point performance.

If however it is the latter, where clearly there is CONSISTENT and FREQUENT
regular access required to two sets of data that are EXACTLY on a 1MiB
boundary, and would clearly be a major performance bottleneck, we have to
deal with that.

Which one is it?

crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68

More information about the libre-riscv-dev mailing list