tlb.hh (10687:276da6265ab8) | tlb.hh (10905:a6ca6831e775) |
---|---|
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; --- 60 unchanged lines hidden (view full) --- 69 Stats::Formula data_misses; 70 Stats::Formula data_acv; 71 Stats::Formula data_accesses; 72 73 74 typedef std::multimap<Addr, int> PageTable; 75 PageTable lookupTable; // Quick lookup into page table 76 | 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; --- 60 unchanged lines hidden (view full) --- 69 Stats::Formula data_misses; 70 Stats::Formula data_acv; 71 Stats::Formula data_accesses; 72 73 74 typedef std::multimap<Addr, int> PageTable; 75 PageTable lookupTable; // Quick lookup into page table 76 |
77 TlbEntry *table; // the Page Table 78 int size; // TLB Size | 77 std::vector<TlbEntry> table; // the Page Table |
79 int nlu; // not last used entry (for replacement) 80 | 78 int nlu; // not last used entry (for replacement) 79 |
81 void nextnlu() { if (++nlu >= size) nlu = 0; } | 80 void nextnlu() { if (++nlu >= table.size()) nlu = 0; } |
82 TlbEntry *lookup(Addr vpn, uint8_t asn); 83 84 public: 85 typedef AlphaTLBParams Params; 86 TLB(const Params *p); 87 virtual ~TLB(); 88 89 void takeOverFrom(BaseTLB *otlb) {} 90 91 virtual void regStats(); 92 | 81 TlbEntry *lookup(Addr vpn, uint8_t asn); 82 83 public: 84 typedef AlphaTLBParams Params; 85 TLB(const Params *p); 86 virtual ~TLB(); 87 88 void takeOverFrom(BaseTLB *otlb) {} 89 90 virtual void regStats(); 91 |
93 int getsize() const { return size; } | 92 int getsize() const { return table.size(); } |
94 95 TlbEntry &index(bool advance = true); 96 void insert(Addr vaddr, TlbEntry &entry); 97 98 void flushAll(); 99 void flushProcesses(); 100 void flushAddr(Addr addr, uint8_t asn); 101 --- 11 unchanged lines hidden (view full) --- 113 // unimplemented bits must be all 0 or all 1 114 Addr unimplBits = vaddr & VAddrUnImplMask; 115 return unimplBits == 0 || unimplBits == VAddrUnImplMask; 116 } 117 118 static Fault checkCacheability(RequestPtr &req, bool itb = false); 119 120 // Checkpointing | 93 94 TlbEntry &index(bool advance = true); 95 void insert(Addr vaddr, TlbEntry &entry); 96 97 void flushAll(); 98 void flushProcesses(); 99 void flushAddr(Addr addr, uint8_t asn); 100 --- 11 unchanged lines hidden (view full) --- 112 // unimplemented bits must be all 0 or all 1 113 Addr unimplBits = vaddr & VAddrUnImplMask; 114 return unimplBits == 0 || unimplBits == VAddrUnImplMask; 115 } 116 117 static Fault checkCacheability(RequestPtr &req, bool itb = false); 118 119 // Checkpointing |
121 virtual void serialize(std::ostream &os); 122 virtual void unserialize(Checkpoint *cp, const std::string §ion); | 120 void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; 121 void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; |
123 124 // Most recently used page table entries 125 TlbEntry *EntryCache[3]; 126 inline void 127 flushCache() 128 { 129 memset(EntryCache, 0, 3 * sizeof(TlbEntry*)); 130 } --- 27 unchanged lines hidden --- | 122 123 // Most recently used page table entries 124 TlbEntry *EntryCache[3]; 125 inline void 126 flushCache() 127 { 128 memset(EntryCache, 0, 3 * sizeof(TlbEntry*)); 129 } --- 27 unchanged lines hidden --- |