table_walker.cc (7733:08d6a773d1b6) table_walker.cc (7748:7bf78d12b359)
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 "dev/io_device.hh"
44#include "cpu/base.hh"
45#include "cpu/thread_context.hh"
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 "dev/io_device.hh"
44#include "cpu/base.hh"
45#include "cpu/thread_context.hh"
46#include "sim/system.hh"
46
47using namespace ArmISA;
48
49TableWalker::TableWalker(const Params *p)
50 : MemObject(p), port(NULL), tlb(NULL), currState(NULL), pending(false),
51 doL1DescEvent(this), doL2DescEvent(this), doProcessEvent(this)
52{
53 sctlr = 0;
54}
55
56TableWalker::~TableWalker()
57{
58 ;
59}
60
61
47
48using namespace ArmISA;
49
50TableWalker::TableWalker(const Params *p)
51 : MemObject(p), port(NULL), tlb(NULL), currState(NULL), pending(false),
52 doL1DescEvent(this), doL2DescEvent(this), doProcessEvent(this)
53{
54 sctlr = 0;
55}
56
57TableWalker::~TableWalker()
58{
59 ;
60}
61
62
62unsigned int TableWalker::drain(Event *de)
63unsigned int
64TableWalker::drain(Event *de)
63{
65{
64 if (stateQueueL1.size() != 0 || stateQueueL2.size() != 0)
66 if (stateQueueL1.size() || stateQueueL2.size() || pendingQueue.size())
65 {
66 changeState(Draining);
67 DPRINTF(Checkpoint, "TableWalker busy, wait to drain\n");
68 return 1;
69 }
70 else
71 {
72 changeState(Drained);
73 DPRINTF(Checkpoint, "TableWalker free, no need to drain\n");
74 return 0;
75 }
76}
77
67 {
68 changeState(Draining);
69 DPRINTF(Checkpoint, "TableWalker busy, wait to drain\n");
70 return 1;
71 }
72 else
73 {
74 changeState(Drained);
75 DPRINTF(Checkpoint, "TableWalker free, no need to drain\n");
76 return 0;
77 }
78}
79
80void
81TableWalker::resume()
82{
83 MemObject::resume();
84 if ((params()->sys->getMemoryMode() == Enums::timing) && currState) {
85 delete currState;
86 currState = NULL;
87 }
88}
89
78Port*
79TableWalker::getPort(const std::string &if_name, int idx)
80{
81 if (if_name == "port") {
82 if (port != NULL)
83 fatal("%s: port already connected to %s",
84 name(), port->getPeer()->name());
85 System *sys = params()->sys;

--- 630 unchanged lines hidden ---
90Port*
91TableWalker::getPort(const std::string &if_name, int idx)
92{
93 if (if_name == "port") {
94 if (port != NULL)
95 fatal("%s: port already connected to %s",
96 name(), port->getPeer()->name());
97 System *sys = params()->sys;

--- 630 unchanged lines hidden ---