gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cortex_a76.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_CORETEX_A76_HH__
29 #define __ARCH_ARM_FASTMODEL_CORTEXA76_CORETEX_A76_HH__
30 
34 #include "params/FastModelCortexA76.hh"
35 #include "params/FastModelCortexA76Cluster.hh"
36 #include "scx/scx.h"
37 #include "sim/port.hh"
39 
40 namespace gem5
41 {
42 
43 class BaseCPU;
44 
45 namespace fastmodel
46 {
47 
48 // The fast model exports a class called scx_evs_CortexA76x1 which represents
49 // the subsystem described in LISA+. This class specializes it to export gem5
50 // ports and interface with its peer gem5 CPU. The gem5 CPU inherits from the
51 // gem5 BaseCPU class and implements its API, while this class actually does
52 // the work.
53 class CortexA76Cluster;
54 
55 class CortexA76 : public Iris::CPU<CortexA76TC>
56 {
57  protected:
59 
61  int num = 0;
62 
63  public:
64  PARAMS(FastModelCortexA76);
65  CortexA76(const Params &p) :
66  Base(p, scx::scx_get_iris_connection_interface())
67  {}
68 
69  void initState() override;
70 
71  template <class T>
72  void set_evs_param(const std::string &n, T val);
73 
74  void setCluster(CortexA76Cluster *_cluster, int _num);
75 
76  void setResetAddr(Addr addr, bool secure = false) override;
77 
78  Port &getPort(const std::string &if_name,
79  PortID idx=InvalidPortID) override;
80 };
81 
83 {
84  private:
87 
88  public:
89  PARAMS(FastModelCortexA76Cluster);
90  template <class T>
91  void
92  set_evs_param(const std::string &n, T val)
93  {
94  scx::scx_set_parameter(evs->name() + std::string(".") + n, val);
95  }
96 
97  CortexA76 *getCore(int num) const { return cores.at(num); }
98  sc_core::sc_module *getEvs() const { return evs; }
99 
100  CortexA76Cluster(const Params &p);
101 
102  Port &getPort(const std::string &if_name,
103  PortID idx=InvalidPortID) override;
104 };
105 
106 template <class T>
107 inline void
108 CortexA76::set_evs_param(const std::string &n, T val)
109 {
110  for (auto &path: params().thread_paths)
111  cluster->set_evs_param(path + "." + n, val);
112 }
113 
114 } // namespace fastmodel
115 } // namespace gem5
116 
117 #endif // __ARCH_ARM_FASTMODEL_CORTEXA76_CORETEX_A76_HH__
gem5::fastmodel::CortexA76::Base
Iris::CPU< CortexA76TC > Base
Definition: cortex_a76.hh:58
gem5::PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:245
gem5::fastmodel::CortexA76Cluster::cores
std::vector< CortexA76 * > cores
Definition: cortex_a76.hh:85
sc_core::sc_module
Definition: sc_module.hh:101
gem5::Serializable::path
static std::stack< std::string > path
Definition: serialize.hh:315
gem5::fastmodel::CortexA76Cluster::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: cortex_a76.cc:200
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:776
gem5::fastmodel::CortexA76Cluster::getCore
CortexA76 * getCore(int num) const
Definition: cortex_a76.hh:97
thread_context.hh
std::vector
STL vector class.
Definition: stl.hh:37
gem5::InvalidPortID
const PortID InvalidPortID
Definition: types.hh:246
gem5::fastmodel::CortexA76::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition: cortex_a76.cc:43
cpu.hh
gem5::fastmodel::CortexA76Cluster::evs
sc_core::sc_module * evs
Definition: cortex_a76.hh:86
gem5::fastmodel::CortexA76::PARAMS
PARAMS(FastModelCortexA76)
gem5::SimObject::Params
SimObjectParams Params
Definition: sim_object.hh:170
gem5::fastmodel::CortexA76::num
int num
Definition: cortex_a76.hh:61
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::fastmodel::CortexA76::setCluster
void setCluster(CortexA76Cluster *_cluster, int _num)
Definition: cortex_a76.cc:52
gem5::SimObject::params
const Params & params() const
Definition: sim_object.hh:176
gem5::fastmodel::CortexA76::CortexA76
CortexA76(const Params &p)
Definition: cortex_a76.hh:65
gem5::fastmodel::CortexA76Cluster::getEvs
sc_core::sc_module * getEvs() const
Definition: cortex_a76.hh:98
gem5::fastmodel::CortexA76::cluster
CortexA76Cluster * cluster
Definition: cortex_a76.hh:60
gem5::fastmodel::CortexA76::setResetAddr
void setResetAddr(Addr addr, bool secure=false) override
Definition: cortex_a76.cc:98
gem5::fastmodel::CortexA76Cluster::PARAMS
PARAMS(FastModelCortexA76Cluster)
gem5::SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:146
gem5::fastmodel::CortexA76Cluster::CortexA76Cluster
CortexA76Cluster(const Params &p)
Definition: cortex_a76.cc:113
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
port.hh
sc_module.hh
amba_ports.hh
gem5::fastmodel::CortexA76::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: cortex_a76.cc:104
gem5::Port
Ports are used to interface objects to each other.
Definition: port.hh:61
gem5::ArmISA::n
Bitfield< 31 > n
Definition: misc_types.hh:513
gem5::fastmodel::CortexA76
Definition: cortex_a76.hh:55
sc_core::sc_object::name
const char * name() const
Definition: sc_object.cc:44
gem5::fastmodel::CortexA76::set_evs_param
void set_evs_param(const std::string &n, T val)
Definition: cortex_a76.hh:108
gem5::Iris::CPU
Definition: cpu.hh:117
gem5::fastmodel::CortexA76Cluster
Definition: cortex_a76.hh:82
gem5::ClockedObject::Params
ClockedObjectParams Params
Parameters of ClockedObject.
Definition: clocked_object.hh:240
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84
gem5::fastmodel::CortexA76Cluster::set_evs_param
void set_evs_param(const std::string &n, T val)
Definition: cortex_a76.hh:92

Generated on Sun Jul 30 2023 01:56:47 for gem5 by doxygen 1.8.17