17008SN/A/* 27008SN/A * Copyright (c) 2007 Mark D. Hill and David A. Wood 37008SN/A * All rights reserved. 47008SN/A * 57008SN/A * Redistribution and use in source and binary forms, with or without 67008SN/A * modification, are permitted provided that the following conditions are 77008SN/A * met: redistributions of source code must retain the above copyright 87008SN/A * notice, this list of conditions and the following disclaimer; 97008SN/A * redistributions in binary form must reproduce the above copyright 107008SN/A * notice, this list of conditions and the following disclaimer in the 117008SN/A * documentation and/or other materials provided with the distribution; 127008SN/A * neither the name of the copyright holders nor the names of its 137008SN/A * contributors may be used to endorse or promote products derived from 147008SN/A * this software without specific prior written permission. 157008SN/A * 167008SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 177008SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 187008SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 197008SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 207008SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 217008SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 227008SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 237008SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 247008SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 257008SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 267008SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 277008SN/A */ 286145SN/A 2910441Snilay@cs.wisc.edu#ifndef __MEM_RUBY_STRUCTURES_LRUPOLICY_HH__ 3010441Snilay@cs.wisc.edu#define __MEM_RUBY_STRUCTURES_LRUPOLICY_HH__ 316145SN/A 3210301Snilay@cs.wisc.edu#include "mem/ruby/structures/AbstractReplacementPolicy.hh" 3310970Sdavid.hashe@amd.com#include "params/LRUReplacementPolicy.hh" 346145SN/A 356145SN/A/* Simple true LRU replacement policy */ 366145SN/A 377039SN/Aclass LRUPolicy : public AbstractReplacementPolicy 387039SN/A{ 397039SN/A public: 4010970Sdavid.hashe@amd.com typedef LRUReplacementPolicyParams Params; 4110970Sdavid.hashe@amd.com LRUPolicy(const Params * p); 427039SN/A ~LRUPolicy(); 436145SN/A 4411061Snilay@cs.wisc.edu void touch(int64_t set, int64_t way, Tick time); 4511061Snilay@cs.wisc.edu int64_t getVictim(int64_t set) const; 466145SN/A}; 476145SN/A 4810441Snilay@cs.wisc.edu#endif // __MEM_RUBY_STRUCTURES_LRUPOLICY_HH__ 49