tlb.hh revision 5184
14997Sgblack@eecs.umich.edu/* 24997Sgblack@eecs.umich.edu * Copyright (c) 2006 The Regents of The University of Michigan 34997Sgblack@eecs.umich.edu * All rights reserved. 44997Sgblack@eecs.umich.edu * 54997Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without 64997Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are 74997Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright 84997Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 94997Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright 104997Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the 114997Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution; 124997Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 134997Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 144997Sgblack@eecs.umich.edu * this software without specific prior written permission. 154997Sgblack@eecs.umich.edu * 164997Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 174997Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 184997Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 194997Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 204997Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 214997Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 224997Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 234997Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 244997Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 254997Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 264997Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 274997Sgblack@eecs.umich.edu * 284997Sgblack@eecs.umich.edu * Authors: Gabe Black 294997Sgblack@eecs.umich.edu */ 304997Sgblack@eecs.umich.edu 314997Sgblack@eecs.umich.edu#ifndef __ARCH_MIPS_TLB_HH__ 324997Sgblack@eecs.umich.edu#define __ARCH_MIPS_TLB_HH__ 334997Sgblack@eecs.umich.edu 345034Smilesck@eecs.umich.edu#include "params/MipsDTB.hh" 355034Smilesck@eecs.umich.edu#include "params/MipsITB.hh" 364997Sgblack@eecs.umich.edu#include "sim/tlb.hh" 374997Sgblack@eecs.umich.edu 384997Sgblack@eecs.umich.edunamespace MipsISA 394997Sgblack@eecs.umich.edu{ 405014Sgblack@eecs.umich.edu struct TlbEntry 415014Sgblack@eecs.umich.edu { 425184Sgblack@eecs.umich.edu Addr _pageStart; 435014Sgblack@eecs.umich.edu TlbEntry() {} 445184Sgblack@eecs.umich.edu TlbEntry(Addr asn, Addr vaddr, Addr paddr) : _pageStart(paddr) {} 455184Sgblack@eecs.umich.edu 465184Sgblack@eecs.umich.edu Addr pageStart() 475184Sgblack@eecs.umich.edu { 485184Sgblack@eecs.umich.edu return _pageStart; 495184Sgblack@eecs.umich.edu } 505014Sgblack@eecs.umich.edu 515014Sgblack@eecs.umich.edu void serialize(std::ostream &os); 525014Sgblack@eecs.umich.edu void unserialize(Checkpoint *cp, const std::string §ion); 535014Sgblack@eecs.umich.edu }; 545014Sgblack@eecs.umich.edu 555019Sgblack@eecs.umich.edu class TLB : public GenericTLB 564997Sgblack@eecs.umich.edu { 574997Sgblack@eecs.umich.edu public: 585034Smilesck@eecs.umich.edu typedef MipsTLBParams Params; 595034Smilesck@eecs.umich.edu TLB(const Params *p) : GenericTLB(p) 605019Sgblack@eecs.umich.edu {} 615019Sgblack@eecs.umich.edu 625019Sgblack@eecs.umich.edu Fault translate(RequestPtr req, ThreadContext *tc, bool=false); 635019Sgblack@eecs.umich.edu }; 645019Sgblack@eecs.umich.edu 655019Sgblack@eecs.umich.edu class ITB : public TLB 665019Sgblack@eecs.umich.edu { 675019Sgblack@eecs.umich.edu public: 685034Smilesck@eecs.umich.edu typedef MipsITBParams Params; 695034Smilesck@eecs.umich.edu ITB(const Params *p) : TLB(p) 704997Sgblack@eecs.umich.edu {} 714997Sgblack@eecs.umich.edu }; 724997Sgblack@eecs.umich.edu 735019Sgblack@eecs.umich.edu class DTB : public TLB 744997Sgblack@eecs.umich.edu { 754997Sgblack@eecs.umich.edu public: 765034Smilesck@eecs.umich.edu typedef MipsDTBParams Params; 775034Smilesck@eecs.umich.edu DTB(const Params *p) : TLB(p) 784997Sgblack@eecs.umich.edu {} 794997Sgblack@eecs.umich.edu }; 804997Sgblack@eecs.umich.edu}; 814997Sgblack@eecs.umich.edu 824997Sgblack@eecs.umich.edu#endif // __ARCH_MIPS_TLB_HH__ 83