gem5 v24.0.0.0
Loading...
Searching...
No Matches
thread_context.hh
Go to the documentation of this file.
1/*
2 * Copyright 2020 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_CORTEXR52_THREAD_CONTEXT_HH__
29#define __ARCH_ARM_FASTMODEL_CORTEXR52_THREAD_CONTEXT_HH__
30
32
33namespace gem5
34{
35
36namespace fastmodel
37{
38
39// This ThreadContext class translates accesses to state using gem5's native
40// to the Iris API. This includes extracting and translating register indices.
42{
43 protected:
48
49 public:
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 void sendFunctional(PacketPtr pkt) override;
59
60 // Since this CPU doesn't support aarch64, we override these two methods
61 // and always assume we're 32 bit. More than likely we could be more
62 // general than that, but that would require letting the default
63 // implementation read the CPSR, and that's not currently implemented.
64 RegVal readIntReg(RegIndex reg_idx) const override;
65 void setIntReg(RegIndex reg_idx, RegVal val) override;
66
67 RegVal readCCRegFlat(RegIndex idx) const override;
68 void setCCRegFlat(RegIndex idx, RegVal val) override;
69
70 const std::vector<iris::MemorySpaceId> &getBpSpaceIds() const override;
71
72 // The map from gem5 indexes to IRIS resource names is not currently set
73 // up. It will be a little more complicated for R52, since it won't have
74 // many of the registers since it doesn't support aarch64. We may need to
75 // just return dummy values on reads and throw away writes, throw an
76 // error, or some combination of the two.
77 RegVal
78 readMiscRegNoEffect(RegIndex idx) const override
79 {
81 "No mapping for index %#x.", idx);
83 }
84
85 void
87 {
89 "No mapping for index %#x.", idx);
91 }
92
93 // Like the Misc regs, not currently supported and a little complicated.
94 RegVal
95 readIntRegFlat(RegIndex idx) const override
96 {
97 panic("%s not implemented.", __FUNCTION__);
98 }
99
100 void
102 {
103 panic("%s not implemented.", __FUNCTION__);
104 }
105
106 // Not supported by the CPU. There isn't anything to set up here as far
107 // as mapping, but the question still remains what to do about registers
108 // that don't exist in the CPU.
110 readVecReg(const RegId &) const override
111 {
112 panic("%s not implemented.", __FUNCTION__);
113 }
114};
115
116} // namespace fastmodel
117} // namespace gem5
118
119#endif // __ARCH_ARM_FASTMODEL_CORTEXR52_THREAD_CONTEXT_HH__
std::map< std::string, iris::ResourceInfo > ResourceMap
std::map< int, std::string > IdxNameMap
RegVal readMiscRegNoEffect(RegIndex misc_reg) const override
void setMiscRegNoEffect(RegIndex misc_reg, const RegVal val) override
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
Register ID: describe an architectural register with its class and index.
Definition reg_class.hh:94
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
Definition vec_reg.hh:126
const ArmISA::VecRegContainer & readVecReg(const RegId &) const override
RegVal readMiscRegNoEffect(RegIndex idx) const override
void setIntRegFlat(RegIndex idx, RegVal val) override
RegVal readIntReg(RegIndex reg_idx) const override
bool translateAddress(Addr &paddr, Addr vaddr) override
RegVal readCCRegFlat(RegIndex idx) const override
static IdxNameMap ccRegIdxNameMap
void sendFunctional(PacketPtr pkt) override
const std::vector< iris::MemorySpaceId > & getBpSpaceIds() const override
CortexR52TC(gem5::BaseCPU *cpu, int id, System *system, gem5::BaseMMU *mmu, gem5::BaseISA *isa, iris::IrisConnectionInterface *iris_if, const std::string &iris_path)
void setCCRegFlat(RegIndex idx, RegVal val) override
void setIntReg(RegIndex reg_idx, RegVal val) override
void initFromIrisInstance(const ResourceMap &resources) override
RegVal readIntRegFlat(RegIndex idx) const override
void setMiscRegNoEffect(RegIndex idx, const RegVal val) override
static IdxNameMap miscRegIdxNameMap
static IdxNameMap intReg32IdxNameMap
static std::vector< iris::MemorySpaceId > bpSpaceIds
STL vector class.
Definition stl.hh:37
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition logging.hh:214
Bitfield< 15 > system
Definition misc.hh:1032
Bitfield< 63 > val
Definition misc.hh:804
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint16_t RegIndex
Definition types.hh:176
uint64_t RegVal
Definition types.hh:173
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147

Generated on Tue Jun 18 2024 16:24:01 for gem5 by doxygen 1.11.0