gem5  v21.2.0.0
cortex_a76.cc
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 
29 
31 #include "arch/arm/regs/misc.hh"
32 #include "base/logging.hh"
33 #include "dev/arm/base_gic.hh"
35 
36 namespace gem5
37 {
38 
39 GEM5_DEPRECATED_NAMESPACE(FastModel, fastmodel);
40 namespace fastmodel
41 {
42 
43 void
45 {
46  for (auto *tc : threadContexts)
47  tc->setMiscRegNoEffect(ArmISA::MISCREG_CNTFRQ_EL0, params().cntfrq);
48 
49  evs_base_cpu->setSysCounterFrq(params().cntfrq);
50 }
51 
52 void
54 {
55  cluster = _cluster;
56  num = _num;
57 
58  set_evs_param("CFGEND", params().CFGEND);
59  set_evs_param("CFGTE", params().CFGTE);
60  set_evs_param("CRYPTODISABLE", params().CRYPTODISABLE);
61  set_evs_param("RVBARADDR", params().RVBARADDR);
62  set_evs_param("VINITHI", params().VINITHI);
63  set_evs_param("enable_trace_special_hlt_imm16",
64  params().enable_trace_special_hlt_imm16);
65  set_evs_param("l2cache-hit_latency", params().l2cache_hit_latency);
66  set_evs_param("l2cache-maintenance_latency",
67  params().l2cache_maintenance_latency);
68  set_evs_param("l2cache-miss_latency", params().l2cache_miss_latency);
69  set_evs_param("l2cache-read_access_latency",
70  params().l2cache_read_access_latency);
71  set_evs_param("l2cache-read_latency", params().l2cache_read_latency);
72  set_evs_param("l2cache-size", params().l2cache_size);
73  set_evs_param("l2cache-snoop_data_transfer_latency",
74  params().l2cache_snoop_data_transfer_latency);
75  set_evs_param("l2cache-snoop_issue_latency",
76  params().l2cache_snoop_issue_latency);
77  set_evs_param("l2cache-write_access_latency",
78  params().l2cache_write_access_latency);
79  set_evs_param("l2cache-write_latency", params().l2cache_write_latency);
80  set_evs_param("max_code_cache_mb", params().max_code_cache_mb);
81  set_evs_param("min_sync_level", params().min_sync_level);
82  set_evs_param("semihosting-A32_HLT", params().semihosting_A32_HLT);
83  set_evs_param("semihosting-A64_HLT", params().semihosting_A64_HLT);
84  set_evs_param("semihosting-ARM_SVC", params().semihosting_ARM_SVC);
85  set_evs_param("semihosting-T32_HLT", params().semihosting_T32_HLT);
86  set_evs_param("semihosting-Thumb_SVC", params().semihosting_Thumb_SVC);
87  set_evs_param("semihosting-cmd_line", params().semihosting_cmd_line);
88  set_evs_param("semihosting-cwd", params().semihosting_cwd);
89  set_evs_param("semihosting-enable", params().semihosting_enable);
90  set_evs_param("semihosting-heap_base", params().semihosting_heap_base);
91  set_evs_param("semihosting-heap_limit", params().semihosting_heap_limit);
92  set_evs_param("semihosting-stack_base", params().semihosting_stack_base);
93  set_evs_param("semihosting-stack_limit", params().semihosting_stack_limit);
94  set_evs_param("trace_special_hlt_imm16", params().trace_special_hlt_imm16);
95  set_evs_param("vfp-enable_at_reset", params().vfp_enable_at_reset);
96 }
97 
98 void
100 {
101  evs_base_cpu->setResetAddr(num, addr, secure);
102 }
103 
104 Port &
105 CortexA76::getPort(const std::string &if_name, PortID idx)
106 {
107  if (if_name == "redistributor")
108  return cluster->getEvs()->gem5_getPort(if_name, num);
109  else
110  return Base::getPort(if_name, idx);
111 }
112 
114  SimObject(p), cores(p.cores), evs(p.evs)
115 {
116  for (int i = 0; i < p.cores.size(); i++)
117  p.cores[i]->setCluster(this, i);
118 
119  Iris::BaseCpuEvs *e = dynamic_cast<Iris::BaseCpuEvs *>(evs);
120  panic_if(!e, "EVS should be of type Iris::BaseCpuEvs");
121  e->setCluster(this);
122 
123  set_evs_param("core.BROADCASTATOMIC", p.BROADCASTATOMIC);
124  set_evs_param("core.BROADCASTCACHEMAINT", p.BROADCASTCACHEMAINT);
125  set_evs_param("core.BROADCASTOUTER", p.BROADCASTOUTER);
126  set_evs_param("core.BROADCASTPERSIST", p.BROADCASTPERSIST);
127  set_evs_param("core.CLUSTER_ID", p.CLUSTER_ID);
128  set_evs_param("core.GICDISABLE", p.GICDISABLE);
129  set_evs_param("core.cpi_div", p.cpi_div);
130  set_evs_param("core.cpi_mul", p.cpi_mul);
131  set_evs_param("core.dcache-hit_latency", p.dcache_hit_latency);
132  set_evs_param("core.dcache-maintenance_latency",
133  p.dcache_maintenance_latency);
134  set_evs_param("core.dcache-miss_latency", p.dcache_miss_latency);
135  set_evs_param("core.dcache-prefetch_enabled",
136  p.dcache_prefetch_enabled);
137  set_evs_param("core.dcache-read_access_latency",
138  p.dcache_read_access_latency);
139  set_evs_param("core.dcache-read_latency", p.dcache_read_latency);
140  set_evs_param("core.dcache-snoop_data_transfer_latency",
141  p.dcache_snoop_data_transfer_latency);
142  set_evs_param("core.dcache-state_modelled", p.dcache_state_modelled);
143  set_evs_param("core.dcache-write_access_latency",
144  p.dcache_write_access_latency);
145  set_evs_param("core.dcache-write_latency", p.dcache_write_latency);
146  set_evs_param("core.default_opmode", p.default_opmode);
147  set_evs_param("core.diagnostics", p.diagnostics);
148  set_evs_param("core.enable_simulation_performance_optimizations",
149  p.enable_simulation_performance_optimizations);
150  set_evs_param("core.ext_abort_device_read_is_sync",
151  p.ext_abort_device_read_is_sync);
152  set_evs_param("core.ext_abort_device_write_is_sync",
153  p.ext_abort_device_write_is_sync);
154  set_evs_param("core.ext_abort_so_read_is_sync",
155  p.ext_abort_so_read_is_sync);
156  set_evs_param("core.ext_abort_so_write_is_sync",
157  p.ext_abort_so_write_is_sync);
158  set_evs_param("core.gicv3.cpuintf-mmap-access-level",
159  p.gicv3_cpuintf_mmap_access_level);
160  set_evs_param("core.has_peripheral_port", p.has_peripheral_port);
161  set_evs_param("core.has_statistical_profiling",
162  p.has_statistical_profiling);
163  set_evs_param("core.icache-hit_latency", p.icache_hit_latency);
164  set_evs_param("core.icache-maintenance_latency",
165  p.icache_maintenance_latency);
166  set_evs_param("core.icache-miss_latency", p.icache_miss_latency);
167  set_evs_param("core.icache-prefetch_enabled",
168  p.icache_prefetch_enabled);
169  set_evs_param("core.icache-read_access_latency",
170  p.icache_read_access_latency);
171  set_evs_param("core.icache-read_latency", p.icache_read_latency);
172  set_evs_param("core.icache-state_modelled", p.icache_state_modelled);
173  set_evs_param("core.l3cache-hit_latency", p.l3cache_hit_latency);
174  set_evs_param("core.l3cache-maintenance_latency",
175  p.l3cache_maintenance_latency);
176  set_evs_param("core.l3cache-miss_latency", p.l3cache_miss_latency);
177  set_evs_param("core.l3cache-read_access_latency",
178  p.l3cache_read_access_latency);
179  set_evs_param("core.l3cache-read_latency", p.l3cache_read_latency);
180  set_evs_param("core.l3cache-size", p.l3cache_size);
181  set_evs_param("core.l3cache-snoop_data_transfer_latency",
182  p.l3cache_snoop_data_transfer_latency);
183  set_evs_param("core.l3cache-snoop_issue_latency",
184  p.l3cache_snoop_issue_latency);
185  set_evs_param("core.l3cache-write_access_latency",
186  p.l3cache_write_access_latency);
187  set_evs_param("core.l3cache-write_latency", p.l3cache_write_latency);
188  set_evs_param("core.pchannel_treat_simreset_as_poreset",
189  p.pchannel_treat_simreset_as_poreset);
190  set_evs_param("core.periph_address_end", p.periph_address_end);
191  set_evs_param("core.periph_address_start", p.periph_address_start);
192  set_evs_param("core.ptw_latency", p.ptw_latency);
193  set_evs_param("core.tlb_latency", p.tlb_latency);
194  set_evs_param("core.treat-dcache-cmos-to-pou-as-nop",
195  p.treat_dcache_cmos_to_pou_as_nop);
196  set_evs_param("core.walk_cache_latency", p.walk_cache_latency);
197 }
198 
199 Port &
200 CortexA76Cluster::getPort(const std::string &if_name, PortID idx)
201 {
202  if (if_name == "amba") {
203  return evs->gem5_getPort(if_name, idx);
204  } else {
205  return SimObject::getPort(if_name, idx);
206  }
207 }
208 
209 } // namespace fastmodel
210 } // namespace gem5
gem5::PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:252
gem5::SimObject::getPort
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Definition: sim_object.cc:126
cortex_a76.hh
gem5::Iris::BaseCpuEvs::setResetAddr
virtual void setResetAddr(int core, Addr addr, bool secure)=0
gem5_to_tlm.hh
base_gic.hh
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::Iris::BaseCpuEvs
Definition: cpu.hh:47
gem5::ArmISA::e
Bitfield< 9 > e
Definition: misc_types.hh:65
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::fastmodel::CortexA76::initState
void initState() override
Definition: cortex_a76.cc:44
cpu.hh
gem5::fastmodel::CortexA76Cluster::evs
sc_core::sc_module * evs
Definition: cortex_a76.hh:87
gem5::Iris::BaseCPU::evs_base_cpu
Iris::BaseCpuEvs * evs_base_cpu
Definition: cpu.hh:99
gem5::Iris::BaseCpuEvs::setSysCounterFrq
virtual void setSysCounterFrq(uint64_t sys_counter_frq)=0
gem5::SimObject::Params
SimObjectParams Params
Definition: sim_object.hh:170
gem5::fastmodel::CortexA76::num
int num
Definition: cortex_a76.hh:62
gem5::fastmodel::CortexA76::setCluster
void setCluster(CortexA76Cluster *_cluster, int _num)
Definition: cortex_a76.cc:53
gem5::fastmodel::CortexA76Cluster::getEvs
sc_core::sc_module * getEvs() const
Definition: cortex_a76.hh:99
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
gem5::fastmodel::CortexA76::cluster
CortexA76Cluster * cluster
Definition: cortex_a76.hh:61
gem5::fastmodel::CortexA76::setResetAddr
void setResetAddr(Addr addr, bool secure=false) override
Definition: cortex_a76.cc:99
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
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:204
gem5::fastmodel::CortexA76::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Definition: cortex_a76.cc:105
gem5::Port
Ports are used to interface objects to each other.
Definition: port.hh:61
misc.hh
sc_core::sc_module::gem5_getPort
virtual gem5::Port & gem5_getPort(const std::string &if_name, int idx=-1)
Definition: sc_module.cc:117
gem5::fastmodel::CortexA76::set_evs_param
void set_evs_param(const std::string &n, T val)
Definition: cortex_a76.hh:109
logging.hh
gem5::fastmodel::CortexA76Cluster
Definition: cortex_a76.hh:83
gem5::ArmISA::MISCREG_CNTFRQ_EL0
@ MISCREG_CNTFRQ_EL0
Definition: misc.hh:753
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: tlb.cc:60
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:93

Generated on Tue Dec 21 2021 11:34:18 for gem5 by doxygen 1.8.17