gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
plic.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Huawei International
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 
39 #include "dev/riscv/plic.hh"
40 
41 #include <algorithm>
42 
43 #include "cpu/base.hh"
44 #include "debug/Plic.hh"
45 #include "mem/packet.hh"
46 #include "mem/packet_access.hh"
47 #include "params/Plic.hh"
48 #include "params/PlicBase.hh"
49 #include "sim/system.hh"
50 
51 namespace gem5
52 {
53 
54 using namespace RiscvISA;
55 
56 Plic::Plic(const Params &params) :
57  PlicBase(params),
58  system(params.system),
59  nSrc(params.n_src),
60  nContext(params.n_contexts),
61  registers(params.name, pioAddr, this),
62  update([this]{updateOutput();}, name() + ".update")
63 {
64 }
65 
66 void
67 Plic::post(int src_id)
68 {
69  // Sanity check
70  assert(src_id < nSrc && src_id >= 0);
71 
72  // Update pending bit
73  int src_index = src_id >> 5;
74  int src_offset = src_id & 0x1F;
75 
76  uint32_t& pending = registers.pending[src_index].get();
77  std::bitset<32> pending_bits(pending);
78  pending_bits[src_offset] = 1;
79  pending = (uint32_t) pending_bits.to_ulong();
80 
81  // Update states
82  pendingPriority[src_id] = registers.priority[src_id].get();
83  for (int i = 0; i < nContext; i++) {
84  bool enabled = bits(registers.enable[i][src_index].get(), src_offset);
85  effPriority[i][src_id] = enabled ? pendingPriority[src_id] : 0;
86  }
87  DPRINTF(Plic,
88  "Int post request - source: %#x, current priority: %#x\n",
89  src_id, pendingPriority[src_id]);
90 
91  // Propagate output changes
93 }
94 
95 void
96 Plic::clear(int src_id)
97 {
98  // Sanity check
99  assert(src_id < nSrc);
100  assert(src_id >= 0);
101 
102  // Update pending bit
103  int src_index = src_id >> 5;
104  int src_offset = src_id & 0x1F;
105  uint32_t& pending = registers.pending[src_index].get();
106  std::bitset<32> pending_bits(pending);
107  pending_bits[src_offset] = 0;
108  pending = (uint32_t) pending_bits.to_ulong();
109 
110  // Update states
111  pendingPriority[src_id] = 0;
112  for (int i = 0; i < nContext; i++) {
113  effPriority[i][src_id] = 0;
114  }
115  DPRINTF(Plic,
116  "Int clear request - source: %#x, current priority: %#x\n",
117  src_id, pendingPriority[src_id]);
118 
119  // Propagate output changes
120  propagateOutput();
121 }
122 
123 Tick
125 {
126  // Check for atomic operation
127  bool is_atomic = pkt->isAtomicOp() && pkt->cmd == MemCmd::SwapReq;
128  DPRINTF(Plic,
129  "Read request - addr: %#x, size: %#x, atomic:%d\n",
130  pkt->getAddr(), pkt->getSize(), is_atomic);
131 
132  // Perform register read
133  registers.read(pkt->getAddr(), pkt->getPtr<void>(), pkt->getSize());
134 
135  if (is_atomic) {
136  // Perform atomic operation
137  (*(pkt->getAtomicOp()))(pkt->getPtr<uint8_t>());
138  return write(pkt);
139  } else {
140  pkt->makeResponse();
141  return pioDelay;
142  }
143 }
144 
145 Tick
147 {
148  DPRINTF(Plic,
149  "Write request - addr: %#x, size: %#x\n",
150  pkt->getAddr(), pkt->getSize());
151 
152  // Perform register write
153  registers.write(pkt->getAddr(), pkt->getPtr<void>(), pkt->getSize());
154 
155  // Propagate output changes
156  propagateOutput();
157 
158  // Apply threshold changes
159  updateInt();
160 
161  pkt->makeResponse();
162  return pioDelay;
163 }
164 
165 void
167 {
168  // Number of 32-bit pending registesrs where
169  // each bit correspondings to one interrupt source
170  nSrc32 = divCeil(nSrc, 32);
171 
172  // Setup register bank
173  registers.init();
174 
175  // Setup internal states
176  pendingPriority.resize(nSrc, 0x0);
177  for (int i = 0; i < nContext; i++) {
178  std::vector<uint32_t> context_priority(nSrc, 0x0);
179  effPriority.push_back(context_priority);
180  }
181  lastID.resize(nContext, 0x0);
182 
183  // Setup outputs
184  output = PlicOutput{
187 
188  DPRINTF(Plic,
189  "Device init - %d contexts, %d sources, %d pending registers\n",
190  nContext, nSrc, nSrc32);
191 
193 }
194 
195 void
197 {
198  using namespace std::placeholders;
199 
200  // Calculate reserved space size
201  const size_t reserve0_size = pendingStart - plic->nSrc * 4;
202  reserved.emplace_back("reserved0", reserve0_size);
203  const size_t reserve1_size = enableStart - pendingStart
204  - plic->nSrc32 * 4;
205  reserved.emplace_back("reserved1", reserve1_size);
206  const size_t reserve2_size = thresholdStart - enableStart
208  reserved.emplace_back("reserved2", reserve2_size);
209  const size_t reserve3_size = plic->pioSize - thresholdStart
211  reserved.emplace_back("reserved3", reserve3_size);
212 
213  // Sanity check
214  assert(plic->pioSize >= thresholdStart
216  assert((int) plic->pioSize <= maxBankSize);
217 
218  // Calculate hole sizes
219  const size_t enable_hole_size = enablePadding - plic->nSrc32 * 4;
220  const size_t claim_hole_size = thresholdPadding - 0x8;
221 
222  // Initialize registers
223  for (int i = 0; i < plic->nSrc; i++) {
224  priority.emplace_back(
225  std::string("priority") + std::to_string(i), 0);
226  }
227  for (int i = 0; i < plic->nSrc32; i++) {
228  pending.emplace_back(
229  std::string("pending") + std::to_string(i), 0);
230  }
231  for (int i = 0; i < plic->nContext; i++) {
232 
233  enable.push_back(std::vector<Register32>());
234  for (int j = 0; j < plic->nSrc32; j++) {
235  enable[i].emplace_back(
236  std::string("enable") + std::to_string(i)
237  + "_" + std::to_string(j), 0);
238  }
239  enable_holes.emplace_back(
240  std::string("enable_hole") + std::to_string(i), enable_hole_size);
241 
242  threshold.emplace_back(
243  std::string("threshold") + std::to_string(i), 0);
244  claim.emplace_back(
245  std::string("claim") + std::to_string(i), 0);
246  claim_holes.emplace_back(
247  std::string("claim_hole") + std::to_string(i), claim_hole_size);
248  }
249 
250  // Add registers to bank
251  // Priority
252  for (int i = 0; i < plic->nSrc; i++) {
253  auto write_cb = std::bind(&Plic::writePriority, plic, _1, _2, i);
254  priority[i].writer(write_cb);
256  }
257  addRegister(reserved[0]);
258 
259  // Pending
260  for (int i = 0; i < plic->nSrc32; i++) {
261  pending[i].readonly();
263  }
264  addRegister(reserved[1]);
265 
266  // Enable
267  for (int i = 0; i < plic->nContext; i++) {
268  for (int j = 0; j < plic->nSrc32; j++) {
269  auto write_cb = std::bind(&Plic::writeEnable, plic, _1, _2, j, i);
270  enable[i][j].writer(write_cb);
271  addRegister(enable[i][j]);
272  }
274  }
275  addRegister(reserved[2]);
276 
277  // Threshold and claim
278  for (int i = 0; i < plic->nContext; i++) {
279  auto threshold_cb = std::bind(&Plic::writeThreshold, plic, _1, _2, i);
280  threshold[i].writer(threshold_cb);
281  auto read_cb = std::bind(&Plic::readClaim, plic, _1, i);
282  auto write_cb = std::bind(&Plic::writeClaim, plic, _1, _2, i);
283  claim[i].reader(read_cb)
284  .writer(write_cb);
286  addRegister(claim[i]);
288  }
289  addRegister(reserved[3]);
290 }
291 
292 void
293 Plic::writePriority(Register32& reg, const uint32_t& data, const int src_id)
294 {
295  reg.update(data);
296 
297  // Calculate indices
298  int src_index = src_id >> 5;
299  int src_offset = src_id & 0x1F;
300 
301  // Update states
302  bool pending = bits(registers.pending[src_index].get(), src_offset);
303  pendingPriority[src_id] = pending ? reg.get() : 0;
304  for (int i = 0; i < nContext; i++) {
305  bool enabled = bits(
306  registers.enable[i][src_index].get(), src_offset);
307  effPriority[i][src_id] = enabled ? pendingPriority[src_id] : 0;
308  }
309 
310  DPRINTF(Plic,
311  "Priority updated - src: %d, val: %d\n",
312  src_id, reg.get());
313 }
314 
315 void
317  const int src32_id, const int context_id)
318 {
319  reg.update(data);
320 
321  for (int i = 0; i < 32; i ++) {
322  int src_id = (src32_id << 5) + i;
323  if (src_id < nSrc) {
324  effPriority[context_id][src_id] =
325  bits(reg.get(), i) ? pendingPriority[src_id] : 0;
326  }
327  }
328  DPRINTF(Plic,
329  "Enable updated - context: %d, src32: %d, val: %#x\n",
330  context_id, src32_id, reg.get());
331 }
332 
333 void
335  const int context_id)
336 {
337  reg.update(data);
338 
339  DPRINTF(Plic,
340  "Threshold updated - context: %d, val: %d\n",
341  context_id, reg.get());
342 }
343 
344 uint32_t
345 Plic::readClaim(Register32& reg, const int context_id)
346 {
347  if (lastID[context_id] == 0) {
348  // Calculate indices
349  uint32_t max_int_id = output.maxID[context_id];
350  int src_index = max_int_id >> 5;
351  int src_offset = max_int_id & 0x1F;
352 
353  // Check pending bits
354  if (bits(registers.pending[src_index].get(), src_offset)) {
355  lastID[context_id] = max_int_id;
356  DPRINTF(Plic,
357  "Claim success - context: %d, interrupt ID: %d\n",
358  context_id, max_int_id);
359  clear(max_int_id);
360  reg.update(max_int_id);
361  return reg.get();
362  } else {
363  DPRINTF(Plic,
364  "Claim already cleared - context: %d, interrupt ID: %d\n",
365  context_id, max_int_id);
366  return 0;
367  }
368  } else {
369  warn("PLIC claim repeated (not completed) - context: %d, last: %d",
370  context_id, lastID[context_id]);
371  return lastID[context_id];
372  }
373 }
374 
375 void
376 Plic::writeClaim(Register32& reg, const uint32_t& data, const int context_id)
377 {
378  reg.update(data);
379 
384  assert(lastID[context_id] == reg.get());
385  lastID[context_id] = 0;
386  DPRINTF(Plic,
387  "Complete - context: %d, interrupt ID: %d\n",
388  context_id, reg.get());
389  updateInt();
390 }
391 
392 void
394 {
395  // Calculate new output
396  PlicOutput new_output{
399  uint32_t max_id;
400  uint32_t max_priority;
401  for (int i = 0; i < nContext; i++) {
402  max_id = max_element(effPriority[i].begin(),
403  effPriority[i].end()) - effPriority[i].begin();
404  max_priority = effPriority[i][max_id];
405  new_output.maxID[i] = max_id;
406  new_output.maxPriority[i] = max_priority;
407  }
408 
409  // Add new output to outputQueue
410  Tick next_update = curTick() + cyclesToTicks(Cycles(3));
411  if (outputQueue.find(next_update) != outputQueue.end()) {
412  outputQueue[next_update] = new_output;
413  } else {
414  outputQueue.insert({next_update, new_output});
415  }
416 
417  // Schedule next update event
418  if (!update.scheduled()) {
419  DPRINTF(Plic, "Update scheduled - tick: %d\n", next_update);
420  schedule(update, next_update);
421  }
422 }
423 
424 void
426 {
427  DPRINTF(Plic, "Update triggered\n");
428  // Set current output to new output
429  output = outputQueue.begin()->second;
430  outputQueue.erase(outputQueue.begin()->first);
431 
432  // Schedule next update event (if any)
433  if (!outputQueue.empty()) {
434  DPRINTF(Plic, "Update scheduled - tick: %d\n",
435  outputQueue.begin()->first);
436  schedule(update, outputQueue.begin()->first);
437  }
438 
439  updateInt();
440 }
441 
442 void
444 {
445  // Update xEIP lines
446  for (int i = 0; i < nContext; i++) {
447  int thread_id = i >> 1;
448  int int_id = (i & 1) ?
450 
451  auto tc = system->threads[thread_id];
452  uint32_t max_id = output.maxID[i];
453  uint32_t priority = output.maxPriority[i];
454  uint32_t threshold = registers.threshold[i].get();
455  if (priority > threshold && max_id > 0 && lastID[i] == 0) {
456  DPRINTF(Plic, "Int posted - thread: %d, int id: %d, ",
457  thread_id, int_id);
458  DPRINTFR(Plic, "pri: %d, thres: %d\n", priority, threshold);
459  tc->getCpuPtr()->postInterrupt(tc->threadId(), int_id, 0);
460  } else {
461  if (priority > 0) {
462  DPRINTF(Plic, "Int filtered - thread: %d, int id: %d, ",
463  thread_id, int_id);
464  DPRINTFR(Plic, "pri: %d, thres: %d\n", priority, threshold);
465  }
466  tc->getCpuPtr()->clearInterrupt(tc->threadId(), int_id, 0);
467  }
468  }
469 }
470 
471 void
473 {
474  int n_outputs = 0;
475 
476  for (auto const &reg: registers.pending) {
477  paramOut(cp, reg.name(), reg);
478  }
479  for (auto const &reg: registers.priority) {
480  paramOut(cp, reg.name(), reg);
481  }
482  for (auto const &reg: registers.enable) {
483  for (auto const &reg_inner: reg) {
484  paramOut(cp, reg_inner.name(), reg_inner);
485  }
486  }
487  for (auto const &reg: registers.threshold) {
488  paramOut(cp, reg.name(), reg);
489  }
490  for (auto const &reg: registers.claim) {
491  paramOut(cp, reg.name(), reg);
492  }
493  for (auto const & it : outputQueue) {
494  paramOut(cp, std::string("output_tick") +
495  std::to_string(n_outputs), it.first);
496  arrayParamOut(cp, std::string("output_id") +
497  std::to_string(n_outputs), it.second.maxID);
498  arrayParamOut(cp, std::string("output_pri") +
499  std::to_string(n_outputs), it.second.maxPriority);
500  n_outputs++;
501  }
502  SERIALIZE_SCALAR(n_outputs);
506  for (int i=0; i < effPriority.size(); i++) {
507  arrayParamOut(cp, std::string("effPriority") +
509  }
511 }
512 
513 void
515 {
516  int n_outputs;
517  UNSERIALIZE_SCALAR(n_outputs);
518 
519  for (auto &reg: registers.pending) {
520  paramIn(cp, reg.name(), reg);
521  }
522  for (auto &reg: registers.priority) {
523  paramIn(cp, reg.name(), reg);
524  }
525  for (auto &reg: registers.enable) {
526  for (auto &reg_inner: reg) {
527  paramIn(cp, reg_inner.name(), reg_inner);
528  }
529  }
530  for (auto &reg: registers.threshold) {
531  paramIn(cp, reg.name(), reg);
532  }
533  for (auto &reg: registers.claim) {
534  paramIn(cp, reg.name(), reg);
535  }
536  for (int i = 0; i < n_outputs; i++) {
537  Tick output_tick;
538  std::vector<uint32_t> output_id;
539  std::vector<uint32_t> output_pri;
540  paramIn(cp, std::string("output_tick") +
541  std::to_string(i), output_tick);
542  arrayParamIn(cp, std::string("output_id") +
543  std::to_string(i), output_id);
544  arrayParamIn(cp, std::string("output_pri") +
545  std::to_string(i), output_pri);
546  outputQueue[output_tick] = PlicOutput{output_id, output_pri};
547  }
548  if (!outputQueue.empty()) {
549  schedule(update, outputQueue.begin()->first);
550  }
554  for (int i=0; i < effPriority.size(); i++) {
555  arrayParamIn(cp, std::string("effPriority") +
557  }
559  updateInt();
560 }
561 
562 } // namespace gem5
gem5::curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:46
gem5::Plic::nSrc32
int nSrc32
Number of 32-bit pending registers needed = ceil(nSrc / 32)
Definition: plic.hh:125
gem5::RiscvISA::INT_EXT_MACHINE
@ INT_EXT_MACHINE
Definition: faults.hh:95
gem5::Packet::isAtomicOp
bool isAtomicOp() const
Definition: packet.hh:846
gem5::RegisterBank< ByteOrder::little >::addRegister
void addRegister(RegisterAdder reg)
Definition: reg_bank.hh:938
gem5::Plic::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: plic.cc:472
warn
#define warn(...)
Definition: logging.hh:256
gem5::Plic::PlicRegisters::enable_holes
std::vector< RegisterRaz > enable_holes
Definition: plic.hh:219
system.hh
gem5::Plic::nContext
int nContext
Number of interrupt contexts = nThread * 2 e.g.
Definition: plic.hh:133
DPRINTFR
#define DPRINTFR(x,...)
Definition: trace.hh:224
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::Plic::PlicRegisters::enable
std::vector< std::vector< Register32 > > enable
Definition: plic.hh:216
gem5::MemCmd::SwapReq
@ SwapReq
Definition: packet.hh:120
UNSERIALIZE_SCALAR
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:575
gem5::Plic::outputQueue
std::map< Tick, PlicOutput > outputQueue
Definition: plic.hh:276
UNSERIALIZE_CONTAINER
#define UNSERIALIZE_CONTAINER(member)
Definition: serialize.hh:634
gem5::Plic::post
void post(int src_id) override
Interrupt interface.
Definition: plic.cc:67
gem5::Plic::PlicRegisters::thresholdStart
const Addr thresholdStart
Definition: plic.hh:208
gem5::CheckpointIn
Definition: serialize.hh:68
gem5::Plic::writePriority
void writePriority(Register32 &reg, const uint32_t &data, const int src_id)
Register read / write callbacks.
Definition: plic.cc:293
gem5::Plic::PlicRegisters::enablePadding
const Addr enablePadding
Definition: plic.hh:209
gem5::Plic::registers
gem5::Plic::PlicRegisters registers
sc_dt::to_string
const std::string to_string(sc_enc enc)
Definition: sc_fxdefs.cc:91
gem5::Plic::nSrc
int nSrc
Definition: plic.hh:120
gem5::PlicBase
Definition: plic.hh:99
gem5::Plic::pendingPriority
std::vector< uint32_t > pendingPriority
Definition: plic.hh:257
gem5::RegisterBank::write
virtual void write(Addr addr, const void *buf, Addr bytes)
Definition: reg_bank.hh:1002
gem5::Plic
Definition: plic.hh:113
gem5::X86ISA::system
Bitfield< 15 > system
Definition: misc.hh:1004
gem5::Plic::PlicRegisters::pending
std::vector< Register32 > pending
Definition: plic.hh:215
gem5::EventManager::schedule
void schedule(Event &event, Tick when)
Definition: eventq.hh:1012
std::vector< uint32_t >
gem5::Plic::Plic
Plic(const Params &params)
Definition: plic.cc:56
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::Plic::updateOutput
void updateOutput()
Trigger:
Definition: plic.cc:425
gem5::Plic::PlicRegisters::enableStart
const Addr enableStart
Definition: plic.hh:207
gem5::Plic::init
void init() override
SimObject functions.
Definition: plic.cc:166
packet.hh
gem5::Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:78
gem5::PioDevice::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: io_device.cc:59
gem5::PioDevice::Params
PioDeviceParams Params
Definition: io_device.hh:134
gem5::Packet::getAtomicOp
AtomicOpFunctor * getAtomicOp() const
Accessor function to atomic op.
Definition: packet.hh:845
gem5::RiscvISA::INT_EXT_SUPER
@ INT_EXT_SUPER
Definition: faults.hh:94
gem5::ArmISA::j
Bitfield< 24 > j
Definition: misc_types.hh:57
gem5::Plic::PlicRegisters::reserved
std::vector< RegisterRaz > reserved
Definition: plic.hh:221
gem5::Plic::system
System * system
Definition: plic.hh:117
gem5::Plic::PlicRegisters::threshold
std::vector< Register32 > threshold
Definition: plic.hh:217
gem5::Clocked::cyclesToTicks
Tick cyclesToTicks(Cycles c) const
Definition: clocked_object.hh:227
gem5::Plic::PlicRegisters::thresholdPadding
const Addr thresholdPadding
Definition: plic.hh:210
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:210
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:294
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::Plic::writeThreshold
void writeThreshold(Register32 &reg, const uint32_t &data, const int context_id)
Definition: plic.cc:334
gem5::PlicOutput::maxID
std::vector< uint32_t > maxID
Definition: plic.hh:95
gem5::BasicPioDevice::pioDelay
Tick pioDelay
Delay that the device experinces on an access.
Definition: io_device.hh:157
gem5::Plic::updateInt
void updateInt()
Trigger:
Definition: plic.cc:443
gem5::Plic::effPriority
std::vector< std::vector< uint32_t > > effPriority
Definition: plic.hh:259
gem5::bits
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:76
gem5::Plic::writeClaim
void writeClaim(Register32 &reg, const uint32_t &data, const int context_id)
Definition: plic.cc:376
gem5::Packet::cmd
MemCmd cmd
The command field of the packet.
Definition: packet.hh:372
gem5::PlicOutput
NOTE: This implementation of CLINT is based on the SiFive U54MC datasheet: https://sifive....
Definition: plic.hh:93
gem5::Plic::propagateOutput
void propagateOutput()
Trigger:
Definition: plic.cc:393
name
const std::string & name()
Definition: trace.cc:48
SERIALIZE_SCALAR
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:568
gem5::Plic::PlicRegisters::claim
std::vector< Register32 > claim
Definition: plic.hh:218
packet_access.hh
gem5::arrayParamOut
decltype(std::begin(std::declval< const T & >()), std::end(std::declval< const T & >()), void()) arrayParamOut(CheckpointOut &os, const std::string &name, const T &param)
Definition: serialize.hh:409
gem5::PlicOutput::maxPriority
std::vector< uint32_t > maxPriority
Definition: plic.hh:96
gem5::statistics::enabled
bool enabled()
Definition: statistics.cc:285
gem5::divCeil
static constexpr T divCeil(const T &a, const U &b)
Definition: intmath.hh:110
gem5::Plic::output
PlicOutput output
Definition: plic.hh:262
gem5::Plic::write
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: plic.cc:146
gem5::Plic::read
Tick read(PacketPtr pkt) override
PioDevice funcitons.
Definition: plic.cc:124
gem5::X86ISA::reg
Bitfield< 5, 3 > reg
Definition: types.hh:92
gem5::Plic::PlicRegisters::init
void init()
Definition: plic.cc:196
gem5::RegisterBank::read
virtual void read(Addr addr, void *buf, Addr bytes)
Definition: reg_bank.hh:945
gem5::Plic::PlicRegisters::priority
std::vector< Register32 > priority
Definition: plic.hh:214
gem5::Plic::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: plic.cc:514
gem5::paramOut
void paramOut(CheckpointOut &cp, const std::string &name, ExtMachInst const &machInst)
Definition: types.cc:40
base.hh
gem5::System::threads
Threads threads
Definition: system.hh:310
gem5::Plic::update
EventFunctionWrapper update
Definition: plic.hh:277
SERIALIZE_CONTAINER
#define SERIALIZE_CONTAINER(member)
Definition: serialize.hh:626
gem5::Packet::makeResponse
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
Definition: packet.hh:1062
gem5::Plic::writeEnable
void writeEnable(Register32 &reg, const uint32_t &data, const int src32_id, const int context_id)
Definition: plic.cc:316
gem5::paramIn
void paramIn(CheckpointIn &cp, const std::string &name, ExtMachInst &machInst)
Definition: types.cc:72
gem5::Plic::PlicRegisters::plic
Plic * plic
Definition: plic.hh:227
gem5::Plic::PlicRegisters::maxBankSize
const Addr maxBankSize
Definition: plic.hh:211
plic.hh
gem5::BasicPioDevice::pioSize
Addr pioSize
Size that the device's address range.
Definition: io_device.hh:154
gem5::CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:66
gem5::Plic::PlicRegisters::claim_holes
std::vector< RegisterRaz > claim_holes
Definition: plic.hh:220
gem5::Plic::lastID
std::vector< uint32_t > lastID
Definition: plic.hh:261
gem5::arrayParamIn
void arrayParamIn(CheckpointIn &cp, const std::string &name, CircleBuf< T > &param)
Definition: circlebuf.hh:257
gem5::Packet::getAddr
Addr getAddr() const
Definition: packet.hh:807
gem5::Plic::Register32
PlicRegisters::Register32 Register32
Definition: plic.hh:233
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::Plic::PlicRegisters::pendingStart
const Addr pendingStart
Definition: plic.hh:206
gem5::Plic::readClaim
uint32_t readClaim(Register32 &reg, const int context_id)
Definition: plic.cc:345
gem5::Packet::getSize
unsigned getSize() const
Definition: packet.hh:817
gem5::Event::scheduled
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:458
gem5::Plic::clear
void clear(int src_id) override
Definition: plic.cc:96
gem5::Packet::getPtr
T * getPtr()
get a pointer to the data ptr.
Definition: packet.hh:1225

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