gem5  v19.0.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  * Authors: Gabe Black
28  */
29 
30 #ifndef __ARCH_ARM_FASTMODEL_CORTEXA76_THREAD_CONTEXT_HH__
31 #define __ARCH_ARM_FASTMODEL_CORTEXA76_THREAD_CONTEXT_HH__
32 
34 
35 namespace FastModel
36 {
37 
38 // This ThreadContext class translates accesses to state using gem5's native
39 // to the Iris API. This includes extracting and translating register indices.
41 {
42  protected:
49  static iris::MemorySpaceId bpSpaceId;
50 
51  public:
52  CortexA76TC(::BaseCPU *cpu, int id, System *system,
53  ::BaseTLB *dtb, ::BaseTLB *itb,
54  iris::IrisConnectionInterface *iris_if,
55  const std::string &iris_path);
56 
57  bool translateAddress(Addr &paddr, Addr vaddr) override;
58 
59  void initFromIrisInstance(const ResourceMap &resources) override;
60 
61  RegVal readIntRegFlat(RegIndex idx) const override;
62  void setIntRegFlat(RegIndex idx, RegVal val) override;
63 
64  RegVal readCCRegFlat(RegIndex idx) const override;
65  void setCCRegFlat(RegIndex idx, RegVal val) override;
66 
67  iris::MemorySpaceId getBpSpaceId(Addr pc) const override;
68 };
69 
70 } // namespace FastModel
71 
72 #endif // __ARCH_ARM_FASTMODEL_CORTEXA76_THREAD_CONTEXT_HH__
void setCCRegFlat(RegIndex idx, RegVal val) override
static IdxNameMap vecRegIdxNameMap
uint64_t RegVal
Definition: types.hh:168
Definition: system.hh:77
std::map< std::string, iris::ResourceInfo > ResourceMap
static IdxNameMap intReg64IdxNameMap
static iris::MemorySpaceId bpSpaceId
Bitfield< 63 > val
Definition: misc.hh:771
void initFromIrisInstance(const ResourceMap &resources) override
Definition: tlb.hh:52
RegVal readCCRegFlat(RegIndex idx) const override
Bitfield< 4 > pc
uint16_t RegIndex
Definition: types.hh:42
iris::MemorySpaceId getBpSpaceId(Addr pc) const override
static IdxNameMap ccRegIdxNameMap
bool translateAddress(Addr &paddr, Addr vaddr) override
static IdxNameMap intReg32IdxNameMap
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
CortexA76TC(::BaseCPU *cpu, int id, System *system, ::BaseTLB *dtb, ::BaseTLB *itb, iris::IrisConnectionInterface *iris_if, const std::string &iris_path)
Bitfield< 15 > system
Definition: misc.hh:999
static IdxNameMap miscRegIdxNameMap
std::map< int, std::string > IdxNameMap
void setIntRegFlat(RegIndex idx, RegVal val) override
RegVal readIntRegFlat(RegIndex idx) const override
Flat register interfaces.
static IdxNameMap flattenedIntIdxNameMap

Generated on Fri Feb 28 2020 16:26:56 for gem5 by doxygen 1.8.13