Re: [理工] 階層式記憶體

看板Grad-ProbAsk作者 (態度)時間15年前 (2010/10/29 08:28), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《celiao (還沒想到暱稱....)》之銘言: : 張凡書裡的練習題 : : Media applications that play audio or video files are part of a class : of workloads called "streaming" workloads; i.e., they bring in large : amounts of data but do not reuse much of it. Consider a video streaming : workload that accesses a 512 KB working set sequentially with the following : address stream: : 0, 4, 8, 12, 16, 20, 24, 28, 32,... : (1)Assume a 64 KB direct-mapped cache with a 32-byte line.What is the miss : rate for the address stream above. How would you categorize the misses : this workload is experiencing, based on the 3C model. : (2)Recompute the miss rate when the cache line size is 16 bytes, 64 bytes, : and 128 bytes?What kind of locality is this workload exploiting? : 解答是: (1)12.5% miss rate. : The miss rate doesn't change with cache size or working set. : These are cold misses. : (2)25%, 6.25% and 3.125% miss rates for 16-byte, 64-byte and 128-byte : blocks. : Spatial locality. 這題跟64KB direct-mapped cache應該沒關係 因為只要容的下 一個BLOCK就夠了 每次都只有用一個block直到work load變了才會換 (不會一直換block) 先看下面就大概會懂0.0 第一題 題目沒講通常都是byte address 一個block 是32-byte 所以0,4,8,12,16,20,24,28,32 除32取下限 1後面還有七個1總共八個 轉成block address為 0 0 0 0 0 0 0 0 1 這裡第一個有cold miss 所以每八個 會有一次cold miss 把一個block載上來 miss rate為1/8=12.5% 第二題 16byte也是 0 .4,8,12 block address都0 第一個會發生cold miss 1/4=25% 剩下兩個自己做看看吧 應該是這樣沒錯 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.126.122.61 ※ 編輯: hunter0904 來自: 122.126.122.61 (10/29 08:31)

10/29 23:25, , 1F
哦哦哦!!!感謝!!
10/29 23:25, 1F

10/31 00:17, , 2F
這解法蠻穩的
10/31 00:17, 2F
文章代碼(AID): #1CoXKTz7 (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1CoXKTz7 (Grad-ProbAsk)