tlb.hh revision 5019
12623SN/A/*
22623SN/A * Copyright (c) 2006 The Regents of The University of Michigan
32623SN/A * All rights reserved.
42623SN/A *
52623SN/A * Redistribution and use in source and binary forms, with or without
62623SN/A * modification, are permitted provided that the following conditions are
72623SN/A * met: redistributions of source code must retain the above copyright
82623SN/A * notice, this list of conditions and the following disclaimer;
92623SN/A * redistributions in binary form must reproduce the above copyright
102623SN/A * notice, this list of conditions and the following disclaimer in the
112623SN/A * documentation and/or other materials provided with the distribution;
122623SN/A * neither the name of the copyright holders nor the names of its
132623SN/A * contributors may be used to endorse or promote products derived from
142623SN/A * this software without specific prior written permission.
152623SN/A *
162623SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172623SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182623SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192623SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202623SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212623SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222623SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232623SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242623SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252623SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262623SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Gabe Black
292623SN/A */
302623SN/A
313170Sstever@eecs.umich.edu#ifndef __ARCH_MIPS_TLB_HH__
325103Ssaidi@eecs.umich.edu#define __ARCH_MIPS_TLB_HH__
332623SN/A
344040Ssaidi@eecs.umich.edu#include "sim/tlb.hh"
352623SN/A
362623SN/Anamespace MipsISA
373348Sbinkertn@umich.edu{
383348Sbinkertn@umich.edu    struct TlbEntry
394762Snate@binkert.org    {
402901Ssaidi@eecs.umich.edu        Addr pageStart;
412623SN/A        TlbEntry() {}
422623SN/A        TlbEntry(Addr paddr) : pageStart(paddr) {}
432623SN/A
442623SN/A        void serialize(std::ostream &os);
452856Srdreslin@umich.edu        void unserialize(Checkpoint *cp, const std::string &section);
462856Srdreslin@umich.edu    };
472856Srdreslin@umich.edu
482856Srdreslin@umich.edu    class TLB : public GenericTLB
492856Srdreslin@umich.edu    {
502856Srdreslin@umich.edu      public:
512856Srdreslin@umich.edu        TLB(const std::string &name) : GenericTLB(name)
522856Srdreslin@umich.edu        {}
532856Srdreslin@umich.edu
542856Srdreslin@umich.edu        Fault translate(RequestPtr req, ThreadContext *tc, bool=false);
552623SN/A    };
562623SN/A
572623SN/A    class ITB : public TLB
582623SN/A    {
592623SN/A      public:
605310Ssaidi@eecs.umich.edu        ITB(const std::string &name) : TLB(name)
612623SN/A        {}
622680Sktlim@umich.edu    };
632680Sktlim@umich.edu
642623SN/A    class DTB : public TLB
652623SN/A    {
665310Ssaidi@eecs.umich.edu      public:
672623SN/A        DTB(const std::string &name) : TLB(name)
682623SN/A        {}
692623SN/A    };
702623SN/A};
712623SN/A
723349Sbinkertn@umich.edu#endif // __ARCH_MIPS_TLB_HH__
732623SN/A