Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Odd cache mappings

Name: Anonymous 2008-12-05 8:41

I don't expect you faggots to have a clue but I'll try anyway.

Some Core2 processors include non-power-of-two amounts of cache, such as 3MB or 6MB.

How is this cache mapped to addresses?

Name: Anonymous 2008-12-05 9:27

As I expected nobody here knows how caches work.

Let's see, in the 4MB Core 2 case (64-byte cachelines, 8-associative).

You take an address. The lowest 9 bits are the offset inside the cacheline. The next 13 bits decide which of the cacheline groups is going to be used. The rest of the address is stored alongside with the data, to distinguish it from all the data that could go into the same cacheline group.

As you can see, this works nicely for any amount of RAM, but assumes a power-of-2-sized cache.

Name: Anonymous 2008-12-05 10:58

>>10

Any language "abstracts" the cache, even assembly. But it would do you good to know about this stuff, if you ever hope to write anything else than database frontends.

>>3

RAM doesn't need to be a power of two either. Good thing we have MMUs for that sort of stuff, huh?

Congratulations on your total lack of understanding. By the way of MMUs, the cache on anything made in the last decade maps using physical memory addresses, not virtual ones.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List