- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, all
How to get the exact associative pattern of each cache level?
For example, the cache associative of Xeon 5650 processor at different cache level. I have tried to find out that information, but I failed.
Thank you in advance!
How to get the exact associative pattern of each cache level?
For example, the cache associative of Xeon 5650 processor at different cache level. I have tried to find out that information, but I failed.
Thank you in advance!
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting zhangyihere
...How to get the exact associative pattern of each cache level?..
Did you try IntelCPUID instruction? Here is an example with intrinsic __cpuid function:
[cpp] ... __cpuid( CPUInfo, 0x80000000 ); // Get the number of valid Extended IDs nExIds = ( RTuint )CPUInfo[0]; CrtMemset( CPUBrandString, 0x0, sizeof( CPUBrandString ) ); for( i = 0x80000000; i <= nExIds; ++i ) // Get the information associated with each extended ID { __cpuid( CPUInfo, i ); CrtPrintf( RTU("Extended Function CPUID Information %xn"), i ); CrtPrintf( RTU("tCPUInfo[0] = 0x%08Xn"), CPUInfo[0] ); CrtPrintf( RTU("tCPUInfo[1] = 0x%08Xn"), CPUInfo[1] ); CrtPrintf( RTU("tCPUInfo[2] = 0x%08Xn"), CPUInfo[2] ); CrtPrintf( RTU("tCPUInfo[3] = 0x%08Xn"), CPUInfo[3] ); // Process CPU brand String and Cache information if( i == 0x80000002 ) CrtMemcpy( CPUBrandString, CPUInfo, sizeof( CPUInfo ) ); else if( i == 0x80000003 ) CrtMemcpy( CPUBrandString + 16, CPUInfo, sizeof( CPUInfo ) ); else if( i == 0x80000004 ) CrtMemcpy( CPUBrandString + 32, CPUInfo, sizeof( CPUInfo ) ); else if( i == 0x80000006 ) { nCacheLineSize = CPUInfo[2] & 0xff; nL2Associativity = ( CPUInfo[2] >> 12 ) & 0xf; nCacheSizeK = ( CPUInfo[2] >> 16 ) & 0xffff; } } ... if( nExIds >= 0x80000006 ) { CrtPrintf( RTU("tCache Line Size = %ldn"), nCacheLineSize ); CrtPrintf( RTU("tL2 Associativity = %ldn"), nL2Associativity ); CrtPrintf( RTU("tCache Size = %ldKn"), nCacheSizeK ); } ... [/cpp]
Output shouldlook like:
...
Cache Line Size = ...
L2 Associativity = ...
Cache Size = ...K
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would also recommend to use Windbg in its kernel mode as primary source of memory and CPU inspection tool.
Regarding CPU the most valuable information is contained in PCR and PCRB structures.You can dump these structures with the !pcr command
use dt nt!_KPCR [address of PCR] -b -v -r.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page