1/* 2 * Copyright (c) 2001-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 16 unchanged lines hidden (view full) --- 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 * Authors: Nathan Binkert 29 * Steve Reinhardt 30 * Andrew Schultz 31 */ 32 |
33#include "arch/alpha/tlb.hh" 34 35#include <algorithm> |
36#include <memory> 37#include <string> 38#include <vector> 39 40#include "arch/alpha/faults.hh" 41#include "arch/alpha/pagetable.hh" |
42#include "arch/generic/debugfaults.hh" 43#include "base/inifile.hh" 44#include "base/str.hh" 45#include "base/trace.hh" 46#include "cpu/thread_context.hh" 47#include "debug/TLB.hh" 48#include "sim/full_system.hh" 49 --- 9 unchanged lines hidden (view full) --- 59#ifdef DEBUG 60bool uncacheBit39 = false; 61bool uncacheBit40 = false; 62#endif 63 64#define MODE2MASK(X) (1 << (X)) 65 66TLB::TLB(const Params *p) |
67 : BaseTLB(p), table(p->size), nlu(0) |
68{ |
69 flushCache(); 70} 71 72TLB::~TLB() 73{ |
74} 75 76void 77TLB::regStats() 78{ 79 fetch_hits 80 .name(name() + ".fetch_hits") 81 .desc("ITB hits"); --- 194 unchanged lines hidden (view full) --- 276 lookupTable.insert(make_pair(vaddr.vpn(), nlu)); 277 nextnlu(); 278} 279 280void 281TLB::flushAll() 282{ 283 DPRINTF(TLB, "flushAll\n"); |
284 std::fill(table.begin(), table.end(), TlbEntry()); |
285 flushCache(); 286 lookupTable.clear(); 287 nlu = 0; 288} 289 290void 291TLB::flushProcesses() 292{ --- 45 unchanged lines hidden (view full) --- 338 } else { 339 ++i; 340 } 341 } 342} 343 344 345void |
346TLB::serialize(CheckpointOut &cp) const |
347{ |
348 const unsigned size(table.size()); |
349 SERIALIZE_SCALAR(size); 350 SERIALIZE_SCALAR(nlu); 351 |
352 for (int i = 0; i < size; i++) 353 table[i].serializeSection(cp, csprintf("Entry%d", i)); |
354} 355 356void |
357TLB::unserialize(CheckpointIn &cp) |
358{ |
359 unsigned size(0); |
360 UNSERIALIZE_SCALAR(size); 361 UNSERIALIZE_SCALAR(nlu); 362 |
363 table.resize(size); |
364 for (int i = 0; i < size; i++) { |
365 table[i].unserializeSection(cp, csprintf("Entry%d", i)); |
366 if (table[i].valid) { 367 lookupTable.insert(make_pair(table[i].tag, i)); 368 } 369 } 370} 371 372Fault 373TLB::translateInst(RequestPtr req, ThreadContext *tc) --- 262 unchanged lines hidden --- |