gem5  v20.1.0.0
thread_context.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Google, Inc.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met: redistributions of source code must retain the above copyright
7  * notice, this list of conditions and the following disclaimer;
8  * redistributions in binary form must reproduce the above copyright
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef __ARCH_ARM_FASTMODEL_CORTEXA76_THREAD_CONTEXT_HH__
29 #define __ARCH_ARM_FASTMODEL_CORTEXA76_THREAD_CONTEXT_HH__
30 
32 
33 namespace FastModel
34 {
35 
36 // This ThreadContext class translates accesses to state using gem5's native
37 // to the Iris API. This includes extracting and translating register indices.
39 {
40  protected:
48 
49  public:
50  CortexA76TC(::BaseCPU *cpu, int id, System *system,
51  ::BaseTLB *dtb, ::BaseTLB *itb, ::BaseISA *isa,
52  iris::IrisConnectionInterface *iris_if,
53  const std::string &iris_path);
54 
55  bool translateAddress(Addr &paddr, Addr vaddr) override;
56 
57  void initFromIrisInstance(const ResourceMap &resources) override;
58 
59  RegVal readIntRegFlat(RegIndex idx) const override;
60  void setIntRegFlat(RegIndex idx, RegVal val) override;
61 
62  RegVal readCCRegFlat(RegIndex idx) const override;
63  void setCCRegFlat(RegIndex idx, RegVal val) override;
64 
65  const std::vector<iris::MemorySpaceId> &getBpSpaceIds() const override;
66 };
67 
68 } // namespace FastModel
69 
70 #endif // __ARCH_ARM_FASTMODEL_CORTEXA76_THREAD_CONTEXT_HH__
FastModel::CortexA76TC::translateAddress
bool translateAddress(Addr &paddr, Addr vaddr) override
Definition: thread_context.cc:46
FastModel::CortexA76TC
Definition: thread_context.hh:38
std::vector< iris::MemorySpaceId >
FastModel::CortexA76TC::vecRegIdxNameMap
static IdxNameMap vecRegIdxNameMap
Definition: thread_context.hh:46
BaseTLB
Definition: tlb.hh:50
FastModel::CortexA76TC::ccRegIdxNameMap
static IdxNameMap ccRegIdxNameMap
Definition: thread_context.hh:45
X86ISA::system
Bitfield< 15 > system
Definition: misc.hh:997
FastModel::CortexA76TC::miscRegIdxNameMap
static IdxNameMap miscRegIdxNameMap
Definition: thread_context.hh:41
System
Definition: system.hh:73
MipsISA::vaddr
vaddr
Definition: pra_constants.hh:275
FastModel::CortexA76TC::CortexA76TC
CortexA76TC(::BaseCPU *cpu, int id, System *system, ::BaseTLB *dtb, ::BaseTLB *itb, ::BaseISA *isa, iris::IrisConnectionInterface *iris_if, const std::string &iris_path)
Definition: thread_context.cc:38
FastModel::CortexA76TC::getBpSpaceIds
const std::vector< iris::MemorySpaceId > & getBpSpaceIds() const override
Definition: thread_context.cc:184
FastModel::CortexA76TC::readIntRegFlat
RegVal readIntRegFlat(RegIndex idx) const override
Flat register interfaces.
Definition: thread_context.cc:102
FastModel::CortexA76TC::readCCRegFlat
RegVal readCCRegFlat(RegIndex idx) const override
Definition: thread_context.cc:144
Iris::ThreadContext::IdxNameMap
std::map< int, std::string > IdxNameMap
Definition: thread_context.hh:53
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
BaseCPU
Definition: cpu_dummy.hh:43
FastModel
Definition: amba_from_tlm_bridge.cc:32
RegIndex
uint16_t RegIndex
Definition: types.hh:52
FastModel::CortexA76TC::intReg32IdxNameMap
static IdxNameMap intReg32IdxNameMap
Definition: thread_context.hh:42
FastModel::CortexA76TC::intReg64IdxNameMap
static IdxNameMap intReg64IdxNameMap
Definition: thread_context.hh:43
FastModel::CortexA76TC::bpSpaceIds
static std::vector< iris::MemorySpaceId > bpSpaceIds
Definition: thread_context.hh:47
thread_context.hh
FastModel::CortexA76TC::setIntRegFlat
void setIntRegFlat(RegIndex idx, RegVal val) override
Definition: thread_context.cc:125
Iris::ThreadContext::ResourceMap
std::map< std::string, iris::ResourceInfo > ResourceMap
Definition: thread_context.hh:50
FastModel::CortexA76TC::setCCRegFlat
void setCCRegFlat(RegIndex idx, RegVal val) override
Definition: thread_context.cc:161
BaseISA
Definition: isa.hh:47
FastModel::CortexA76TC::initFromIrisInstance
void initFromIrisInstance(const ResourceMap &resources) override
Definition: thread_context.cc:83
Iris::ThreadContext
Definition: thread_context.hh:47
RegVal
uint64_t RegVal
Definition: types.hh:168
FastModel::CortexA76TC::flattenedIntIdxNameMap
static IdxNameMap flattenedIntIdxNameMap
Definition: thread_context.hh:44

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