Deleted Added
sdiff udiff text old ( 9015:7f4d25789dc4 ) new ( 9152:86c0e6ca5e7c )
full compact
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

38 */
39
40#include "arch/arm/faults.hh"
41#include "arch/arm/table_walker.hh"
42#include "arch/arm/tlb.hh"
43#include "cpu/base.hh"
44#include "cpu/thread_context.hh"
45#include "debug/Checkpoint.hh"
46#include "debug/TLB.hh"
47#include "debug/TLBVerbose.hh"
48#include "sim/system.hh"
49
50using namespace ArmISA;
51
52TableWalker::TableWalker(const Params *p)
53 : MemObject(p), port(this, params()->sys, params()->min_backoff,
54 params()->max_backoff),
55 tlb(NULL), currState(NULL), pending(false),
56 masterId(p->sys->getMasterId(name())),
57 doL1DescEvent(this), doL2DescEvent(this), doProcessEvent(this)
58{
59 sctlr = 0;
60}
61
62TableWalker::~TableWalker()
63{
64 ;
65}
66
67unsigned int
68TableWalker::drain(Event *de)
69{
70 if (stateQueueL1.size() || stateQueueL2.size() || pendingQueue.size())
71 {
72 changeState(Draining);
73 DPRINTF(Checkpoint, "TableWalker busy, wait to drain\n");
74 return 1;
75 }
76 else
77 {
78 changeState(Drained);
79 DPRINTF(Checkpoint, "TableWalker free, no need to drain\n");
80 return 0;
81 }
82}
83
84void
85TableWalker::resume()
86{
87 MemObject::resume();
88 if ((params()->sys->getMemoryMode() == Enums::timing) && currState) {
89 delete currState;
90 currState = NULL;
91 }
92}
93
94MasterPort&
95TableWalker::getMasterPort(const std::string &if_name, int idx)
96{
97 if (if_name == "port") {
98 return port;

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

662
663 DPRINTF(TLBVerbose, "L1 Desc object host addr: %p\n",&currState->l1Desc.data);
664 DPRINTF(TLBVerbose, "L1 Desc object data: %08x\n",currState->l1Desc.data);
665
666 DPRINTF(TLBVerbose, "calling doL1Descriptor for vaddr:%#x\n", currState->vaddr);
667 doL1Descriptor();
668
669 stateQueueL1.pop_front();
670 // Check if fault was generated
671 if (currState->fault != NoFault) {
672 currState->transState->finish(currState->fault, currState->req,
673 currState->tc, currState->mode);
674
675 pending = false;
676 nextWalk(currState->tc);
677

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

718 else {
719 DPRINTF(TLBVerbose, "calling translateTiming again\n");
720 currState->fault = tlb->translateTiming(currState->req, currState->tc,
721 currState->transState, currState->mode);
722 }
723
724
725 stateQueueL2.pop_front();
726 pending = false;
727 nextWalk(currState->tc);
728
729 currState->req = NULL;
730 currState->tc = NULL;
731 currState->delayed = false;
732
733 delete currState;

--- 18 unchanged lines hidden ---