gem5  v20.1.0.0
stage2_mmu.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2013, 2015 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
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef __ARCH_ARM_STAGE2_MMU_HH__
39 #define __ARCH_ARM_STAGE2_MMU_HH__
40 
41 #include "arch/arm/faults.hh"
42 #include "arch/arm/tlb.hh"
43 #include "dev/dma_device.hh"
44 #include "mem/request.hh"
45 #include "params/ArmStage2MMU.hh"
46 #include "sim/eventq.hh"
47 
48 namespace ArmISA {
49 
50 class Stage2MMU : public SimObject
51 {
52  private:
56 
57  protected:
58 
61 
64 
65  public:
69  {
70  private:
71  uint8_t *data;
72  int numBytes;
77 
78  public:
80 
81  Stage2Translation(Stage2MMU &_parent, uint8_t *_data, Event *_event,
82  Addr _oVAddr);
83 
84  void
86 
87  void
88  finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc,
90 
91  void setVirt(Addr vaddr, int size, Request::Flags flags,
92  int requestorId)
93  {
94  numBytes = size;
95  req->setVirt(vaddr, size, flags, requestorId, 0);
96  }
97 
99  {
101  }
102  };
103 
104  typedef ArmStage2MMUParams Params;
105  Stage2MMU(const Params *p);
106 
112  DmaPort& getDMAPort() { return port; }
113 
114  Fault readDataUntimed(ThreadContext *tc, Addr oVAddr, Addr descAddr,
115  uint8_t *data, int numBytes, Request::Flags flags, bool isFunctional);
116  void readDataTimed(ThreadContext *tc, Addr descAddr,
117  Stage2Translation *translation, int numBytes,
118  Request::Flags flags);
119 
120  TLB* stage1Tlb() const { return _stage1Tlb; }
121  TLB* stage2Tlb() const { return _stage2Tlb; }
122 };
123 
124 
125 
126 } // namespace ArmISA
127 
128 #endif //__ARCH_ARM_STAGE2_MMU_HH__
129 
ArmISA::Stage2MMU::_stage2Tlb
TLB * _stage2Tlb
The TLB that will cache the stage 2 look ups.
Definition: stage2_mmu.hh:55
ArmISA::Stage2MMU::stage2Tlb
TLB * stage2Tlb() const
Definition: stage2_mmu.hh:121
ArmISA::Stage2MMU::Stage2Translation::numBytes
int numBytes
Definition: stage2_mmu.hh:72
BaseTLB::Read
@ Read
Definition: tlb.hh:57
data
const char data[]
Definition: circlebuf.test.cc:42
ArmISA::Stage2MMU::Stage2Translation::oVAddr
Addr oVAddr
Definition: stage2_mmu.hh:76
ArmISA::Stage2MMU::Stage2Translation::req
RequestPtr req
Definition: stage2_mmu.hh:73
Flags< FlagsType >
ArmISA::Stage2MMU::Params
ArmStage2MMUParams Params
Definition: stage2_mmu.hh:104
BaseTLB::Mode
Mode
Definition: tlb.hh:57
RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:82
ArmISA::Stage2MMU::Stage2Translation::fault
Fault fault
Definition: stage2_mmu.hh:79
tlb.hh
ArmISA::Stage2MMU::Stage2MMU
Stage2MMU(const Params *p)
Definition: stage2_mmu.cc:49
ArmISA::Stage2MMU::Stage2Translation
This translation class is used to trigger the data fetch once a timing translation returns the transl...
Definition: stage2_mmu.hh:68
ArmISA::Stage2MMU
Definition: stage2_mmu.hh:50
ArmISA
Definition: ccregs.hh:41
request.hh
ArmISA::Stage2MMU::port
DmaPort port
Port to issue translation requests from.
Definition: stage2_mmu.hh:60
ArmISA::Stage2MMU::Stage2Translation::Stage2Translation
Stage2Translation(Stage2MMU &_parent, uint8_t *_data, Event *_event, Addr _oVAddr)
Definition: stage2_mmu.cc:110
RequestorID
uint16_t RequestorID
Definition: request.hh:85
ArmISA::Stage2MMU::Stage2Translation::setVirt
void setVirt(Addr vaddr, int size, Request::Flags flags, int requestorId)
Definition: stage2_mmu.hh:91
ArmISA::Stage2MMU::stage1Tlb
TLB * stage1Tlb() const
Definition: stage2_mmu.hh:120
ArmISA::Stage2MMU::Stage2Translation::finish
void finish(const Fault &fault, const RequestPtr &req, ThreadContext *tc, BaseTLB::Mode mode)
Definition: stage2_mmu.cc:119
dma_device.hh
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
ArmISA::Stage2MMU::getDMAPort
DmaPort & getDMAPort()
Get the port that ultimately belongs to the stage-two MMU, but is used by the two table walkers,...
Definition: stage2_mmu.hh:112
Event
Definition: eventq.hh:246
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
ArmISA::Stage2MMU::Stage2Translation::markDelayed
void markDelayed()
Signal that the translation has been delayed due to a hw page table walk.
Definition: stage2_mmu.hh:85
MipsISA::vaddr
vaddr
Definition: pra_constants.hh:275
ArmISA::mode
Bitfield< 4, 0 > mode
Definition: miscregs_types.hh:70
BaseTLB::Translation
Definition: tlb.hh:59
faults.hh
ArmISA::Stage2MMU::requestorId
RequestorID requestorId
Request id for requests generated by this MMU.
Definition: stage2_mmu.hh:63
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
ArmISA::TLB
Definition: tlb.hh:100
ArmISA::Stage2MMU::Stage2Translation::data
uint8_t * data
Definition: stage2_mmu.hh:71
ArmISA::Stage2MMU::Stage2Translation::translateTiming
void translateTiming(ThreadContext *tc)
Definition: stage2_mmu.hh:98
ArmISA::Stage2MMU::readDataTimed
void readDataTimed(ThreadContext *tc, Addr descAddr, Stage2Translation *translation, int numBytes, Request::Flags flags)
Definition: stage2_mmu.cc:100
ArmISA::Stage2MMU::readDataUntimed
Fault readDataUntimed(ThreadContext *tc, Addr oVAddr, Addr descAddr, uint8_t *data, int numBytes, Request::Flags flags, bool isFunctional)
Definition: stage2_mmu.cc:62
ArmISA::Stage2MMU::Stage2Translation::parent
Stage2MMU & parent
Definition: stage2_mmu.hh:75
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
ArmISA::Stage2MMU::Stage2Translation::event
Event * event
Definition: stage2_mmu.hh:74
ArmISA::Stage2MMU::_stage1Tlb
TLB * _stage1Tlb
Definition: stage2_mmu.hh:53
DmaPort
Definition: dma_device.hh:55
ArmISA::TLB::translateTiming
void translateTiming(const RequestPtr &req, ThreadContext *tc, Translation *translation, Mode mode, ArmTranslationType tranType)
Definition: tlb.cc:1205
eventq.hh
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:92

Generated on Wed Sep 30 2020 14:02:01 for gem5 by doxygen 1.8.17