gem5 v24.0.0.0
Loading...
Searching...
No Matches
cortex_r52.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_CORETEX_R52_HH__
29#define __ARCH_ARM_FASTMODEL_CORTEXR52_CORETEX_R52_HH__
30
34#include "params/FastModelCortexR52.hh"
35#include "params/FastModelCortexR52Cluster.hh"
36#include "scx/scx.h"
37#include "sim/port.hh"
39
40namespace gem5
41{
42
43class BaseCPU;
44
45namespace fastmodel
46{
47
48// The fast model exports a class called scx_evs_CortexR52x1 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.
53class CortexR52Cluster;
54
55class CortexR52 : public Iris::CPU<CortexR52TC>
56{
57 protected:
59
61 int num = 0;
62
63 public:
64 PARAMS(FastModelCortexR52);
65 CortexR52(const Params &p) :
66 Base(p, scx::scx_get_iris_connection_interface())
67 {}
68
69 template <class T>
70 void set_evs_param(const std::string &n, T val);
71
72 void setCluster(CortexR52Cluster *_cluster, int _num);
73
74 void setResetAddr(Addr addr, bool secure = false) override;
75
76 Port &getPort(const std::string &if_name,
77 PortID idx=InvalidPortID) override;
78};
79
81{
82 private:
85
86 public:
87 template <class T>
88 void
89 set_evs_param(const std::string &n, T val)
90 {
91 scx::scx_set_parameter(evs->name() + std::string(".") + n, val);
92 }
93
94 CortexR52 *getCore(int num) const { return cores.at(num); }
95 sc_core::sc_module *getEvs() const { return evs; }
96
97 PARAMS(FastModelCortexR52Cluster);
99
100 Port &getPort(const std::string &if_name,
101 PortID idx=InvalidPortID) override;
102};
103
104template <class T>
105inline void
106CortexR52::set_evs_param(const std::string &n, T val)
107{
108 for (auto &path: params().thread_paths)
109 cluster->set_evs_param(path + "." + n, val);
110}
111
112} // namespace fastmodel
113} // namespace gem5
114
115#endif // __ARCH_ARM_FASTMODEL_CORTEXR52_CORETEX_R52_HH__
ClockedObjectParams Params
Parameters of ClockedObject.
Ports are used to interface objects to each other.
Definition port.hh:62
static std::stack< std::string > path
Definition serialize.hh:315
Abstract superclass for simulation objects.
SimObjectParams Params
sc_core::sc_module * getEvs() const
Definition cortex_r52.hh:95
CortexR52 * getCore(int num) const
Definition cortex_r52.hh:94
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
std::vector< CortexR52 * > cores
Definition cortex_r52.hh:83
void set_evs_param(const std::string &n, T val)
Definition cortex_r52.hh:89
PARAMS(FastModelCortexR52Cluster)
void set_evs_param(const std::string &n, T val)
Iris::CPU< CortexR52TC > Base
Definition cortex_r52.hh:58
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port on this CPU.
Definition cortex_r52.cc:88
CortexR52(const Params &p)
Definition cortex_r52.hh:65
void setResetAddr(Addr addr, bool secure=false) override
Definition cortex_r52.cc:82
PARAMS(FastModelCortexR52)
void setCluster(CortexR52Cluster *_cluster, int _num)
Definition cortex_r52.cc:42
CortexR52Cluster * cluster
Definition cortex_r52.hh:60
const char * name() const
Definition sc_object.cc:44
STL vector class.
Definition stl.hh:37
const Params & params() const
Bitfield< 31 > n
Bitfield< 0 > p
Bitfield< 63 > val
Definition misc.hh:804
Bitfield< 3 > addr
Definition types.hh:84
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
const PortID InvalidPortID
Definition types.hh:246
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition types.hh:245
Port Object Declaration.

Generated on Tue Jun 18 2024 16:23:55 for gem5 by doxygen 1.11.0