80 likes | 167 Views
Hit Or miss predictor. Final presentation. Software Engineering Lab. Spring 07/08 Supervised by: Zvika Guz Introduced by: Akram Baransi Amir Salameh. Hit or Miss ? !!!. Predictor Requirements. Small size. Simple and fast.
E N D
Hit Or misspredictor Final presentation Software Engineering Lab. Spring 07/08 Supervised by: ZvikaGuz Introduced by: AkramBaransi Amir Salameh Hit or Miss ? !!!
Predictor Requirements • Small size. • Simple and fast. • Implementable with hardware. • Does not need too much power. • Does not predict miss if we have a hit. • Have a high hit rate especially on misses. Hit or Miss ? !!!
Simple PredictorBloom Filter • Bloom filter: is a method representing a set of N elements (a1,…,an)to support membership queries. • The idea is to allocate a vector v of m bits, initially all set to 0. • Choose k independent hash functions, h1,… ,hk ,each with range 1…m . • For each element a, the bits at positions h1(a), ..., hk(a) in v are set to 1.
Simple PredictorBloom Filter • Given a query for b we check the bits at positions h1(b), h2(b), ..., hk(b). • If any of them is 0, then certainly b is not in the set A. • Otherwise we conjecture that b is in the set although there is a certain probability that we are wrong. This is called a “false positive”. • The parameters k and m should be chosen such that the probability of a false positive (and hence a false hit) is acceptable.
Bloom PredictorIn L2 Cache • We used a separate predictor for each set in the L2 cache. Set 0 Set 0 Set 0 Array 0 Set 0 0 1 1 0 1 0 Set 1 Set 1 Array 1 Set 1 Set 1 1 0 1 1 0 1 Set N Set N Set N Array N Set N 0 0 1 0 1 0
Bloom FilterAdvantages • Small size. • Simple and fast. • Implementable with hardware. • Does not need too much power. • Does not predict miss if we have a hit.
Bloom FilterDisadvantages • If A is a dynamic group, and in our case it is a dynamic one, it will be too hard to update the array when removing an element “e” from A, we can’t simply turn off Bloom[H(e)], to do so we must check that there is no element “e1” in A such that H(e)=H(e1). And this take a lot of time. • If we don’t update the array the hit rate will become low.