gem5  v21.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tlb.cc
Go to the documentation of this file.
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;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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 
29 #include "arch/sparc/tlb.hh"
30 
31 #include <cstring>
32 
33 #include "arch/sparc/asi.hh"
34 #include "arch/sparc/faults.hh"
35 #include "arch/sparc/interrupts.hh"
36 #include "arch/sparc/mmu.hh"
37 #include "arch/sparc/registers.hh"
38 #include "base/bitfield.hh"
39 #include "base/compiler.hh"
40 #include "base/trace.hh"
41 #include "cpu/base.hh"
42 #include "cpu/thread_context.hh"
43 #include "debug/IPR.hh"
44 #include "debug/TLB.hh"
45 #include "mem/packet_access.hh"
46 #include "mem/page_table.hh"
47 #include "mem/request.hh"
48 #include "sim/full_system.hh"
49 #include "sim/process.hh"
50 #include "sim/system.hh"
51 
52 /* @todo remove some of the magic constants. -- ali
53  * */
54 namespace SparcISA {
55 
56 TLB::TLB(const Params &p)
57  : BaseTLB(p), size(p.size), usedEntries(0), lastReplaced(0),
58  cacheState(0), cacheValid(false)
59 {
60  // To make this work you'll have to change the hypervisor and OS
61  if (size > 64)
62  fatal("SPARC T1 TLB registers don't support more than 64 TLB entries");
63 
64  tlb = new TlbEntry[size];
65  std::memset((void *)tlb, 0, sizeof(TlbEntry) * size);
66 
67  for (int x = 0; x < size; x++)
68  freeList.push_back(&tlb[x]);
69 
70  c0_tsb_ps0 = 0;
71  c0_tsb_ps1 = 0;
72  c0_config = 0;
73  cx_tsb_ps0 = 0;
74  cx_tsb_ps1 = 0;
75  cx_config = 0;
76  sfsr = 0;
77  tag_access = 0;
78  sfar = 0;
79  cacheEntry[0] = NULL;
80  cacheEntry[1] = NULL;
81 }
82 
83 void
85 {
86  MapIter i;
87  for (i = lookupTable.begin(); i != lookupTable.end(); i++) {
88  TlbEntry *t = i->second;
89  if (!t->pte.locked()) {
90  t->used = false;
91  usedEntries--;
92  }
93  }
94 }
95 
96 
97 void
98 TLB::insert(Addr va, int partition_id, int context_id, bool real,
99  const PageTableEntry& PTE, int entry)
100 {
101  MapIter i;
102  TlbEntry *new_entry = NULL;
103  int x;
104 
105  cacheValid = false;
106  va &= ~(PTE.size()-1);
107 
108  DPRINTF(TLB,
109  "TLB: Inserting Entry; va=%#x pa=%#x pid=%d cid=%d r=%d entryid=%d\n",
110  va, PTE.paddr(), partition_id, context_id, (int)real, entry);
111 
112  // Demap any entry that conflicts
113  for (x = 0; x < size; x++) {
114  if (tlb[x].range.real == real &&
115  tlb[x].range.partitionId == partition_id &&
116  tlb[x].range.va < va + PTE.size() - 1 &&
117  tlb[x].range.va + tlb[x].range.size >= va &&
118  (real || tlb[x].range.contextId == context_id ))
119  {
120  if (tlb[x].valid) {
121  freeList.push_front(&tlb[x]);
122  DPRINTF(TLB, "TLB: Conflicting entry %#X , deleting it\n", x);
123 
124  tlb[x].valid = false;
125  if (tlb[x].used) {
126  tlb[x].used = false;
127  usedEntries--;
128  }
129  lookupTable.erase(tlb[x].range);
130  }
131  }
132  }
133 
134  if (entry != -1) {
135  assert(entry < size && entry >= 0);
136  new_entry = &tlb[entry];
137  } else {
138  if (!freeList.empty()) {
139  new_entry = freeList.front();
140  } else {
141  x = lastReplaced;
142  do {
143  ++x;
144  if (x == size)
145  x = 0;
146  if (x == lastReplaced)
147  goto insertAllLocked;
148  } while (tlb[x].pte.locked());
149  lastReplaced = x;
150  new_entry = &tlb[x];
151  }
152  }
153 
154 insertAllLocked:
155  // Update the last ently if their all locked
156  if (!new_entry) {
157  new_entry = &tlb[size-1];
158  }
159 
160  freeList.remove(new_entry);
161  if (new_entry->valid && new_entry->used)
162  usedEntries--;
163  if (new_entry->valid)
164  lookupTable.erase(new_entry->range);
165 
166 
167  assert(PTE.valid());
168  new_entry->range.va = va;
169  new_entry->range.size = PTE.size() - 1;
170  new_entry->range.partitionId = partition_id;
171  new_entry->range.contextId = context_id;
172  new_entry->range.real = real;
173  new_entry->pte = PTE;
174  new_entry->used = true;;
175  new_entry->valid = true;
176  usedEntries++;
177 
178  i = lookupTable.insert(new_entry->range, new_entry);
179  assert(i != lookupTable.end());
180 
181  // If all entries have their used bit set, clear it on them all,
182  // but the one we just inserted
183  if (usedEntries == size) {
184  clearUsedBits();
185  new_entry->used = true;
186  usedEntries++;
187  }
188 }
189 
190 
191 TlbEntry*
192 TLB::lookup(Addr va, int partition_id, bool real, int context_id,
193  bool update_used)
194 {
195  MapIter i;
196  TlbRange tr;
197  TlbEntry *t;
198 
199  DPRINTF(TLB, "TLB: Looking up entry va=%#x pid=%d cid=%d r=%d\n",
200  va, partition_id, context_id, real);
201  // Assemble full address structure
202  tr.va = va;
203  tr.size = 1;
204  tr.contextId = context_id;
205  tr.partitionId = partition_id;
206  tr.real = real;
207 
208  // Try to find the entry
209  i = lookupTable.find(tr);
210  if (i == lookupTable.end()) {
211  DPRINTF(TLB, "TLB: No valid entry found\n");
212  return NULL;
213  }
214 
215  // Mark the entries used bit and clear other used bits in needed
216  t = i->second;
217  DPRINTF(TLB, "TLB: Valid entry found pa: %#x size: %#x\n", t->pte.paddr(),
218  t->pte.size());
219 
220  // Update the used bits only if this is a real access (not a fake
221  // one from virttophys()
222  if (!t->used && update_used) {
223  t->used = true;
224  usedEntries++;
225  if (usedEntries == size) {
226  clearUsedBits();
227  t->used = true;
228  usedEntries++;
229  }
230  }
231 
232  return t;
233 }
234 
235 void
237 {
238  MapIter i;
239  for (int x = 0; x < size; x++) {
240  if (tlb[x].valid) {
241  DPRINTFN("%4d: %#2x:%#2x %c %#4x %#8x %#8x %#16x\n",
242  x, tlb[x].range.partitionId, tlb[x].range.contextId,
243  tlb[x].range.real ? 'R' : ' ', tlb[x].range.size,
244  tlb[x].range.va, tlb[x].pte.paddr(), tlb[x].pte());
245  }
246  }
247 }
248 
249 void
250 TLB::demapPage(Addr va, int partition_id, bool real, int context_id)
251 {
252  TlbRange tr;
253  MapIter i;
254 
255  DPRINTF(IPR, "TLB: Demapping Page va=%#x pid=%#d cid=%d r=%d\n",
256  va, partition_id, context_id, real);
257 
258  cacheValid = false;
259 
260  // Assemble full address structure
261  tr.va = va;
262  tr.size = 1;
263  tr.contextId = context_id;
264  tr.partitionId = partition_id;
265  tr.real = real;
266 
267  // Demap any entry that conflicts
268  i = lookupTable.find(tr);
269  if (i != lookupTable.end()) {
270  DPRINTF(IPR, "TLB: Demapped page\n");
271  i->second->valid = false;
272  if (i->second->used) {
273  i->second->used = false;
274  usedEntries--;
275  }
276  freeList.push_front(i->second);
278  }
279 }
280 
281 void
282 TLB::demapContext(int partition_id, int context_id)
283 {
284  DPRINTF(IPR, "TLB: Demapping Context pid=%#d cid=%d\n",
285  partition_id, context_id);
286  cacheValid = false;
287  for (int x = 0; x < size; x++) {
288  if (tlb[x].range.contextId == context_id &&
289  tlb[x].range.partitionId == partition_id) {
290  if (tlb[x].valid) {
291  freeList.push_front(&tlb[x]);
292  }
293  tlb[x].valid = false;
294  if (tlb[x].used) {
295  tlb[x].used = false;
296  usedEntries--;
297  }
298  lookupTable.erase(tlb[x].range);
299  }
300  }
301 }
302 
303 void
304 TLB::demapAll(int partition_id)
305 {
306  DPRINTF(TLB, "TLB: Demapping All pid=%#d\n", partition_id);
307  cacheValid = false;
308  for (int x = 0; x < size; x++) {
309  if (tlb[x].valid && !tlb[x].pte.locked() &&
310  tlb[x].range.partitionId == partition_id) {
311  freeList.push_front(&tlb[x]);
312  tlb[x].valid = false;
313  if (tlb[x].used) {
314  tlb[x].used = false;
315  usedEntries--;
316  }
317  lookupTable.erase(tlb[x].range);
318  }
319  }
320 }
321 
322 void
324 {
325  cacheValid = false;
326  lookupTable.clear();
327 
328  for (int x = 0; x < size; x++) {
329  if (tlb[x].valid)
330  freeList.push_back(&tlb[x]);
331  tlb[x].valid = false;
332  tlb[x].used = false;
333  }
334  usedEntries = 0;
335 }
336 
337 uint64_t
338 TLB::TteRead(int entry)
339 {
340  if (entry >= size)
341  panic("entry: %d\n", entry);
342 
343  assert(entry < size);
344  if (tlb[entry].valid)
345  return tlb[entry].pte();
346  else
347  return (uint64_t)-1ll;
348 }
349 
350 uint64_t
351 TLB::TagRead(int entry)
352 {
353  assert(entry < size);
354  uint64_t tag;
355  if (!tlb[entry].valid)
356  return (uint64_t)-1ll;
357 
358  tag = tlb[entry].range.contextId;
359  tag |= tlb[entry].range.va;
360  tag |= (uint64_t)tlb[entry].range.partitionId << 61;
361  tag |= tlb[entry].range.real ? ULL(1) << 60 : 0;
362  tag |= (uint64_t)~tlb[entry].pte._size() << 56;
363  return tag;
364 }
365 
366 bool
368 {
369  if (am)
370  return true;
371  if (va >= StartVAddrHole && va <= EndVAddrHole)
372  return false;
373  return true;
374 }
375 
376 void
377 TLB::writeSfsr(bool write, ContextType ct, bool se, FaultTypes ft, int asi)
378 {
379  if (sfsr & 0x1)
380  sfsr = 0x3;
381  else
382  sfsr = 1;
383 
384  if (write)
385  sfsr |= 1 << 2;
386  sfsr |= ct << 4;
387  if (se)
388  sfsr |= 1 << 6;
389  sfsr |= ft << 7;
390  sfsr |= asi << 16;
391 }
392 
393 void
395 {
396  DPRINTF(TLB, "TLB: Writing Tag Access: va: %#X ctx: %#X value: %#X\n",
397  va, context, mbits(va, 63,13) | mbits(context,12,0));
398 
399  tag_access = mbits(va, 63,13) | mbits(context,12,0);
400 }
401 
402 void
404  bool se, FaultTypes ft, int asi)
405 {
406  DPRINTF(TLB, "TLB: Fault: A=%#x w=%d ct=%d ft=%d asi=%d\n",
407  a, (int)write, ct, ft, asi);
408  TLB::writeSfsr(write, ct, se, ft, asi);
409  sfar = a;
410 }
411 
412 Fault
414 {
415  uint64_t tlbdata = tc->readMiscRegNoEffect(MISCREG_TLB_DATA);
416 
417  Addr vaddr = req->getVaddr();
418  TlbEntry *e;
419 
420  assert(req->getArchFlags() == ASI_IMPLICIT);
421 
422  DPRINTF(TLB, "TLB: ITB Request to translate va=%#x size=%d\n",
423  vaddr, req->getSize());
424 
425  // Be fast if we can!
426  if (cacheValid && cacheState == tlbdata) {
427  if (cacheEntry[0]) {
428  if (cacheEntry[0]->range.va < vaddr + sizeof(MachInst) &&
429  cacheEntry[0]->range.va + cacheEntry[0]->range.size >= vaddr) {
430  req->setPaddr(cacheEntry[0]->pte.translate(vaddr));
431  return NoFault;
432  }
433  } else {
434  req->setPaddr(vaddr & PAddrImplMask);
435  return NoFault;
436  }
437  }
438 
439  bool hpriv = bits(tlbdata,0,0);
440  bool red = bits(tlbdata,1,1);
441  bool priv = bits(tlbdata,2,2);
442  bool addr_mask = bits(tlbdata,3,3);
443  bool lsu_im = bits(tlbdata,4,4);
444 
445  int part_id = bits(tlbdata,15,8);
446  int tl = bits(tlbdata,18,16);
447  int pri_context = bits(tlbdata,47,32);
448  int context;
449  ContextType ct;
450  int asi;
451  bool real = false;
452 
453  DPRINTF(TLB, "TLB: priv:%d hpriv:%d red:%d lsuim:%d part_id: %#X\n",
454  priv, hpriv, red, lsu_im, part_id);
455 
456  if (tl > 0) {
457  asi = ASI_N;
458  ct = Nucleus;
459  context = 0;
460  } else {
461  asi = ASI_P;
462  ct = Primary;
463  context = pri_context;
464  }
465 
466  if ( hpriv || red ) {
467  cacheValid = true;
468  cacheState = tlbdata;
469  cacheEntry[0] = NULL;
470  req->setPaddr(vaddr & PAddrImplMask);
471  return NoFault;
472  }
473 
474  // If the access is unaligned trap
475  if (vaddr & 0x3) {
476  writeSfsr(false, ct, false, OtherFault, asi);
477  return std::make_shared<MemAddressNotAligned>();
478  }
479 
480  if (addr_mask)
481  vaddr = vaddr & VAddrAMask;
482 
483  if (!validVirtualAddress(vaddr, addr_mask)) {
484  writeSfsr(false, ct, false, VaOutOfRange, asi);
485  return std::make_shared<InstructionAccessException>();
486  }
487 
488  if (!lsu_im) {
489  e = lookup(vaddr, part_id, true);
490  real = true;
491  context = 0;
492  } else {
493  e = lookup(vaddr, part_id, false, context);
494  }
495 
496  if (e == NULL || !e->valid) {
497  writeTagAccess(vaddr, context);
498  if (real) {
499  return std::make_shared<InstructionRealTranslationMiss>();
500  } else {
501  if (FullSystem)
502  return std::make_shared<FastInstructionAccessMMUMiss>();
503  else
504  return std::make_shared<FastInstructionAccessMMUMiss>(
505  req->getVaddr());
506  }
507  }
508 
509  // were not priviledged accesing priv page
510  if (!priv && e->pte.priv()) {
511  writeTagAccess(vaddr, context);
512  writeSfsr(false, ct, false, PrivViolation, asi);
513  return std::make_shared<InstructionAccessException>();
514  }
515 
516  // cache translation date for next translation
517  cacheValid = true;
518  cacheState = tlbdata;
519  cacheEntry[0] = e;
520 
521  req->setPaddr(e->pte.translate(vaddr));
522  DPRINTF(TLB, "TLB: %#X -> %#X\n", vaddr, req->getPaddr());
523  return NoFault;
524 }
525 
526 Fault
527 TLB::translateData(const RequestPtr &req, ThreadContext *tc, bool write)
528 {
529  /*
530  * @todo this could really use some profiling and fixing to make
531  * it faster!
532  */
533  uint64_t tlbdata = tc->readMiscRegNoEffect(MISCREG_TLB_DATA);
534  Addr vaddr = req->getVaddr();
535  Addr size = req->getSize();
536  ASI asi;
537  asi = (ASI)req->getArchFlags();
538  bool implicit = false;
539  bool hpriv = bits(tlbdata,0,0);
540  bool unaligned = vaddr & (size - 1);
541 
542  DPRINTF(TLB, "TLB: DTB Request to translate va=%#x size=%d asi=%#x\n",
543  vaddr, size, asi);
544 
545  if (lookupTable.size() != 64 - freeList.size())
546  panic("Lookup table size: %d tlb size: %d\n", lookupTable.size(),
547  freeList.size());
548  if (asi == ASI_IMPLICIT)
549  implicit = true;
550 
551  // Only use the fast path here if there doesn't need to be an unaligned
552  // trap later
553  if (!unaligned) {
554  if (hpriv && implicit) {
555  req->setPaddr(vaddr & PAddrImplMask);
556  return NoFault;
557  }
558 
559  // Be fast if we can!
560  if (cacheValid && cacheState == tlbdata) {
561 
562 
563 
564  if (cacheEntry[0]) {
565  TlbEntry *ce = cacheEntry[0];
566  Addr ce_va = ce->range.va;
567  if (cacheAsi[0] == asi &&
568  ce_va < vaddr + size && ce_va + ce->range.size > vaddr &&
569  (!write || ce->pte.writable())) {
570  req->setPaddr(ce->pte.translate(vaddr));
571  if (ce->pte.sideffect() || (ce->pte.paddr() >> 39) & 1) {
572  req->setFlags(
574  }
575  DPRINTF(TLB, "TLB: %#X -> %#X\n", vaddr, req->getPaddr());
576  return NoFault;
577  } // if matched
578  } // if cache entry valid
579  if (cacheEntry[1]) {
580  TlbEntry *ce = cacheEntry[1];
581  Addr ce_va = ce->range.va;
582  if (cacheAsi[1] == asi &&
583  ce_va < vaddr + size && ce_va + ce->range.size > vaddr &&
584  (!write || ce->pte.writable())) {
585  req->setPaddr(ce->pte.translate(vaddr));
586  if (ce->pte.sideffect() || (ce->pte.paddr() >> 39) & 1) {
587  req->setFlags(
589  }
590  DPRINTF(TLB, "TLB: %#X -> %#X\n", vaddr, req->getPaddr());
591  return NoFault;
592  } // if matched
593  } // if cache entry valid
594  }
595  }
596 
597  bool red = bits(tlbdata,1,1);
598  bool priv = bits(tlbdata,2,2);
599  bool addr_mask = bits(tlbdata,3,3);
600  bool lsu_dm = bits(tlbdata,5,5);
601 
602  int part_id = bits(tlbdata,15,8);
603  int tl = bits(tlbdata,18,16);
604  int pri_context = bits(tlbdata,47,32);
605  int sec_context = bits(tlbdata,63,48);
606 
607  bool real = false;
608  ContextType ct = Primary;
609  int context = 0;
610 
611  TlbEntry *e;
612 
613  DPRINTF(TLB, "TLB: priv:%d hpriv:%d red:%d lsudm:%d part_id: %#X\n",
614  priv, hpriv, red, lsu_dm, part_id);
615 
616  if (implicit) {
617  if (tl > 0) {
618  asi = ASI_N;
619  ct = Nucleus;
620  context = 0;
621  } else {
622  asi = ASI_P;
623  ct = Primary;
624  context = pri_context;
625  }
626  } else {
627  // We need to check for priv level/asi priv
628  if (!priv && !hpriv && !asiIsUnPriv(asi)) {
629  // It appears that context should be Nucleus in these cases?
630  writeSfsr(vaddr, write, Nucleus, false, IllegalAsi, asi);
631  return std::make_shared<PrivilegedAction>();
632  }
633 
634  if (!hpriv && asiIsHPriv(asi)) {
635  writeSfsr(vaddr, write, Nucleus, false, IllegalAsi, asi);
636  return std::make_shared<DataAccessException>();
637  }
638 
639  if (asiIsPrimary(asi)) {
640  context = pri_context;
641  ct = Primary;
642  } else if (asiIsSecondary(asi)) {
643  context = sec_context;
644  ct = Secondary;
645  } else if (asiIsNucleus(asi)) {
646  ct = Nucleus;
647  context = 0;
648  } else { // ????
649  ct = Primary;
650  context = pri_context;
651  }
652  }
653 
654  if (!implicit && asi != ASI_P && asi != ASI_S) {
655  if (asiIsLittle(asi))
656  panic("Little Endian ASIs not supported\n");
657 
658  if (asiIsPartialStore(asi))
659  panic("Partial Store ASIs not supported\n");
660 
661  if (asiIsCmt(asi))
662  panic("Cmt ASI registers not implmented\n");
663 
664  if (asiIsInterrupt(asi))
665  goto handleIntRegAccess;
666  if (asiIsMmu(asi))
667  goto handleMmuRegAccess;
668  if (asiIsScratchPad(asi))
669  goto handleScratchRegAccess;
670  if (asiIsQueue(asi))
671  goto handleQueueRegAccess;
672  if (asiIsSparcError(asi))
673  goto handleSparcErrorRegAccess;
674 
675  if (!asiIsReal(asi) && !asiIsNucleus(asi) && !asiIsAsIfUser(asi) &&
676  !asiIsTwin(asi) && !asiIsBlock(asi) && !asiIsNoFault(asi))
677  panic("Accessing ASI %#X. Should we?\n", asi);
678  }
679 
680  // If the asi is unaligned trap
681  if (unaligned) {
682  writeSfsr(vaddr, false, ct, false, OtherFault, asi);
683  return std::make_shared<MemAddressNotAligned>();
684  }
685 
686  if (addr_mask)
687  vaddr = vaddr & VAddrAMask;
688 
689  if (!validVirtualAddress(vaddr, addr_mask)) {
690  writeSfsr(vaddr, false, ct, true, VaOutOfRange, asi);
691  return std::make_shared<DataAccessException>();
692  }
693 
694  if ((!lsu_dm && !hpriv && !red) || asiIsReal(asi)) {
695  real = true;
696  context = 0;
697  }
698 
699  if (hpriv && (implicit || (!asiIsAsIfUser(asi) && !asiIsReal(asi)))) {
700  req->setPaddr(vaddr & PAddrImplMask);
701  return NoFault;
702  }
703 
704  e = lookup(vaddr, part_id, real, context);
705 
706  if (e == NULL || !e->valid) {
707  writeTagAccess(vaddr, context);
708  DPRINTF(TLB, "TLB: DTB Failed to find matching TLB entry\n");
709  if (real) {
710  return std::make_shared<DataRealTranslationMiss>();
711  } else {
712  if (FullSystem)
713  return std::make_shared<FastDataAccessMMUMiss>();
714  else
715  return std::make_shared<FastDataAccessMMUMiss>(
716  req->getVaddr());
717  }
718 
719  }
720 
721  if (!priv && e->pte.priv()) {
722  writeTagAccess(vaddr, context);
723  writeSfsr(vaddr, write, ct, e->pte.sideffect(), PrivViolation, asi);
724  return std::make_shared<DataAccessException>();
725  }
726 
727  if (write && !e->pte.writable()) {
728  writeTagAccess(vaddr, context);
729  writeSfsr(vaddr, write, ct, e->pte.sideffect(), OtherFault, asi);
730  return std::make_shared<FastDataAccessProtection>();
731  }
732 
733  if (e->pte.nofault() && !asiIsNoFault(asi)) {
734  writeTagAccess(vaddr, context);
735  writeSfsr(vaddr, write, ct, e->pte.sideffect(), LoadFromNfo, asi);
736  return std::make_shared<DataAccessException>();
737  }
738 
739  if (e->pte.sideffect() && asiIsNoFault(asi)) {
740  writeTagAccess(vaddr, context);
741  writeSfsr(vaddr, write, ct, e->pte.sideffect(), SideEffect, asi);
742  return std::make_shared<DataAccessException>();
743  }
744 
745  if (e->pte.sideffect() || (e->pte.paddr() >> 39) & 1)
747 
748  // cache translation date for next translation
749  cacheState = tlbdata;
750  if (!cacheValid) {
751  cacheEntry[1] = NULL;
752  cacheEntry[0] = NULL;
753  }
754 
755  if (cacheEntry[0] != e && cacheEntry[1] != e) {
756  cacheEntry[1] = cacheEntry[0];
757  cacheEntry[0] = e;
758  cacheAsi[1] = cacheAsi[0];
759  cacheAsi[0] = asi;
760  if (implicit)
761  cacheAsi[0] = (ASI)0;
762  }
763  cacheValid = true;
764  req->setPaddr(e->pte.translate(vaddr));
765  DPRINTF(TLB, "TLB: %#X -> %#X\n", vaddr, req->getPaddr());
766  return NoFault;
767 
769 handleIntRegAccess:
770  if (!hpriv) {
771  writeSfsr(vaddr, write, Primary, true, IllegalAsi, asi);
772  if (priv)
773  return std::make_shared<DataAccessException>();
774  else
775  return std::make_shared<PrivilegedAction>();
776  }
777 
778  if ((asi == ASI_SWVR_UDB_INTR_W && !write) ||
779  (asi == ASI_SWVR_UDB_INTR_R && write)) {
780  writeSfsr(vaddr, write, Primary, true, IllegalAsi, asi);
781  return std::make_shared<DataAccessException>();
782  }
783 
784  goto regAccessOk;
785 
786 
787 handleScratchRegAccess:
788  if (vaddr > 0x38 || (vaddr >= 0x20 && vaddr < 0x30 && !hpriv)) {
789  writeSfsr(vaddr, write, Primary, true, IllegalAsi, asi);
790  return std::make_shared<DataAccessException>();
791  }
792  goto regAccessOk;
793 
794 handleQueueRegAccess:
795  if (!priv && !hpriv) {
796  writeSfsr(vaddr, write, Primary, true, IllegalAsi, asi);
797  return std::make_shared<PrivilegedAction>();
798  }
799  if ((!hpriv && vaddr & 0xF) || vaddr > 0x3f8 || vaddr < 0x3c0) {
800  writeSfsr(vaddr, write, Primary, true, IllegalAsi, asi);
801  return std::make_shared<DataAccessException>();
802  }
803  goto regAccessOk;
804 
805 handleSparcErrorRegAccess:
806  if (!hpriv) {
807  writeSfsr(vaddr, write, Primary, true, IllegalAsi, asi);
808  if (priv)
809  return std::make_shared<DataAccessException>();
810  else
811  return std::make_shared<PrivilegedAction>();
812  }
813  goto regAccessOk;
814 
815 
816 regAccessOk:
817 handleMmuRegAccess:
818  DPRINTF(TLB, "TLB: DTB Translating local access\n");
819  req->setLocalAccessor(
820  [this,write](ThreadContext *tc, PacketPtr pkt) -> Cycles
821  {
822  return write ? doMmuRegWrite(tc, pkt) : doMmuRegRead(tc, pkt);
823  }
824  );
825  req->setPaddr(req->getVaddr());
826  return NoFault;
827 };
828 
829 Fault
831 {
832  if (mode == Execute)
833  return translateInst(req, tc);
834  else
835  return translateData(req, tc, mode == Write);
836 }
837 
838 Fault
840 {
841  Addr vaddr = req->getVaddr();
842 
843  // Here we have many options and are really implementing something like
844  // a fill handler to find the address since there isn't a multilevel
845  // table for us to walk around.
846  //
847  // 1. We are currently hyperpriv, return the address unmodified
848  // 2. The mmu is off return(ra->pa)
849  // 3. We are currently priv, use ctx0* tsbs to find the page
850  // 4. We are not priv, use ctxN0* tsbs to find the page
851  // For all accesses we check the tlbs first since it's possible that
852  // long standing pages (e.g. locked kernel mappings) won't be in the tsb
853  uint64_t tlbdata = tc->readMiscRegNoEffect(MISCREG_TLB_DATA);
854 
855  bool hpriv = bits(tlbdata,0,0);
856  // bool priv = bits(tlbdata,2,2);
857  bool addr_mask = bits(tlbdata,3,3);
858  bool data_real = !bits(tlbdata,5,5);
859  bool inst_real = !bits(tlbdata,4,4);
860  bool ctx_zero = bits(tlbdata,18,16) > 0;
861  int part_id = bits(tlbdata,15,8);
862  int pri_context = bits(tlbdata,47,32);
863  // int sec_context = bits(tlbdata,63,48);
864 
865  bool real = (mode == Execute) ? inst_real : data_real;
866 
867  TlbEntry* tbe;
868  PageTableEntry pte;
869  Addr tsbs[4];
870  Addr va_tag;
871  TteTag ttetag;
872 
873  if (hpriv) {
874  req->setPaddr(vaddr);
875  return NoFault;
876  }
877 
878  if (addr_mask)
879  vaddr = vaddr & VAddrAMask;
880 
881  if (!validVirtualAddress(vaddr, addr_mask)) {
882  if (mode == Execute)
883  return std::make_shared<InstructionAccessException>();
884  else
885  return std::make_shared<DataAccessException>();
886  }
887 
888  tbe = lookup(vaddr, part_id, real, ctx_zero ? 0 : pri_context, false);
889  if (tbe) {
890  pte = tbe->pte;
891  DPRINTF(TLB, "Virtual(%#x)->Physical(%#x) found in TLB\n", vaddr,
892  pte.translate(vaddr));
893  req->setPaddr(pte.translate(vaddr));
894  return NoFault;
895  }
896 
897  if (!FullSystem)
898  return tc->getProcessPtr()->pTable->translate(req);
899 
900  PortProxy &mem = tc->getPhysProxy();
901  // We didn't find it in the tlbs, so lets look at the TSBs
902  GetTsbPtr(tc, vaddr, ctx_zero ? 0 : pri_context, tsbs);
903  va_tag = bits(vaddr, 63, 22);
904  for (int x = 0; x < 4; x++) {
905  ttetag = betoh(mem.read<uint64_t>(tsbs[x]));
906  if (ttetag.valid() && ttetag.va() == va_tag) {
907  uint64_t entry = mem.read<uint64_t>(tsbs[x]) + sizeof(uint64_t);
908  // I think it's sun4v at least!
909  pte.populate(betoh(entry), PageTableEntry::sun4v);
910  DPRINTF(TLB, "Virtual(%#x)->Physical(%#x) found in TTE\n",
911  vaddr, pte.translate(vaddr));
912  req->setPaddr(pte.translate(vaddr));
913  return NoFault;
914  }
915  }
916 
917  if (mode == Execute) {
918  if (real)
919  return std::make_shared<InstructionRealTranslationMiss>();
920  else if (FullSystem)
921  return std::make_shared<FastInstructionAccessMMUMiss>();
922  else
923  return std::make_shared<FastInstructionAccessMMUMiss>(vaddr);
924  } else {
925  if (real)
926  return std::make_shared<DataRealTranslationMiss>();
927  else if (FullSystem)
928  return std::make_shared<FastDataAccessMMUMiss>();
929  else
930  return std::make_shared<FastDataAccessMMUMiss>(vaddr);
931  }
932 }
933 
934 void
936  Translation *translation, Mode mode)
937 {
938  assert(translation);
939  translation->finish(translateAtomic(req, tc, mode), req, tc, mode);
940 }
941 
942 Fault
944  ThreadContext *tc, Mode mode) const
945 {
946  return NoFault;
947 }
948 
949 Cycles
951 {
952  Addr va = pkt->getAddr();
953  ASI asi = (ASI)pkt->req->getArchFlags();
954  uint64_t temp;
955 
956  DPRINTF(IPR, "Memory Mapped IPR Read: asi=%#X a=%#x\n",
957  (uint32_t)pkt->req->getArchFlags(), pkt->getAddr());
958 
959  TLB *itb = static_cast<TLB *>(tc->getMMUPtr()->itb);
960 
961  switch (asi) {
962  case ASI_LSU_CONTROL_REG:
963  assert(va == 0);
965  break;
966  case ASI_MMU:
967  switch (va) {
968  case 0x8:
970  break;
971  case 0x10:
973  break;
974  default:
975  goto doMmuReadError;
976  }
977  break;
978  case ASI_QUEUE:
980  (va >> 4) - 0x3c));
981  break;
983  assert(va == 0);
984  pkt->setBE(c0_tsb_ps0);
985  break;
987  assert(va == 0);
988  pkt->setBE(c0_tsb_ps1);
989  break;
991  assert(va == 0);
992  pkt->setBE(c0_config);
993  break;
995  assert(va == 0);
996  pkt->setBE(itb->c0_tsb_ps0);
997  break;
999  assert(va == 0);
1000  pkt->setBE(itb->c0_tsb_ps1);
1001  break;
1003  assert(va == 0);
1004  pkt->setBE(itb->c0_config);
1005  break;
1007  assert(va == 0);
1008  pkt->setBE(cx_tsb_ps0);
1009  break;
1011  assert(va == 0);
1012  pkt->setBE(cx_tsb_ps1);
1013  break;
1015  assert(va == 0);
1016  pkt->setBE(cx_config);
1017  break;
1019  assert(va == 0);
1020  pkt->setBE(itb->cx_tsb_ps0);
1021  break;
1023  assert(va == 0);
1024  pkt->setBE(itb->cx_tsb_ps1);
1025  break;
1027  assert(va == 0);
1028  pkt->setBE(itb->cx_config);
1029  break;
1031  pkt->setBE((uint64_t)0);
1032  break;
1033  case ASI_HYP_SCRATCHPAD:
1034  case ASI_SCRATCHPAD:
1035  pkt->setBE(tc->readMiscReg(MISCREG_SCRATCHPAD_R0 + (va >> 3)));
1036  break;
1037  case ASI_IMMU:
1038  switch (va) {
1039  case 0x0:
1040  temp = itb->tag_access;
1041  pkt->setBE(bits(temp,63,22) | bits(temp,12,0) << 48);
1042  break;
1043  case 0x18:
1044  pkt->setBE(itb->sfsr);
1045  break;
1046  case 0x30:
1047  pkt->setBE(itb->tag_access);
1048  break;
1049  default:
1050  goto doMmuReadError;
1051  }
1052  break;
1053  case ASI_DMMU:
1054  switch (va) {
1055  case 0x0:
1056  temp = tag_access;
1057  pkt->setBE(bits(temp,63,22) | bits(temp,12,0) << 48);
1058  break;
1059  case 0x18:
1060  pkt->setBE(sfsr);
1061  break;
1062  case 0x20:
1063  pkt->setBE(sfar);
1064  break;
1065  case 0x30:
1066  pkt->setBE(tag_access);
1067  break;
1068  case 0x80:
1070  break;
1071  default:
1072  goto doMmuReadError;
1073  }
1074  break;
1076  pkt->setBE(MakeTsbPtr(Ps0,
1077  tag_access,
1078  c0_tsb_ps0,
1079  c0_config,
1080  cx_tsb_ps0,
1081  cx_config));
1082  break;
1084  pkt->setBE(MakeTsbPtr(Ps1,
1085  tag_access,
1086  c0_tsb_ps1,
1087  c0_config,
1088  cx_tsb_ps1,
1089  cx_config));
1090  break;
1092  pkt->setBE(MakeTsbPtr(Ps0,
1093  itb->tag_access,
1094  itb->c0_tsb_ps0,
1095  itb->c0_config,
1096  itb->cx_tsb_ps0,
1097  itb->cx_config));
1098  break;
1100  pkt->setBE(MakeTsbPtr(Ps1,
1101  itb->tag_access,
1102  itb->c0_tsb_ps1,
1103  itb->c0_config,
1104  itb->cx_tsb_ps1,
1105  itb->cx_config));
1106  break;
1107  case ASI_SWVR_INTR_RECEIVE:
1108  {
1109  SparcISA::Interrupts * interrupts =
1110  dynamic_cast<SparcISA::Interrupts *>(
1111  tc->getCpuPtr()->getInterruptController(0));
1112  pkt->setBE(interrupts->get_vec(IT_INT_VEC));
1113  }
1114  break;
1115  case ASI_SWVR_UDB_INTR_R:
1116  {
1117  SparcISA::Interrupts * interrupts =
1118  dynamic_cast<SparcISA::Interrupts *>(
1119  tc->getCpuPtr()->getInterruptController(0));
1120  temp = findMsbSet(interrupts->get_vec(IT_INT_VEC));
1121  tc->getCpuPtr()->clearInterrupt(0, IT_INT_VEC, temp);
1122  pkt->setBE(temp);
1123  }
1124  break;
1125  default:
1126 doMmuReadError:
1127  panic("need to impl DTB::doMmuRegRead() got asi=%#x, va=%#x\n",
1128  (uint32_t)asi, va);
1129  }
1130  pkt->makeAtomicResponse();
1131  return Cycles(1);
1132 }
1133 
1134 Cycles
1136 {
1137  uint64_t data = pkt->getBE<uint64_t>();
1138  Addr va = pkt->getAddr();
1139  ASI asi = (ASI)pkt->req->getArchFlags();
1140 
1141  Addr ta_insert;
1142  Addr va_insert;
1143  Addr ct_insert;
1144  int part_insert;
1145  int entry_insert = -1;
1146  bool real_insert;
1147  bool ignore;
1148  int part_id;
1149  int ctx_id;
1150  PageTableEntry pte;
1151 
1152  DPRINTF(IPR, "Memory Mapped IPR Write: asi=%#X a=%#x d=%#X\n",
1153  (uint32_t)asi, va, data);
1154 
1155  TLB *itb = static_cast<TLB *>(tc->getMMUPtr()->itb);
1156 
1157  switch (asi) {
1158  case ASI_LSU_CONTROL_REG:
1159  assert(va == 0);
1161  break;
1162  case ASI_MMU:
1163  switch (va) {
1164  case 0x8:
1166  break;
1167  case 0x10:
1169  break;
1170  default:
1171  goto doMmuWriteError;
1172  }
1173  break;
1174  case ASI_QUEUE:
1175  assert(mbits(data,13,6) == data);
1177  (va >> 4) - 0x3c, data);
1178  break;
1180  assert(va == 0);
1181  c0_tsb_ps0 = data;
1182  break;
1184  assert(va == 0);
1185  c0_tsb_ps1 = data;
1186  break;
1188  assert(va == 0);
1189  c0_config = data;
1190  break;
1192  assert(va == 0);
1193  itb->c0_tsb_ps0 = data;
1194  break;
1196  assert(va == 0);
1197  itb->c0_tsb_ps1 = data;
1198  break;
1200  assert(va == 0);
1201  itb->c0_config = data;
1202  break;
1204  assert(va == 0);
1205  cx_tsb_ps0 = data;
1206  break;
1208  assert(va == 0);
1209  cx_tsb_ps1 = data;
1210  break;
1212  assert(va == 0);
1213  cx_config = data;
1214  break;
1216  assert(va == 0);
1217  itb->cx_tsb_ps0 = data;
1218  break;
1220  assert(va == 0);
1221  itb->cx_tsb_ps1 = data;
1222  break;
1224  assert(va == 0);
1225  itb->cx_config = data;
1226  break;
1229  inform("Ignoring write to SPARC ERROR regsiter\n");
1230  break;
1231  case ASI_HYP_SCRATCHPAD:
1232  case ASI_SCRATCHPAD:
1233  tc->setMiscReg(MISCREG_SCRATCHPAD_R0 + (va >> 3), data);
1234  break;
1235  case ASI_IMMU:
1236  switch (va) {
1237  case 0x18:
1238  itb->sfsr = data;
1239  break;
1240  case 0x30:
1241  sext<59>(bits(data, 59,0));
1242  itb->tag_access = data;
1243  break;
1244  default:
1245  goto doMmuWriteError;
1246  }
1247  break;
1249  entry_insert = bits(va, 8,3);
1251  case ASI_ITLB_DATA_IN_REG:
1252  assert(entry_insert != -1 || mbits(va,10,9) == va);
1253  ta_insert = itb->tag_access;
1254  va_insert = mbits(ta_insert, 63,13);
1255  ct_insert = mbits(ta_insert, 12,0);
1256  part_insert = tc->readMiscReg(MISCREG_MMU_PART_ID);
1257  real_insert = bits(va, 9,9);
1258  pte.populate(data, bits(va,10,10) ? PageTableEntry::sun4v :
1260  itb->insert(va_insert, part_insert, ct_insert, real_insert,
1261  pte, entry_insert);
1262  break;
1264  entry_insert = bits(va, 8,3);
1266  case ASI_DTLB_DATA_IN_REG:
1267  assert(entry_insert != -1 || mbits(va,10,9) == va);
1268  ta_insert = tag_access;
1269  va_insert = mbits(ta_insert, 63,13);
1270  ct_insert = mbits(ta_insert, 12,0);
1271  part_insert = tc->readMiscReg(MISCREG_MMU_PART_ID);
1272  real_insert = bits(va, 9,9);
1273  pte.populate(data, bits(va,10,10) ? PageTableEntry::sun4v :
1275  insert(va_insert, part_insert, ct_insert, real_insert, pte,
1276  entry_insert);
1277  break;
1278  case ASI_IMMU_DEMAP:
1279  ignore = false;
1280  ctx_id = -1;
1281  part_id = tc->readMiscReg(MISCREG_MMU_PART_ID);
1282  switch (bits(va,5,4)) {
1283  case 0:
1284  ctx_id = tc->readMiscReg(MISCREG_MMU_P_CONTEXT);
1285  break;
1286  case 1:
1287  ignore = true;
1288  break;
1289  case 3:
1290  ctx_id = 0;
1291  break;
1292  default:
1293  ignore = true;
1294  }
1295 
1296  switch (bits(va,7,6)) {
1297  case 0: // demap page
1298  if (!ignore)
1299  itb->demapPage(mbits(va,63,13), part_id, bits(va,9,9), ctx_id);
1300  break;
1301  case 1: // demap context
1302  if (!ignore)
1303  itb->demapContext(part_id, ctx_id);
1304  break;
1305  case 2:
1306  itb->demapAll(part_id);
1307  break;
1308  default:
1309  panic("Invalid type for IMMU demap\n");
1310  }
1311  break;
1312  case ASI_DMMU:
1313  switch (va) {
1314  case 0x18:
1315  sfsr = data;
1316  break;
1317  case 0x30:
1318  sext<59>(bits(data, 59,0));
1319  tag_access = data;
1320  break;
1321  case 0x80:
1323  break;
1324  default:
1325  goto doMmuWriteError;
1326  }
1327  break;
1328  case ASI_DMMU_DEMAP:
1329  ignore = false;
1330  ctx_id = -1;
1331  part_id = tc->readMiscReg(MISCREG_MMU_PART_ID);
1332  switch (bits(va,5,4)) {
1333  case 0:
1334  ctx_id = tc->readMiscReg(MISCREG_MMU_P_CONTEXT);
1335  break;
1336  case 1:
1337  ctx_id = tc->readMiscReg(MISCREG_MMU_S_CONTEXT);
1338  break;
1339  case 3:
1340  ctx_id = 0;
1341  break;
1342  default:
1343  ignore = true;
1344  }
1345 
1346  switch (bits(va,7,6)) {
1347  case 0: // demap page
1348  if (!ignore)
1349  demapPage(mbits(va,63,13), part_id, bits(va,9,9), ctx_id);
1350  break;
1351  case 1: // demap context
1352  if (!ignore)
1353  demapContext(part_id, ctx_id);
1354  break;
1355  case 2:
1356  demapAll(part_id);
1357  break;
1358  default:
1359  panic("Invalid type for IMMU demap\n");
1360  }
1361  break;
1362  case ASI_SWVR_INTR_RECEIVE:
1363  {
1364  int msb;
1365  // clear all the interrupts that aren't set in the write
1366  SparcISA::Interrupts * interrupts =
1367  dynamic_cast<SparcISA::Interrupts *>(
1368  tc->getCpuPtr()->getInterruptController(0));
1369  while (interrupts->get_vec(IT_INT_VEC) & data) {
1370  msb = findMsbSet(interrupts->get_vec(IT_INT_VEC) & data);
1371  tc->getCpuPtr()->clearInterrupt(0, IT_INT_VEC, msb);
1372  }
1373  }
1374  break;
1375  case ASI_SWVR_UDB_INTR_W:
1376  tc->getSystemPtr()->threads[bits(data,12,8)]->
1377  getCpuPtr()->postInterrupt(0, bits(data, 5, 0), 0);
1378  break;
1379  default:
1380 doMmuWriteError:
1381  panic("need to impl DTB::doMmuRegWrite() got asi=%#x, va=%#x d=%#x\n",
1382  (uint32_t)pkt->req->getArchFlags(), pkt->getAddr(), data);
1383  }
1384  pkt->makeAtomicResponse();
1385  return Cycles(1);
1386 }
1387 
1388 void
1390 {
1391  uint64_t tag_access = mbits(addr,63,13) | mbits(ctx,12,0);
1392  TLB *itb = static_cast<TLB *>(tc->getMMUPtr()->itb);
1393  ptrs[0] = MakeTsbPtr(Ps0, tag_access,
1394  c0_tsb_ps0,
1395  c0_config,
1396  cx_tsb_ps0,
1397  cx_config);
1398  ptrs[1] = MakeTsbPtr(Ps1, tag_access,
1399  c0_tsb_ps1,
1400  c0_config,
1401  cx_tsb_ps1,
1402  cx_config);
1403  ptrs[2] = MakeTsbPtr(Ps0, tag_access,
1404  itb->c0_tsb_ps0,
1405  itb->c0_config,
1406  itb->cx_tsb_ps0,
1407  itb->cx_config);
1408  ptrs[3] = MakeTsbPtr(Ps1, tag_access,
1409  itb->c0_tsb_ps1,
1410  itb->c0_config,
1411  itb->cx_tsb_ps1,
1412  itb->cx_config);
1413 }
1414 
1415 uint64_t
1416 TLB::MakeTsbPtr(TsbPageSize ps, uint64_t tag_access, uint64_t c0_tsb,
1417  uint64_t c0_config, uint64_t cX_tsb, uint64_t cX_config)
1418 {
1419  uint64_t tsb;
1420  uint64_t config;
1421 
1422  if (bits(tag_access, 12,0) == 0) {
1423  tsb = c0_tsb;
1424  config = c0_config;
1425  } else {
1426  tsb = cX_tsb;
1427  config = cX_config;
1428  }
1429 
1430  uint64_t ptr = mbits(tsb,63,13);
1431  bool split = bits(tsb,12,12);
1432  int tsb_size = bits(tsb,3,0);
1433  int page_size = (ps == Ps0) ? bits(config, 2,0) : bits(config,10,8);
1434 
1435  if (ps == Ps1 && split)
1436  ptr |= ULL(1) << (13 + tsb_size);
1437  ptr |= (tag_access >> (9 + page_size * 3)) & mask(12+tsb_size, 4);
1438 
1439  return ptr;
1440 }
1441 
1442 void
1444 {
1448 
1449  // convert the pointer based free list into an index based one
1450  std::vector<int> free_list;
1451  for (const TlbEntry *entry : freeList)
1452  free_list.push_back(entry - tlb);
1453 
1454  SERIALIZE_CONTAINER(free_list);
1455 
1465 
1466  for (int x = 0; x < size; x++) {
1467  ScopedCheckpointSection sec(cp, csprintf("PTE%d", x));
1468  tlb[x].serialize(cp);
1469  }
1470 }
1471 
1472 void
1474 {
1475  int oldSize;
1476 
1477  paramIn(cp, "size", oldSize);
1478  if (oldSize != size)
1479  panic("Don't support unserializing different sized TLBs\n");
1482 
1483  std::vector<int> free_list;
1484  UNSERIALIZE_CONTAINER(free_list);
1485  freeList.clear();
1486  for (int idx : free_list)
1487  freeList.push_back(&tlb[idx]);
1488 
1497 
1498  lookupTable.clear();
1499  for (int x = 0; x < size; x++) {
1500  ScopedCheckpointSection sec(cp, csprintf("PTE%d", x));
1501  tlb[x].unserialize(cp);
1502  if (tlb[x].valid)
1503  lookupTable.insert(tlb[x].range, &tlb[x]);
1504 
1505  }
1507 }
1508 
1509 } // namespace SparcISA
SparcISA::MachInst
uint32_t MachInst
Definition: types.hh:38
SparcISA::TLB
Definition: tlb.hh:50
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
SparcISA::asiIsMmu
bool asiIsMmu(ASI asi)
Definition: asi.cc:267
ThreadContext::readMiscRegNoEffect
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
SparcISA::TLB::TteRead
uint64_t TteRead(int entry)
Give an entry id, read that tlb entries' tte.
Definition: tlb.cc:338
SparcISA::TLB::c0_tsb_ps1
uint64_t c0_tsb_ps1
Definition: tlb.hh:59
BaseTLB::Translation::finish
virtual void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, Mode mode)=0
SparcISA::ASI_DMMU_CTXT_ZERO_TSB_BASE_PS1
@ ASI_DMMU_CTXT_ZERO_TSB_BASE_PS1
Definition: asi.hh:101
SparcISA::ASI_IMMU_CTXT_NONZERO_TSB_BASE_PS1
@ ASI_IMMU_CTXT_NONZERO_TSB_BASE_PS1
Definition: asi.hh:113
Packet::makeAtomicResponse
void makeAtomicResponse()
Definition: packet.hh:1017
SparcISA::TLB::cx_tsb_ps0
uint64_t cx_tsb_ps0
Definition: tlb.hh:61
SparcISA::PageTableEntry::sun4v
@ sun4v
Definition: pagetable.hh:69
Packet::getBE
T getBE() const
Get the data in the packet byte swapped from big endian to host endian.
Definition: packet_access.hh:68
SparcISA::TlbRange::contextId
int contextId
Definition: pagetable.hh:180
SparcISA::TLB::demapContext
void demapContext(int partition_id, int context_id)
Remove all entries that match a given context/partition id.
Definition: tlb.cc:282
SparcISA::TLB::demapPage
void demapPage(Addr va, int partition_id, bool real, int context_id)
Remve all entries that match a certain partition id, (contextid), and va).
Definition: tlb.cc:250
SparcISA::TlbEntry::valid
bool valid
Definition: pagetable.hh:259
SparcISA::ASI_QUEUE
@ ASI_QUEUE
Definition: asi.hh:76
SparcISA::TLB::freeList
std::list< TlbEntry * > freeList
Definition: tlb.hh:80
SparcISA::asiIsCmt
bool asiIsCmt(ASI asi)
Definition: asi.cc:246
SparcISA::ASI_N
@ ASI_N
Definition: asi.hh:40
SparcISA::ASI_SPARC_ERROR_EN_REG
@ ASI_SPARC_ERROR_EN_REG
Definition: asi.hh:129
SparcISA::ASI_IMPLICIT
@ ASI_IMPLICIT
Definition: asi.hh:36
system.hh
SparcISA::EndVAddrHole
const Addr EndVAddrHole
Definition: tlb.hh:46
SparcISA::ASI_DTLB_DATA_IN_REG
@ ASI_DTLB_DATA_IN_REG
Definition: asi.hh:146
SparcISA::ASI_ITLB_DATA_ACCESS_REG
@ ASI_ITLB_DATA_ACCESS_REG
Definition: asi.hh:139
SparcISA::TLB::cacheState
uint64_t cacheState
Definition: tlb.hh:77
SparcISA::ASI_ITLB_DATA_IN_REG
@ ASI_ITLB_DATA_IN_REG
Definition: asi.hh:138
data
const char data[]
Definition: circlebuf.test.cc:47
UNSERIALIZE_SCALAR
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:591
SparcISA::TLB::c0_tsb_ps0
uint64_t c0_tsb_ps0
Definition: tlb.hh:58
Packet::getAddr
Addr getAddr() const
Definition: packet.hh:755
SparcISA::ASI_IMMU_DEMAP
@ ASI_IMMU_DEMAP
Definition: asi.hh:141
SparcISA::TLB::FaultTypes
FaultTypes
Definition: tlb.hh:82
SparcISA::asiIsUnPriv
bool asiIsUnPriv(ASI asi)
Definition: asi.cc:282
SparcISA::TlbMap::begin
iterator begin()
Definition: tlb_map.hh:127
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
UNSERIALIZE_CONTAINER
#define UNSERIALIZE_CONTAINER(member)
Definition: serialize.hh:650
SparcISA::TLB::GetTsbPtr
void GetTsbPtr(ThreadContext *tc, Addr addr, int ctx, Addr *ptrs)
Definition: tlb.cc:1389
SparcISA::ASI_DMMU_CTXT_NONZERO_TSB_BASE_PS0
@ ASI_DMMU_CTXT_NONZERO_TSB_BASE_PS0
Definition: asi.hh:108
SparcISA::TLB::translateAtomic
Fault translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode) override
Definition: tlb.cc:830
SparcISA::TLB::Primary
@ Primary
Definition: tlb.hh:94
SparcISA::asiIsLittle
bool asiIsLittle(ASI asi)
Definition: asi.cc:150
SparcISA::TlbMap::insert
iterator insert(TlbRange &r, TlbEntry *d)
Definition: tlb_map.hh:94
ThreadContext::getMMUPtr
virtual BaseMMU * getMMUPtr()=0
SparcISA::TLB::OtherFault
@ OtherFault
Definition: tlb.hh:83
SparcISA::TLB::Secondary
@ Secondary
Definition: tlb.hh:95
SparcISA::TLB::translateFunctional
Fault translateFunctional(const RequestPtr &req, ThreadContext *tc, Mode mode) override
Definition: tlb.cc:839
SparcISA::TteTag
Definition: pagetable.hh:42
BaseTLB::Mode
Mode
Definition: tlb.hh:57
SparcISA::PageTableEntry::translate
Addr translate(Addr vaddr) const
Definition: pagetable.hh:168
SparcISA::asiIsPartialStore
bool asiIsPartialStore(ASI asi)
Definition: asi.cc:200
SparcISA::MISCREG_TLB_DATA
@ MISCREG_TLB_DATA
Definition: miscregs.hh:112
SparcISA::TlbEntry
Definition: pagetable.hh:221
Process::pTable
EmulationPageTable * pTable
Definition: process.hh:169
SparcISA::TLB::usedEntries
int usedEntries
Definition: tlb.hh:74
SparcISA::TLB::Nucleus
@ Nucleus
Definition: tlb.hh:96
SparcISA::TteTag::va
Addr va() const
Definition: pagetable.hh:61
SparcISA::TLB::translateData
Fault translateData(const RequestPtr &req, ThreadContext *tc, bool write)
Definition: tlb.cc:527
SparcISA::TLB::lookup
TlbEntry * lookup(Addr va, int partition_id, bool real, int context_id=0, bool update_used=true)
lookup an entry in the TLB based on the partition id, and real bit if real is true or the partition i...
Definition: tlb.cc:192
RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:86
SparcISA::asiIsReal
bool asiIsReal(ASI asi)
Definition: asi.cc:139
SparcISA::TLB::IllegalAsi
@ IllegalAsi
Definition: tlb.hh:87
Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:341
SparcISA::asiIsHPriv
bool asiIsHPriv(ASI asi)
Definition: asi.cc:295
SparcISA::TLB::doMmuRegWrite
Cycles doMmuRegWrite(ThreadContext *tc, Packet *pkt)
Definition: tlb.cc:1135
std::vector< int >
SparcISA::TLB::cx_config
uint64_t cx_config
Definition: tlb.hh:63
ThreadContext::getPhysProxy
virtual PortProxy & getPhysProxy()=0
FullSystem
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Definition: root.cc:204
SparcISA::TLB::writeSfsr
void writeSfsr(bool write, ContextType ct, bool se, FaultTypes ft, int asi)
Definition: tlb.cc:377
ThreadContext::getProcessPtr
virtual Process * getProcessPtr()=0
MipsISA::ce
Bitfield< 29, 28 > ce
Definition: pra_constants.hh:177
SparcISA::TLB::sfar
uint64_t sfar
Definition: tlb.hh:57
SparcISA::PageTableEntry::valid
bool valid() const
Definition: pagetable.hh:144
SparcISA::TLB::MakeTsbPtr
uint64_t MakeTsbPtr(TsbPageSize ps, uint64_t tag_access, uint64_t c0_tsb, uint64_t c0_config, uint64_t cX_tsb, uint64_t cX_config)
Definition: tlb.cc:1416
SparcISA::TLB::LoadFromNfo
@ LoadFromNfo
Definition: tlb.hh:88
SparcISA::TLB::cacheEntry
TlbEntry * cacheEntry[2]
Definition: tlb.hh:196
SparcISA::asiIsNucleus
bool asiIsNucleus(ASI asi)
Definition: asi.cc:106
SparcISA::TLB::Ps1
@ Ps1
Definition: tlb.hh:101
SparcISA::TlbRange::size
Addr size
Definition: pagetable.hh:179
SparcISA::VAddrAMask
const Addr VAddrAMask
Definition: tlb.hh:47
SparcISA::TlbMap::end
iterator end()
Definition: tlb_map.hh:133
request.hh
BaseTLB
Definition: tlb.hh:50
SparcISA::TLB::tag_access
uint64_t tag_access
Definition: tlb.hh:65
SparcISA::TlbMap::clear
void clear()
Definition: tlb_map.hh:121
SparcISA::IT_INT_VEC
@ IT_INT_VEC
Definition: interrupts.hh:48
Packet::setBE
void setBE(T v)
Set the value in the data pointer to v as big endian.
Definition: packet_access.hh:98
SparcISA::asiIsTwin
bool asiIsTwin(ASI asi)
Definition: asi.cc:185
SparcISA::TlbEntry::serialize
void serialize(CheckpointOut &cp) const
Definition: pagetable.cc:37
SparcISA::TLB::doMmuRegRead
Cycles doMmuRegRead(ThreadContext *tc, Packet *pkt)
Definition: tlb.cc:950
SparcISA::TlbMap::size
size_t size()
Definition: tlb_map.hh:139
SparcISA
Definition: asi.cc:31
SparcISA::TlbMap::erase
size_t erase(TlbRange k)
Definition: tlb_map.hh:103
SparcISA::TLB::MapIter
TlbMap::iterator MapIter
Definition: tlb.hh:68
SparcISA::TLB::PrivViolation
@ PrivViolation
Definition: tlb.hh:84
SparcISA::TLB::lastReplaced
int lastReplaced
Definition: tlb.hh:75
SparcISA::asiIsBlock
bool asiIsBlock(ASI asi)
Definition: asi.cc:35
SparcISA::priv
Bitfield< 2 > priv
Definition: miscregs.hh:126
SparcISA::asiIsSecondary
bool asiIsSecondary(ASI asi)
Definition: asi.cc:77
SparcISA::PageTableEntry::sun4u
@ sun4u
Definition: pagetable.hh:70
cp
Definition: cprintf.cc:37
SparcISA::TLB::cacheValid
bool cacheValid
Definition: tlb.hh:78
SparcISA::ASI_SCRATCHPAD
@ ASI_SCRATCHPAD
Definition: asi.hh:69
ArmISA::a
Bitfield< 8 > a
Definition: miscregs_types.hh:62
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
bitfield.hh
faults.hh
SparcISA::TLB::flushAll
void flushAll() override
Remove all entries from the TLB.
Definition: tlb.cc:323
SparcISA::TLB::clearUsedBits
void clearUsedBits()
Definition: tlb.cc:84
SparcISA::TLB::insert
void insert(Addr vpn, int partition_id, int context_id, bool real, const PageTableEntry &PTE, int entry=-1)
Insert a PTE into the TLB.
Definition: tlb.cc:98
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:237
SparcISA::TLB::lookupTable
TlbMap lookupTable
Definition: tlb.hh:68
SparcISA::ASI_DMMU_CTXT_NONZERO_CONFIG
@ ASI_DMMU_CTXT_NONZERO_CONFIG
Definition: asi.hh:110
SparcISA::ASI_P
@ ASI_P
Definition: asi.hh:162
SparcISA::am
Bitfield< 3 > am
Definition: miscregs.hh:127
asi.hh
SparcISA::ASI_DTLB_DATA_ACCESS_REG
@ ASI_DTLB_DATA_ACCESS_REG
Definition: asi.hh:147
SparcISA::ASI_DMMU
@ ASI_DMMU
Definition: asi.hh:142
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:246
MipsISA::vaddr
vaddr
Definition: pra_constants.hh:275
SparcISA::asiIsInterrupt
bool asiIsInterrupt(ASI asi)
Definition: asi.cc:259
SparcISA::TLB::SideEffect
@ SideEffect
Definition: tlb.hh:85
SparcISA::TLB::cx_tsb_ps1
uint64_t cx_tsb_ps1
Definition: tlb.hh:62
process.hh
Request::STRICT_ORDER
@ STRICT_ORDER
The request is required to be strictly ordered by CPU models and is non-speculative.
Definition: request.hh:128
SparcISA::TLB::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: tlb.cc:1443
SparcISA::ASI_DMMU_TSB_PS0_PTR_REG
@ ASI_DMMU_TSB_PS0_PTR_REG
Definition: asi.hh:143
ArmISA::mode
Bitfield< 4, 0 > mode
Definition: miscregs_types.hh:70
SparcISA::ASI_IMMU_CTXT_ZERO_TSB_BASE_PS0
@ ASI_IMMU_CTXT_ZERO_TSB_BASE_PS0
Definition: asi.hh:104
BaseCPU::clearInterrupt
void clearInterrupt(ThreadID tid, int int_num, int index)
Definition: base.hh:251
MipsISA::tl
Bitfield< 23, 20 > tl
Definition: pra_constants.hh:251
SparcISA::MISCREG_QUEUE_CPU_MONDO_HEAD
@ MISCREG_QUEUE_CPU_MONDO_HEAD
Definition: miscregs.hh:102
SparcISA::TLB::Params
SparcTLBParams Params
Definition: tlb.hh:154
SparcISA::asiIsQueue
bool asiIsQueue(ASI asi)
Definition: asi.cc:253
BaseTLB::Translation
Definition: tlb.hh:59
M5_FALLTHROUGH
#define M5_FALLTHROUGH
Definition: compiler.hh:59
SparcISA::TLB::demapAll
void demapAll(int partition_id)
Remove all non-locked entries from the tlb that match partition id.
Definition: tlb.cc:304
compiler.hh
mbits
constexpr T mbits(T val, unsigned first, unsigned last)
Mask off the given bits in place like bits() but without shifting.
Definition: bitfield.hh:100
SparcISA::TLB::dumpAll
void dumpAll()
Definition: tlb.cc:236
SparcISA::PAddrImplMask
const Addr PAddrImplMask
Definition: tlb.hh:48
RiscvISA::x
Bitfield< 3 > x
Definition: pagetable.hh:70
SparcISA::TlbEntry::used
bool used
Definition: pagetable.hh:258
SparcISA::MISCREG_MMU_LSU_CTRL
@ MISCREG_MMU_LSU_CTRL
Definition: miscregs.hh:89
mmu.hh
NoFault
constexpr decltype(nullptr) NoFault
Definition: types.hh:251
SparcISA::TlbEntry::unserialize
void unserialize(CheckpointIn &cp)
Definition: pagetable.cc:54
SparcISA::PageTableEntry::populate
void populate(uint64_t e, EntryType t=sun4u)
Definition: pagetable.hh:91
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:148
betoh
T betoh(T value)
Definition: byteswap.hh:144
SparcISA::ASI_IMMU_CTXT_NONZERO_TSB_BASE_PS0
@ ASI_IMMU_CTXT_NONZERO_TSB_BASE_PS0
Definition: asi.hh:112
SparcISA::asiIsPrimary
bool asiIsPrimary(ASI asi)
Definition: asi.cc:48
Serializable::ScopedCheckpointSection
Definition: serialize.hh:178
SparcISA::MISCREG_MMU_PART_ID
@ MISCREG_MMU_PART_ID
Definition: miscregs.hh:88
SERIALIZE_SCALAR
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:584
SparcISA::TLB::cacheAsi
ASI cacheAsi[2]
Definition: tlb.hh:197
SparcISA::asiIsNoFault
bool asiIsNoFault(ASI asi)
Definition: asi.cc:230
SparcISA::ASI
ASI
Definition: asi.hh:35
SparcISA::TLB::TsbPageSize
TsbPageSize
Definition: tlb.hh:99
SparcISA::ASI_DMMU_DEMAP
@ ASI_DMMU_DEMAP
Definition: asi.hh:149
packet_access.hh
full_system.hh
SparcISA::TLB::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: tlb.cc:1473
ArmISA::e
Bitfield< 9 > e
Definition: miscregs_types.hh:61
SparcISA::TlbRange::partitionId
int partitionId
Definition: pagetable.hh:181
SparcISA::MISCREG_SCRATCHPAD_R0
@ MISCREG_SCRATCHPAD_R0
Scratchpad regiscers.
Definition: miscregs.hh:92
SparcISA::TLB::Ps0
@ Ps0
Definition: tlb.hh:100
X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:80
BaseTLB::Write
@ Write
Definition: tlb.hh:57
SparcISA::TLB::size
int size
Definition: tlb.hh:73
SparcISA::TlbRange
Definition: pagetable.hh:176
findMsbSet
constexpr int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
Definition: bitfield.hh:240
SparcISA::TLB::ContextType
ContextType
Definition: tlb.hh:93
System::threads
Threads threads
Definition: system.hh:304
SparcISA::TLB::translateTiming
void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode) override
Definition: tlb.cc:935
SparcISA::ASI_IMMU_CTXT_ZERO_CONFIG
@ ASI_IMMU_CTXT_ZERO_CONFIG
Definition: asi.hh:106
SparcISA::TLB::translateInst
Fault translateInst(const RequestPtr &req, ThreadContext *tc)
Definition: tlb.cc:413
SparcISA::ASI_S
@ ASI_S
Definition: asi.hh:164
inform
#define inform(...)
Definition: logging.hh:240
SparcISA::Interrupts::get_vec
uint64_t get_vec(int int_num)
Definition: interrupts.hh:235
PortProxy
This object is a proxy for a port or other object which implements the functional response protocol,...
Definition: port_proxy.hh:80
base.hh
SparcISA::red
Bitfield< 5 > red
Definition: miscregs.hh:119
ArmISA::t
Bitfield< 5 > t
Definition: miscregs_types.hh:67
SparcISA::ASI_SWVR_UDB_INTR_R
@ ASI_SWVR_UDB_INTR_R
Definition: asi.hh:159
SparcISA::ASI_DMMU_CTXT_NONZERO_TSB_BASE_PS1
@ ASI_DMMU_CTXT_NONZERO_TSB_BASE_PS1
Definition: asi.hh:109
SERIALIZE_CONTAINER
#define SERIALIZE_CONTAINER(member)
Definition: serialize.hh:642
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:258
SparcISA::TLB::sfsr
uint64_t sfsr
Definition: tlb.hh:64
Request::UNCACHEABLE
@ UNCACHEABLE
The request is to an uncacheable address.
Definition: request.hh:118
ThreadContext::readMiscReg
virtual RegVal readMiscReg(RegIndex misc_reg)=0
SparcISA::ASI_IMMU_CTXT_NONZERO_CONFIG
@ ASI_IMMU_CTXT_NONZERO_CONFIG
Definition: asi.hh:114
ThreadContext::setMiscReg
virtual void setMiscReg(RegIndex misc_reg, RegVal val)=0
interrupts.hh
SparcISA::hpriv
Bitfield< 2 > hpriv
Definition: miscregs.hh:118
SparcISA::TLB::tlb
TlbEntry * tlb
Definition: tlb.hh:71
SparcISA::ASI_SWVR_UDB_INTR_W
@ ASI_SWVR_UDB_INTR_W
Definition: asi.hh:158
SparcISA::TLB::writeTagAccess
void writeTagAccess(Addr va, int context)
Definition: tlb.cc:394
SparcISA::TLB::validVirtualAddress
bool validVirtualAddress(Addr va, bool am)
Checks if the virtual address provided is a valid one.
Definition: tlb.cc:367
Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:79
BaseMMU::itb
BaseTLB * itb
Definition: mmu.hh:110
SparcISA::ASI_DMMU_CTXT_ZERO_CONFIG
@ ASI_DMMU_CTXT_ZERO_CONFIG
Definition: asi.hh:102
MipsISA::tbe
Bitfield< 17 > tbe
Definition: mt_constants.hh:77
SparcISA::StartVAddrHole
const Addr StartVAddrHole
Definition: tlb.hh:45
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:64
SparcISA::asiIsScratchPad
bool asiIsScratchPad(ASI asi)
Definition: asi.cc:239
bits
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:73
SparcISA::TLB::finalizePhysical
Fault finalizePhysical(const RequestPtr &req, ThreadContext *tc, Mode mode) const override
Do post-translation physical address finalization.
Definition: tlb.cc:943
ignore
static void ignore(const char *expr)
Definition: debug.cc:71
mem
bool_vector8 mem[]
Definition: reset_stim.h:43
SparcISA::TlbRange::va
Addr va
Definition: pagetable.hh:178
registers.hh
SparcISA::ASI_IMMU_TSB_PS1_PTR_REG
@ ASI_IMMU_TSB_PS1_PTR_REG
Definition: asi.hh:136
trace.hh
SparcISA::ASI_IMMU_TSB_PS0_PTR_REG
@ ASI_IMMU_TSB_PS0_PTR_REG
Definition: asi.hh:135
SparcISA::TLB::VaOutOfRange
@ VaOutOfRange
Definition: tlb.hh:89
DPRINTFN
#define DPRINTFN(...)
Definition: trace.hh:241
SparcISA::PageTableEntry
Definition: pagetable.hh:65
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
SparcISA::TlbEntry::pte
PageTableEntry pte
Definition: pagetable.hh:257
SparcISA::MISCREG_MMU_P_CONTEXT
@ MISCREG_MMU_P_CONTEXT
MMU Internal Registers.
Definition: miscregs.hh:86
SparcISA::ASI_DMMU_TSB_PS1_PTR_REG
@ ASI_DMMU_TSB_PS1_PTR_REG
Definition: asi.hh:144
ArmISA::ps
Bitfield< 18, 16 > ps
Definition: miscregs_types.hh:508
page_table.hh
paramIn
void paramIn(CheckpointIn &cp, const std::string &name, ExtMachInst &machInst)
Definition: types.cc:69
CheckpointIn
Definition: serialize.hh:68
SparcISA::ASI_MMU
@ ASI_MMU
Definition: asi.hh:70
SparcISA::PageTableEntry::paddr
Addr paddr() const
Definition: pagetable.hh:157
BaseTLB::Execute
@ Execute
Definition: tlb.hh:57
SparcISA::ASI_SWVR_INTR_RECEIVE
@ ASI_SWVR_INTR_RECEIVE
Definition: asi.hh:157
SparcISA::ASI_SPARC_ERROR_STATUS_REG
@ ASI_SPARC_ERROR_STATUS_REG
Definition: asi.hh:130
SparcISA::asiIsSparcError
bool asiIsSparcError(ASI asi)
Definition: asi.cc:309
ThreadContext::getCpuPtr
virtual BaseCPU * getCpuPtr()=0
SparcISA::TLB::TLB
TLB(const Params &p)
Definition: tlb.cc:56
SparcISA::TlbRange::real
bool real
Definition: pagetable.hh:182
EmulationPageTable::translate
bool translate(Addr vaddr, Addr &paddr)
Translate function.
Definition: page_table.cc:140
SparcISA::ASI_LSU_CONTROL_REG
@ ASI_LSU_CONTROL_REG
Definition: asi.hh:123
BaseCPU::getInterruptController
BaseInterrupts * getInterruptController(ThreadID tid)
Definition: base.hh:236
SparcISA::TteTag::valid
bool valid() const
Definition: pagetable.hh:60
SparcISA::ASI_IMMU_CTXT_ZERO_TSB_BASE_PS1
@ ASI_IMMU_CTXT_ZERO_TSB_BASE_PS1
Definition: asi.hh:105
csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:158
SparcISA::TLB::TagRead
uint64_t TagRead(int entry)
Given an entry id, read that tlb entries' tag.
Definition: tlb.cc:351
thread_context.hh
tlb.hh
SparcISA::MISCREG_MMU_S_CONTEXT
@ MISCREG_MMU_S_CONTEXT
Definition: miscregs.hh:87
SparcISA::TlbEntry::range
TlbRange range
Definition: pagetable.hh:256
ULL
#define ULL(N)
uint64_t constant
Definition: types.hh:46
SparcISA::TLB::c0_config
uint64_t c0_config
Definition: tlb.hh:60
ArmISA::va
Bitfield< 8 > va
Definition: miscregs_types.hh:272
ArmISA::mask
Bitfield< 28, 24 > mask
Definition: miscregs_types.hh:711
ThreadContext::getSystemPtr
virtual System * getSystemPtr()=0
SparcISA::ASI_HYP_SCRATCHPAD
@ ASI_HYP_SCRATCHPAD
Definition: asi.hh:133
SparcISA::TlbMap::find
iterator find(const TlbRange &r)
Definition: tlb_map.hh:49
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
SparcISA::Interrupts
Definition: interrupts.hh:56
SparcISA::ASI_IMMU
@ ASI_IMMU
Definition: asi.hh:134
SparcISA::asiIsAsIfUser
bool asiIsAsIfUser(ASI asi)
Definition: asi.cc:115
SparcISA::PageTableEntry::size
Addr size() const
Definition: pagetable.hh:153
SparcISA::ASI_DMMU_CTXT_ZERO_TSB_BASE_PS0
@ ASI_DMMU_CTXT_ZERO_TSB_BASE_PS0
Definition: asi.hh:100

Generated on Tue Mar 23 2021 19:41:19 for gem5 by doxygen 1.8.17