CS 473

Homework 6: Cache and VM

Due Friday, December 3, 2004

The Last One!

Why Not to Allow Unaligned Accesses

Considering only the virtual memory, and assuming no hits in the TLB, how many memory accesses does it take to write four bytes starting at virtual address 0x123fffff on an Intel machine using only small (4K) pages?

Cache, VM, TLB Practice

Following this question will be the contents of the PDBR, some of memory, some of cache, and the small page data TLB for an Intel Pentium Pro. All the numbers are in hexadecimal.

The L1 data cache on this machine was an 8KB, 4-way set-associative cache with a 32 byte line size.

Assume a program running in User mode attempts to write to each of the following virtual addresses. In each case, what happens? You may get page faults at either the directory entry or page table entry level, cache hits, cache misses, TLB hits, TLB misses.... However, you should never have reason to attempt a lookup in one of the tables and simply not find a table entry.

  1. 6141fac4
  2. 5eef358c
  3. 4ff2dfbc
  4. 6cc8e224
  5. 2153b858
  6. 4bf6af30
  7. 52b8525c
  8. 7559989c

Page Descriptor Base Register

PDBR contains 27060000

Partial Memory Contents

Physical AddressContents
0239707c2ec0a066
083aecb46a941045
08ce66647bd5c065
09258f3078827a81
17cb158c3dda3750
1aad2e144698e067
2706021445601007
270604bc724e7027
270604fc083ae005
270605281aad2027
270605ec3edd1007
2706061402397006
270606cc74bfc007
2706075408ce6025
2ec0aac454d41564
3a95122411d56994
3edd1bcc17cb1006
456014ec5bdd1067
4698e25c33fa4d22
5bdd185831dda0cc
6a941fbc2803babe
724e7da809258067
74bfc2383a951063
7bd5c89c3436b337

TLB Contents

Set Number Member 0 Member 1 Member 2 Member 3
TagValidEntry TagValidEntry TagValidEntry TagValidEntry
0194a40465d240d1505d152c124f00fa7c1494732340527307382025b
10eab317bd5c0251ff2b066673da20df2c015da72030629410ef9be08
2097ed1092580271677e0061ba26508b8b03ceca3c41b07b10cee00cf
30e2af00df915f80e50a10861c1360cfe1000f958ac00d83046fb15e0
407f86074ab34bf03d8f02a40cfbe14e4f0792390430f0b407ff925ad
509fe503c7235e0195471759edab70a57014698e02706c7505cb5bf9c
61c52115eeb01c10db0202cb9e4790d99113a9510030df7f1250c876d
706fc20338aab111957017f463f7b1cb500447f3b630a60704992c2d7

Partial Cache Contents

In the "contents" field, byte 0 is on the right and byte 31 is on the left.

SetValidTagContents
02108f54862915ea617d74a8426bb6fb079a422e439ec6ea6cf20825800c07ef071795dbb
00349aae6257a6fe3f3caac288806bcec78279a6eb803d3f9e5dd5dab21acdf0bcb3377
00511cf4ae33f0b8f6dbd2b4856ec9e5e90e831e05a8b3688d205ddb241ea9651f05e3f
00b7ba369d430843ff4724702448f1ba443f130401ea7dcaaaf5f66963daeb4a2c8d7e5
0400838b9c455e93957304562d2d1b12a5246bb4bf133f409b30440e5a9e11cb608845e8a
00e47ac573aa33972c7e884335aea8806a80ef7c866ba9ae8ceb1262eba9882ccbdda1e
10aaad667368dbb8ad833d5a1025a0c0a513ffbcda446339297418ee018f0e3893bb5ac
00f7ab98c05588f491704cf3daee31ee3d033ec5d4950f76a05d086874ee83c5ee232fc
1100810e178c174b18cda5233265dac5723cde54b96a96ed89d88be93f361c2c3da35bac7
00752a2211b7a4fa8557563a95c92afcf9c0775ccbcc75495e7c1b99dd74b2b8a6577d1
10c76d24577a4ab3dadbc83a7eee51c6fefe6665c59b85c7cdaf8a570608bce1d06149a
10752a264166165df67e560b3dc85aa10575dc7d1fe64660ff1e285dab7b41f08bd5cfe
12001f55684ab1a8a3748f9db1ee7a9b78284ece29bee0c07ffa6a4eef1e03056cbeec8f9
008d31c0a3bee0f8fbcaec50ff716ec78b0c2d36780d8d6c06131e2857a11b1c3e681fa
103e1a02ab18573825989759ca9a4cdd861bbb6e4b78b7ea0d8c74bf87876f1ff614cb7
108d31c224dfa3345397916e7af6d08671eb2956b056785309b5b12b3e87e4915c3a68d
16001e63b1eda56529f4d555de6b96d94f98edfb1f26dedef36e9c02850fbe6aee4e108cc
1090527e3564885297f29b914eb23ff002c376a92558d6508a9c69a771999315ccfd55e
005d815a1fde5df1602414d02facc87dcca3577ddce35f0681f3a6b9bd9fc7c813623c2
002b7e1517679ac48f92a4d82494ff147686186ced4c000cdd5fdfc62d7f923a15e04a5
2c105475243e1c8917e79874d368538e8af767b29bb4e1a656a8152a9dc26334319a5d0b2
002f962936521bbd4136adc48f9ad0e07f75c627730f5e0b3ffc35fc4f525ef926c6bd8
00cc086345e3ebd9d916cad71af2272ad6b871591e376644edf2e16a9700d6991b82976
00c419e50c941ec23354d938fe3612836cd51f5e5ec6420f97fc68db0fd045799cadd64
3900124b1bcb85531c8881a2dc6328e971dc7dea874fb57c042b14907966581bdf1eb338a
10aebb33a9adaaa64d1c7d150a0f724abe580d000a227a95c9b19f3b7fe862aa25a4e90
00ad662ddf8356cbafed871f07ec2bdcf775be8fe49a17b5c05def0394026944cb88a71
00c4395a29c3cefcdd466ae2cb987b9791b441020c026e7f90c268dd9636b481ca5bbb2
3d0042f096fed11aec453c3d5558dfd6f8ac486221ca01c3e52a90627046947d9281ad4c1
103b112af3bbe748cc1d0e3a99c28a21630ef530e921ee8a373873bea42737e3bfebc3b
00b5a4bee5283956a3027bb5867483e1c61e5a15e35c28227fad709863a7d2f86954c59
007ceb99f00bd1990f40708fae4d18457053ff0f451f12ba20ec4d7ccbb424d35d4c886


Last modified: Mon Nov 22 10:53:11 MST 2004