tlb.hh (3806:65ae5388c059) tlb.hh (3826:e35adf01a285)
1/*
2 * Copyright (c) 2006 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;

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

79 * @param real is this a real->phys or virt->phys translation
80 * @param context_id if this is virt->phys what context
81 * @return A pointer to a tlb entry
82 */
83 TlbEntry *lookup(Addr va, int partition_id, bool real, int context_id = 0);
84
85 /** Insert a PTE into the TLB. */
86 void insert(Addr vpn, int partition_id, int context_id, bool real,
1/*
2 * Copyright (c) 2006 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;

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

79 * @param real is this a real->phys or virt->phys translation
80 * @param context_id if this is virt->phys what context
81 * @return A pointer to a tlb entry
82 */
83 TlbEntry *lookup(Addr va, int partition_id, bool real, int context_id = 0);
84
85 /** Insert a PTE into the TLB. */
86 void insert(Addr vpn, int partition_id, int context_id, bool real,
87 const PageTableEntry& PTE);
87 const PageTableEntry& PTE, int entry = -1);
88
89 /** Given an entry id, read that tlb entries' tag. */
90 uint64_t TagRead(int entry);
91
92 /** Give an entry id, read that tlb entries' tte */
93 uint64_t TteRead(int entry);
94
95 /** Remove all entries from the TLB */

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

109 bool validVirtualAddress(Addr va, bool am);
110
111 void writeSfsr(ThreadContext *tc, int reg, bool write, ContextType ct,
112 bool se, FaultTypes ft, int asi);
113
114 void TLB::clearUsedBits();
115
116
88
89 /** Given an entry id, read that tlb entries' tag. */
90 uint64_t TagRead(int entry);
91
92 /** Give an entry id, read that tlb entries' tte */
93 uint64_t TteRead(int entry);
94
95 /** Remove all entries from the TLB */

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

109 bool validVirtualAddress(Addr va, bool am);
110
111 void writeSfsr(ThreadContext *tc, int reg, bool write, ContextType ct,
112 bool se, FaultTypes ft, int asi);
113
114 void TLB::clearUsedBits();
115
116
117 void writeTagAccess(ThreadContext *tc, int reg, Addr va, int context);
118
117 public:
118 TLB(const std::string &name, int size);
119
119 public:
120 TLB(const std::string &name, int size);
121
122 void dumpAll();
123
120 // Checkpointing
121 virtual void serialize(std::ostream &os);
122 virtual void unserialize(Checkpoint *cp, const std::string &section);
123};
124
125class ITB : public TLB
126{
127 public:
128 ITB(const std::string &name, int size) : TLB(name, size)
129 {
130 }
131
132 Fault translate(RequestPtr &req, ThreadContext *tc);
133 private:
134 void writeSfsr(ThreadContext *tc, bool write, ContextType ct,
135 bool se, FaultTypes ft, int asi);
124 // Checkpointing
125 virtual void serialize(std::ostream &os);
126 virtual void unserialize(Checkpoint *cp, const std::string &section);
127};
128
129class ITB : public TLB
130{
131 public:
132 ITB(const std::string &name, int size) : TLB(name, size)
133 {
134 }
135
136 Fault translate(RequestPtr &req, ThreadContext *tc);
137 private:
138 void writeSfsr(ThreadContext *tc, bool write, ContextType ct,
139 bool se, FaultTypes ft, int asi);
140 void writeTagAccess(ThreadContext *tc, Addr va, int context);
141 friend class DTB;
136};
137
138class DTB : public TLB
139{
140 public:
141 DTB(const std::string &name, int size) : TLB(name, size)
142 {
143 }
144
145 Fault translate(RequestPtr &req, ThreadContext *tc, bool write);
146 Tick doMmuRegRead(ThreadContext *tc, Packet *pkt);
147 Tick doMmuRegWrite(ThreadContext *tc, Packet *pkt);
148
149 private:
150 void writeSfr(ThreadContext *tc, Addr a, bool write, ContextType ct,
151 bool se, FaultTypes ft, int asi);
142};
143
144class DTB : public TLB
145{
146 public:
147 DTB(const std::string &name, int size) : TLB(name, size)
148 {
149 }
150
151 Fault translate(RequestPtr &req, ThreadContext *tc, bool write);
152 Tick doMmuRegRead(ThreadContext *tc, Packet *pkt);
153 Tick doMmuRegWrite(ThreadContext *tc, Packet *pkt);
154
155 private:
156 void writeSfr(ThreadContext *tc, Addr a, bool write, ContextType ct,
157 bool se, FaultTypes ft, int asi);
158 void writeTagAccess(ThreadContext *tc, Addr va, int context);
152
159
160
153};
154
155}
156
157#endif // __ARCH_SPARC_TLB_HH__
161};
162
163}
164
165#endif // __ARCH_SPARC_TLB_HH__