Simulation of a Hardware Cache