Deleted Added
sdiff udiff text old ( 10824:308771bd2647 ) new ( 10905:a6ca6831e775 )
full compact
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 <memory>
34#include <string>
35#include <vector>
36
37#include "arch/alpha/faults.hh"
38#include "arch/alpha/pagetable.hh"
39#include "arch/alpha/tlb.hh"
40#include "arch/generic/debugfaults.hh"
41#include "base/inifile.hh"
42#include "base/str.hh"
43#include "base/trace.hh"
44#include "cpu/thread_context.hh"
45#include "debug/TLB.hh"
46#include "sim/full_system.hh"
47

--- 9 unchanged lines hidden (view full) ---

57#ifdef DEBUG
58bool uncacheBit39 = false;
59bool uncacheBit40 = false;
60#endif
61
62#define MODE2MASK(X) (1 << (X))
63
64TLB::TLB(const Params *p)
65 : BaseTLB(p), size(p->size), nlu(0)
66{
67 table = new TlbEntry[size];
68 memset(table, 0, sizeof(TlbEntry) * size);
69 flushCache();
70}
71
72TLB::~TLB()
73{
74 if (table)
75 delete [] table;
76}
77
78void
79TLB::regStats()
80{
81 fetch_hits
82 .name(name() + ".fetch_hits")
83 .desc("ITB hits");

--- 194 unchanged lines hidden (view full) ---

278 lookupTable.insert(make_pair(vaddr.vpn(), nlu));
279 nextnlu();
280}
281
282void
283TLB::flushAll()
284{
285 DPRINTF(TLB, "flushAll\n");
286 memset(table, 0, sizeof(TlbEntry) * size);
287 flushCache();
288 lookupTable.clear();
289 nlu = 0;
290}
291
292void
293TLB::flushProcesses()
294{

--- 45 unchanged lines hidden (view full) ---

340 } else {
341 ++i;
342 }
343 }
344}
345
346
347void
348TLB::serialize(ostream &os)
349{
350 SERIALIZE_SCALAR(size);
351 SERIALIZE_SCALAR(nlu);
352
353 for (int i = 0; i < size; i++) {
354 nameOut(os, csprintf("%s.Entry%d", name(), i));
355 table[i].serialize(os);
356 }
357}
358
359void
360TLB::unserialize(Checkpoint *cp, const string &section)
361{
362 UNSERIALIZE_SCALAR(size);
363 UNSERIALIZE_SCALAR(nlu);
364
365 for (int i = 0; i < size; i++) {
366 table[i].unserialize(cp, csprintf("%s.Entry%d", section, i));
367 if (table[i].valid) {
368 lookupTable.insert(make_pair(table[i].tag, i));
369 }
370 }
371}
372
373Fault
374TLB::translateInst(RequestPtr req, ThreadContext *tc)

--- 262 unchanged lines hidden ---