gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
gic_v3_its.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 ARM Limited
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  * Authors: Giacomo Travaglini
38  */
39 
40 #include "dev/arm/gic_v3_its.hh"
41 
42 #include "debug/AddrRanges.hh"
43 #include "debug/Drain.hh"
44 #include "debug/GIC.hh"
45 #include "debug/ITS.hh"
46 #include "dev/arm/gic_v3.hh"
49 #include "mem/packet_access.hh"
50 
51 #define COMMAND(x, method) { x, DispatchEntry(#x, method) }
52 
53 const AddrRange Gicv3Its::GITS_BASER(0x0100, 0x0140);
54 
55 const uint32_t Gicv3Its::CTLR_QUIESCENT = 0x80000000;
56 
58  : its(_its), coroutine(nullptr)
59 {
60 }
61 
63 {
64 }
65 
66 void
68 {
69  coroutine.reset(new Coroutine(
70  std::bind(&ItsProcess::main, this, std::placeholders::_1)));
71 }
72 
73 const std::string
75 {
76  return its.name();
77 }
78 
81 {
82  assert(coroutine != nullptr);
83  assert(*coroutine);
84  return (*coroutine)(pkt).get();
85 }
86 
87 void
88 ItsProcess::doRead(Yield &yield, Addr addr, void *ptr, size_t size)
89 {
90  ItsAction a;
92 
93  RequestPtr req = std::make_shared<Request>(
94  addr, size, 0, its.masterId);
95 
96  req->taskId(ContextSwitchTaskId::DMA);
97 
98  a.pkt = new Packet(req, MemCmd::ReadReq);
99  a.pkt->dataStatic(ptr);
100 
101  a.delay = 0;
102 
103  PacketPtr pkt = yield(a).get();
104 
105  assert(pkt);
106  assert(pkt->getSize() >= size);
107 
108  delete pkt;
109 }
110 
111 void
112 ItsProcess::doWrite(Yield &yield, Addr addr, void *ptr, size_t size)
113 {
114  ItsAction a;
116 
117  RequestPtr req = std::make_shared<Request>(
118  addr, size, 0, its.masterId);
119 
120  req->taskId(ContextSwitchTaskId::DMA);
121 
122  a.pkt = new Packet(req, MemCmd::WriteReq);
123  a.pkt->dataStatic(ptr);
124 
125  a.delay = 0;
126 
127  PacketPtr pkt = yield(a).get();
128 
129  assert(pkt);
130  assert(pkt->getSize() >= size);
131 
132  delete pkt;
133 }
134 
135 void
137 {
138  ItsAction a;
140  a.pkt = NULL;
141  a.delay = 0;
142  yield(a);
143 }
144 
145 void
146 ItsProcess::writeDeviceTable(Yield &yield, uint32_t device_id, DTE dte)
147 {
149  const Addr address = base + (device_id * sizeof(dte));
150 
151  DPRINTF(ITS, "Writing DTE at address %#x: %#x\n", address, dte);
152 
153  doWrite(yield, address, &dte, sizeof(dte));
154 }
155 
156 void
158  Yield &yield, const Addr itt_base, uint32_t event_id, ITTE itte)
159 {
160  const Addr address = itt_base + (event_id * sizeof(itte));
161 
162  doWrite(yield, address, &itte, sizeof(itte));
163 
164  DPRINTF(ITS, "Writing ITTE at address %#x: %#x\n", address, itte);
165 }
166 
167 void
169  Yield &yield, uint32_t collection_id, CTE cte)
170 {
172  const Addr address = base + (collection_id * sizeof(cte));
173 
174  doWrite(yield, address, &cte, sizeof(cte));
175 
176  DPRINTF(ITS, "Writing CTE at address %#x: %#x\n", address, cte);
177 }
178 
179 uint64_t
180 ItsProcess::readDeviceTable(Yield &yield, uint32_t device_id)
181 {
182  uint64_t dte;
184  const Addr address = base + (device_id * sizeof(dte));
185 
186  doRead(yield, address, &dte, sizeof(dte));
187 
188  DPRINTF(ITS, "Reading DTE at address %#x: %#x\n", address, dte);
189  return dte;
190 }
191 
192 uint64_t
194  Yield &yield, const Addr itt_base, uint32_t event_id)
195 {
196  uint64_t itte;
197  const Addr address = itt_base + (event_id * sizeof(itte));
198 
199  doRead(yield, address, &itte, sizeof(itte));
200 
201  DPRINTF(ITS, "Reading ITTE at address %#x: %#x\n", address, itte);
202  return itte;
203 }
204 
205 uint64_t
206 ItsProcess::readIrqCollectionTable(Yield &yield, uint32_t collection_id)
207 {
208  uint64_t cte;
210  const Addr address = base + (collection_id * sizeof(cte));
211 
212  doRead(yield, address, &cte, sizeof(cte));
213 
214  DPRINTF(ITS, "Reading CTE at address %#x: %#x\n", address, cte);
215  return cte;
216 }
217 
219  : ItsProcess(_its)
220 {
221  reinit();
223  its.gitsControl.quiescent = 0;
224 }
225 
227 {
228  assert(its.pendingTranslations >= 1);
231  its.gitsControl.quiescent = 1;
232 }
233 
234 void
236 {
237  PacketPtr pkt = yield.get();
238 
239  const uint32_t device_id = pkt->req->streamId();
240  const uint32_t event_id = pkt->getLE<uint32_t>();
241 
242  auto result = translateLPI(yield, device_id, event_id);
243 
244  uint32_t intid = result.first;
245  Gicv3Redistributor *redist = result.second;
246 
247  // Set the LPI in the redistributor
248  redist->setClrLPI(intid, true);
249 
250  // Update the value in GITS_TRANSLATER only once we know
251  // there was no error in the tranlation process (before
252  // terminating the translation
253  its.gitsTranslater = event_id;
254 
255  terminate(yield);
256 }
257 
259 ItsTranslation::translateLPI(Yield &yield, uint32_t device_id,
260  uint32_t event_id)
261 {
262  if (its.deviceOutOfRange(device_id)) {
263  terminate(yield);
264  }
265 
266  DTE dte = readDeviceTable(yield, device_id);
267 
268  if (!dte.valid || its.idOutOfRange(event_id, dte.ittRange)) {
269  terminate(yield);
270  }
271 
272  ITTE itte = readIrqTranslationTable(yield, dte.ittAddress, event_id);
273  const auto collection_id = itte.icid;
274 
275  if (!itte.valid || its.collectionOutOfRange(collection_id)) {
276  terminate(yield);
277  }
278 
279  CTE cte = readIrqCollectionTable(yield, collection_id);
280 
281  if (!cte.valid) {
282  terminate(yield);
283  }
284 
285  // Returning the INTID and the target Redistributor
286  return std::make_pair(itte.intNum, its.getRedistributor(cte));
287 }
288 
290 {
291  COMMAND(CLEAR, &ItsCommand::clear),
292  COMMAND(DISCARD, &ItsCommand::discard),
293  COMMAND(INT, &ItsCommand::doInt),
294  COMMAND(INV, &ItsCommand::inv),
295  COMMAND(INVALL, &ItsCommand::invall),
296  COMMAND(MAPC, &ItsCommand::mapc),
297  COMMAND(MAPD, &ItsCommand::mapd),
298  COMMAND(MAPI, &ItsCommand::mapi),
299  COMMAND(MAPTI, &ItsCommand::mapti),
300  COMMAND(MOVALL, &ItsCommand::movall),
301  COMMAND(MOVI, &ItsCommand::movi),
302  COMMAND(SYNC, &ItsCommand::sync),
303  COMMAND(VINVALL, &ItsCommand::vinvall),
304  COMMAND(VMAPI, &ItsCommand::vmapi),
305  COMMAND(VMAPP, &ItsCommand::vmapp),
306  COMMAND(VMAPTI, &ItsCommand::vmapti),
307  COMMAND(VMOVI, &ItsCommand::vmovi),
308  COMMAND(VMOVP, &ItsCommand::vmovp),
309  COMMAND(VSYNC, &ItsCommand::vsync),
310 };
311 
313  : ItsProcess(_its)
314 {
315  reinit();
316  its.pendingCommands = true;
317 
318  its.gitsControl.quiescent = 0;
319 }
320 
322 {
323  its.pendingCommands = false;
324 
326  its.gitsControl.quiescent = 1;
327 }
328 
329 std::string
331 {
332  const auto entry = cmdDispatcher.find(cmd);
333  return entry != cmdDispatcher.end() ? entry->second.name : "INVALID";
334 }
335 
336 void
338 {
339  ItsAction a;
341  a.pkt = nullptr;
342  a.delay = 0;
343  yield(a);
344 
345  while (its.gitsCwriter.offset != its.gitsCreadr.offset) {
346  CommandEntry command;
347 
348  // Reading the command from CMDQ
349  readCommand(yield, command);
350 
351  processCommand(yield, command);
352 
354  }
355 
356  terminate(yield);
357 }
358 
359 void
361 {
362  // read the command pointed by GITS_CREADR
363  const Addr cmd_addr =
364  (its.gitsCbaser.physAddr << 12) + (its.gitsCreadr.offset << 5);
365 
366  doRead(yield, cmd_addr, &command, sizeof(command));
367 
368  DPRINTF(ITS, "Command %s read from queue at address: %#x\n",
369  commandName(command.type), cmd_addr);
370  DPRINTF(ITS, "dw0: %#x dw1: %#x dw2: %#x dw3: %#x\n",
371  command.raw[0], command.raw[1], command.raw[2], command.raw[3]);
372 }
373 
374 void
376 {
377  const auto entry = cmdDispatcher.find(command.type);
378 
379  if (entry != cmdDispatcher.end()) {
380  // Execute the command
381  entry->second.exec(this, yield, command);
382  } else {
383  panic("Unrecognized command type: %u", command.type);
384  }
385 }
386 
387 void
389 {
390  if (deviceOutOfRange(command)) {
392  terminate(yield);
393  }
394 
395  DTE dte = readDeviceTable(yield, command.deviceId);
396 
397  if (!dte.valid || idOutOfRange(command, dte)) {
399  terminate(yield);
400  }
401 
403  yield, dte.ittAddress, command.eventId);
404 
405  if (!itte.valid) {
407  terminate(yield);
408  }
409 
410  const auto collection_id = itte.icid;
411  CTE cte = readIrqCollectionTable(yield, collection_id);
412 
413  if (!cte.valid) {
415  terminate(yield);
416  }
417 
418  // Clear the LPI in the redistributor
419  its.getRedistributor(cte)->setClrLPI(itte.intNum, false);
420 }
421 
422 void
424 {
425  if (deviceOutOfRange(command)) {
427  terminate(yield);
428  }
429 
430  DTE dte = readDeviceTable(yield, command.deviceId);
431 
432  if (!dte.valid || idOutOfRange(command, dte)) {
434  terminate(yield);
435  }
436 
438  yield, dte.ittAddress, command.eventId);
439 
440  if (!itte.valid) {
442  terminate(yield);
443  }
444 
445  const auto collection_id = itte.icid;
446  Gicv3Its::CTE cte = readIrqCollectionTable(yield, collection_id);
447 
448  if (!cte.valid) {
450  terminate(yield);
451  }
452 
453  its.getRedistributor(cte)->setClrLPI(itte.intNum, false);
454 
455  // Then removes the mapping from the ITT (invalidating)
456  itte.valid = 0;
458  yield, dte.ittAddress, command.eventId, itte);
459 }
460 
461 void
463 {
464  if (deviceOutOfRange(command)) {
466  terminate(yield);
467  }
468 
469  DTE dte = readDeviceTable(yield, command.deviceId);
470 
471  if (!dte.valid || idOutOfRange(command, dte)) {
473  terminate(yield);
474  }
475 
477  yield, dte.ittAddress, command.eventId);
478 
479  if (!itte.valid) {
481  terminate(yield);
482  }
483 
484  const auto collection_id = itte.icid;
485  CTE cte = readIrqCollectionTable(yield, collection_id);
486 
487  if (!cte.valid) {
489  terminate(yield);
490  }
491 
492  // Set the LPI in the redistributor
493  its.getRedistributor(cte)->setClrLPI(itte.intNum, true);
494 }
495 
496 void
498 {
499  if (deviceOutOfRange(command)) {
501  terminate(yield);
502  }
503 
504  DTE dte = readDeviceTable(yield, command.deviceId);
505 
506  if (!dte.valid || idOutOfRange(command, dte)) {
508  terminate(yield);
509  }
510 
512  yield, dte.ittAddress, command.eventId);
513 
514  if (!itte.valid) {
516  terminate(yield);
517  }
518 
519  const auto collection_id = itte.icid;
520  CTE cte = readIrqCollectionTable(yield, collection_id);
521 
522  if (!cte.valid) {
524  terminate(yield);
525  }
526  // Do nothing since caching is currently not supported in
527  // Redistributor
528 }
529 
530 void
532 {
533  if (collectionOutOfRange(command)) {
535  terminate(yield);
536  }
537 
538  const auto icid = bits(command.raw[2], 15, 0);
539 
540  CTE cte = readIrqCollectionTable(yield, icid);
541 
542  if (!cte.valid) {
544  terminate(yield);
545  }
546  // Do nothing since caching is currently not supported in
547  // Redistributor
548 }
549 
550 void
552 {
553  if (collectionOutOfRange(command)) {
555  terminate(yield);
556  }
557 
558  CTE cte = 0;
559  cte.valid = bits(command.raw[2], 63);
560  cte.rdBase = bits(command.raw[2], 50, 16);
561 
562  const auto icid = bits(command.raw[2], 15, 0);
563 
564  writeIrqCollectionTable(yield, icid, cte);
565 }
566 
567 void
569 {
570  if (deviceOutOfRange(command) || sizeOutOfRange(command)) {
572  terminate(yield);
573  }
574 
575  DTE dte = 0;
576  dte.valid = bits(command.raw[2], 63);
577  dte.ittAddress = mbits(command.raw[2], 51, 8);
578  dte.ittRange = bits(command.raw[1], 4, 0);
579 
580  writeDeviceTable(yield, command.deviceId, dte);
581 }
582 
583 void
585 {
586  if (deviceOutOfRange(command)) {
588  terminate(yield);
589  }
590 
591  if (collectionOutOfRange(command)) {
593  terminate(yield);
594  }
595 
596  DTE dte = readDeviceTable(yield, command.deviceId);
597 
598  if (!dte.valid || idOutOfRange(command, dte) ||
599  its.lpiOutOfRange(command.eventId)) {
600 
602  terminate(yield);
603  }
604 
605  Gicv3Its::ITTE itte = readIrqTranslationTable(
606  yield, dte.ittAddress, command.eventId);
607 
608  itte.valid = 1;
609  itte.intType = Gicv3Its::PHYSICAL_INTERRUPT;
610  itte.intNum = command.eventId;
611  itte.icid = bits(command.raw[2], 15, 0);
612 
614  yield, dte.ittAddress, command.eventId, itte);
615 }
616 
617 void
619 {
620  if (deviceOutOfRange(command)) {
622  terminate(yield);
623  }
624 
625  if (collectionOutOfRange(command)) {
627  terminate(yield);
628  }
629 
630  DTE dte = readDeviceTable(yield, command.deviceId);
631 
632  const auto pintid = bits(command.raw[1], 63, 32);
633 
634  if (!dte.valid || idOutOfRange(command, dte) ||
635  its.lpiOutOfRange(pintid)) {
636 
638  terminate(yield);
639  }
640 
642  yield, dte.ittAddress, command.eventId);
643 
644  itte.valid = 1;
645  itte.intType = Gicv3Its::PHYSICAL_INTERRUPT;
646  itte.intNum = pintid;
647  itte.icid = bits(command.raw[2], 15, 0);
648 
650  yield, dte.ittAddress, command.eventId, itte);
651 }
652 
653 void
655 {
656  const uint64_t rd1 = bits(command.raw[2], 50, 16);
657  const uint64_t rd2 = bits(command.raw[3], 50, 16);
658 
659  if (rd1 != rd2) {
660  Gicv3Redistributor * redist1 = its.getRedistributor(rd1);
661  Gicv3Redistributor * redist2 = its.getRedistributor(rd2);
662 
663  its.moveAllPendingState(redist1, redist2);
664  }
665 }
666 
667 void
669 {
670  if (deviceOutOfRange(command)) {
672  terminate(yield);
673  }
674 
675  if (collectionOutOfRange(command)) {
677  terminate(yield);
678  }
679 
680  DTE dte = readDeviceTable(yield, command.deviceId);
681 
682  if (!dte.valid || idOutOfRange(command, dte)) {
684  terminate(yield);
685  }
686 
688  yield, dte.ittAddress, command.eventId);
689 
690  if (!itte.valid || itte.intType == Gicv3Its::VIRTUAL_INTERRUPT) {
692  terminate(yield);
693  }
694 
695  const auto collection_id1 = itte.icid;
696  CTE cte1 = readIrqCollectionTable(yield, collection_id1);
697 
698  if (!cte1.valid) {
700  terminate(yield);
701  }
702 
703  const auto collection_id2 = bits(command.raw[2], 15, 0);
704  CTE cte2 = readIrqCollectionTable(yield, collection_id2);
705 
706  if (!cte2.valid) {
708  terminate(yield);
709  }
710 
711  Gicv3Redistributor *first_redist = its.getRedistributor(cte1);
712  Gicv3Redistributor *second_redist = its.getRedistributor(cte2);
713 
714  if (second_redist != first_redist) {
715  // move pending state of the interrupt from one redistributor
716  // to the other.
717  if (first_redist->isPendingLPI(itte.intNum)) {
718  first_redist->setClrLPI(itte.intNum, false);
719  second_redist->setClrLPI(itte.intNum, true);
720  }
721  }
722 
723  itte.icid = collection_id2;
725  yield, dte.ittAddress, command.eventId, itte);
726 }
727 
728 void
730 {
731  warn("ITS %s command unimplemented", __func__);
732 }
733 
734 void
736 {
737  panic("ITS %s command unimplemented", __func__);
738 }
739 
740 void
742 {
743  panic("ITS %s command unimplemented", __func__);
744 }
745 
746 void
748 {
749  panic("ITS %s command unimplemented", __func__);
750 }
751 
752 void
754 {
755  panic("ITS %s command unimplemented", __func__);
756 }
757 
758 void
760 {
761  panic("ITS %s command unimplemented", __func__);
762 }
763 
764 void
766 {
767  panic("ITS %s command unimplemented", __func__);
768 }
769 
770 void
772 {
773  panic("ITS %s command unimplemented", __func__);
774 }
775 
776 Gicv3Its::Gicv3Its(const Gicv3ItsParams *params)
777  : BasicPioDevice(params, params->pio_size),
778  dmaPort(name() + ".dma", *this),
779  gitsControl(CTLR_QUIESCENT),
780  gitsTyper(params->gits_typer),
781  gitsCbaser(0), gitsCreadr(0),
782  gitsCwriter(0), gitsIidr(0),
784  masterId(params->system->getMasterId(this)),
785  gic(nullptr),
786  commandEvent([this] { checkCommandQueue(); }, name()),
787  pendingCommands(false),
789 {
790  BASER device_baser = 0;
791  device_baser.type = DEVICE_TABLE;
792  device_baser.entrySize = sizeof(uint64_t) - 1;
793  tableBases[0] = device_baser;
794 
795  BASER icollect_baser = 0;
796  icollect_baser.type = COLLECTION_TABLE;
797  icollect_baser.entrySize = sizeof(uint64_t) - 1;
798  tableBases[1] = icollect_baser;
799 }
800 
801 void
803 {
804  assert(!gic);
805  gic = _gic;
806 }
807 
810 {
811  assert(pioSize != 0);
812  AddrRangeList ranges;
813  DPRINTF(AddrRanges, "registering range: %#x-%#x\n", pioAddr, pioSize);
814  ranges.push_back(RangeSize(pioAddr, pioSize));
815  return ranges;
816 }
817 
818 Tick
820 {
821  const Addr addr = pkt->getAddr() - pioAddr;
822  uint64_t value = 0;
823 
824  DPRINTF(GIC, "%s register at addr: %#x\n", __func__, addr);
825 
826  switch (addr) {
827  case GITS_CTLR:
828  value = gitsControl;
829  break;
830 
831  case GITS_IIDR:
832  value = gitsIidr;
833  break;
834 
835  case GITS_TYPER:
836  value = gitsTyper;
837  break;
838 
839  case GITS_TYPER + 4:
840  value = gitsTyper.high;
841  break;
842 
843  case GITS_CBASER:
844  value = gitsCbaser;
845  break;
846 
847  case GITS_CBASER + 4:
848  value = gitsCbaser.high;
849  break;
850 
851  case GITS_CWRITER:
852  value = gitsCwriter;
853  break;
854 
855  case GITS_CWRITER + 4:
856  value = gitsCwriter.high;
857  break;
858 
859  case GITS_CREADR:
860  value = gitsCreadr;
861  break;
862 
863  case GITS_CREADR + 4:
864  value = gitsCreadr.high;
865  break;
866 
867  case GITS_PIDR2:
868  value = gic->getDistributor()->gicdPidr2;
869  break;
870 
871  case GITS_TRANSLATER:
872  value = gitsTranslater;
873  break;
874 
875  default:
876  if (GITS_BASER.contains(addr)) {
877  auto relative_addr = addr - GITS_BASER.start();
878  auto baser_index = relative_addr / sizeof(uint64_t);
879 
880  value = tableBases[baser_index];
881  break;
882  } else {
883  panic("Unrecognized register access\n");
884  }
885  }
886 
887  pkt->setUintX(value, LittleEndianByteOrder);
888  pkt->makeAtomicResponse();
889  return pioDelay;
890 }
891 
892 Tick
894 {
895  Addr addr = pkt->getAddr() - pioAddr;
896 
897  DPRINTF(GIC, "%s register at addr: %#x\n", __func__, addr);
898 
899  switch (addr) {
900  case GITS_CTLR:
901  assert(pkt->getSize() == sizeof(uint32_t));
902  gitsControl = (pkt->getLE<uint32_t>() & ~CTLR_QUIESCENT);
903  // We should check here if the ITS has been disabled, and if
904  // that's the case, flush GICv3 caches to external memory.
905  // This is not happening now, since LPI caching is not
906  // currently implemented in gem5.
907  break;
908 
909  case GITS_IIDR:
910  panic("GITS_IIDR is Read Only\n");
911 
912  case GITS_TYPER:
913  panic("GITS_TYPER is Read Only\n");
914 
915  case GITS_CBASER:
916  if (pkt->getSize() == sizeof(uint32_t)) {
917  gitsCbaser.low = pkt->getLE<uint32_t>();
918  } else {
919  assert(pkt->getSize() == sizeof(uint64_t));
920  gitsCbaser = pkt->getLE<uint64_t>();
921  }
922 
923  gitsCreadr = 0; // Cleared when CBASER gets written
924 
926  break;
927 
928  case GITS_CBASER + 4:
929  assert(pkt->getSize() == sizeof(uint32_t));
930  gitsCbaser.high = pkt->getLE<uint32_t>();
931 
932  gitsCreadr = 0; // Cleared when CBASER gets written
933 
935  break;
936 
937  case GITS_CWRITER:
938  if (pkt->getSize() == sizeof(uint32_t)) {
939  gitsCwriter.low = pkt->getLE<uint32_t>();
940  } else {
941  assert(pkt->getSize() == sizeof(uint64_t));
942  gitsCwriter = pkt->getLE<uint64_t>();
943  }
944 
946  break;
947 
948  case GITS_CWRITER + 4:
949  assert(pkt->getSize() == sizeof(uint32_t));
950  gitsCwriter.high = pkt->getLE<uint32_t>();
951 
953  break;
954 
955  case GITS_CREADR:
956  panic("GITS_READR is Read Only\n");
957 
958  case GITS_TRANSLATER:
959  if (gitsControl.enabled) {
960  translate(pkt);
961  }
962  break;
963 
964  default:
965  if (GITS_BASER.contains(addr)) {
966  auto relative_addr = addr - GITS_BASER.start();
967  auto baser_index = relative_addr / sizeof(uint64_t);
968 
969  const uint64_t table_base = tableBases[baser_index];
970  const uint64_t w_mask = tableBases[baser_index].type ?
972  const uint64_t val = pkt->getLE<uint64_t>() & w_mask;
973 
974  tableBases[baser_index] = table_base | val;
975  break;
976  } else {
977  panic("Unrecognized register access\n");
978  }
979  }
980 
981  pkt->makeAtomicResponse();
982  return pioDelay;
983 }
984 
985 bool
986 Gicv3Its::idOutOfRange(uint32_t event_id, uint8_t itt_range) const
987 {
988  const uint32_t id_bits = gitsTyper.idBits;
989  return event_id >= (1ULL << (id_bits + 1)) ||
990  event_id >= ((1ULL << itt_range) + 1);
991 }
992 
993 bool
994 Gicv3Its::deviceOutOfRange(uint32_t device_id) const
995 {
996  return device_id >= (1ULL << (gitsTyper.devBits + 1));
997 }
998 
999 bool
1001 {
1002  return size > gitsTyper.idBits;
1003 }
1004 
1005 bool
1006 Gicv3Its::collectionOutOfRange(uint32_t collection_id) const
1007 {
1008  // If GITS_TYPER.CIL == 0, ITS supports 16-bit CollectionID
1009  // Otherwise, #bits is specified by GITS_TYPER.CIDbits
1010  const auto cid_bits = gitsTyper.cil == 0 ?
1011  16 : gitsTyper.cidBits + 1;
1012 
1013  return collection_id >= (1ULL << cid_bits);
1014 }
1015 
1016 bool
1017 Gicv3Its::lpiOutOfRange(uint32_t intid) const
1018 {
1019  return intid >= (1ULL << (Gicv3Distributor::IDBITS + 1)) ||
1021  intid != Gicv3::INTID_SPURIOUS);
1022 }
1023 
1024 DrainState
1026 {
1028  return DrainState::Drained;
1029  } else {
1030  DPRINTF(Drain, "GICv3 ITS not drained\n");
1031  return DrainState::Draining;
1032  }
1033 }
1034 
1035 void
1037 {
1038  SERIALIZE_SCALAR(gitsControl);
1044 
1046 }
1047 
1048 void
1050 {
1051  UNSERIALIZE_SCALAR(gitsControl);
1057 
1059 }
1060 
1061 void
1063 {
1064  // Make the reader point to the next element
1065  gitsCreadr.offset = gitsCreadr.offset + 1;
1066 
1067  // Check for wrapping
1068  if (gitsCreadr.offset == maxCommands()) {
1069  gitsCreadr.offset = 0;
1070  }
1071 }
1072 
1073 uint64_t
1075 {
1076  return (4096 * (gitsCbaser.size + 1)) / sizeof(ItsCommand::CommandEntry);
1077 }
1078 
1079 void
1081 {
1082  if (!gitsControl.enabled || !gitsCbaser.valid)
1083  return;
1084 
1085  // If GITS_CWRITER gets set by sw to a value bigger than the
1086  // allowed one, the command queue should stop processing commands
1087  // until the register gets reset to an allowed one
1088  if (gitsCwriter.offset >= maxCommands()) {
1089  return;
1090  }
1091 
1092  if (gitsCwriter.offset != gitsCreadr.offset) {
1093  // writer and reader pointing to different command
1094  // entries: queue not empty.
1095  DPRINTF(ITS, "Reading command from queue\n");
1096 
1097  if (!pendingCommands) {
1098  auto *cmd_proc = new ItsCommand(*this);
1099 
1100  runProcess(cmd_proc, nullptr);
1101  } else {
1102  DPRINTF(ITS, "Waiting for pending command to finish\n");
1103  }
1104  }
1105 }
1106 
1107 Port &
1108 Gicv3Its::getPort(const std::string &if_name, PortID idx)
1109 {
1110  if (if_name == "dma") {
1111  return dmaPort;
1112  }
1113  return BasicPioDevice::getPort(if_name, idx);
1114 }
1115 
1116 void
1118 {
1119  assert(!packetsToRetry.empty());
1120 
1121  while (!packetsToRetry.empty()) {
1122  ItsAction a = packetsToRetry.front();
1123 
1124  assert(a.type == ItsActionType::SEND_REQ);
1125 
1126  if (!dmaPort.sendTimingReq(a.pkt))
1127  break;
1128 
1129  packetsToRetry.pop();
1130  }
1131 }
1132 
1133 bool
1135 {
1136  // @todo: We need to pay for this and not just zero it out
1137  pkt->headerDelay = pkt->payloadDelay = 0;
1138 
1139  ItsProcess *proc =
1140  safe_cast<ItsProcess *>(pkt->popSenderState());
1141 
1142  runProcessTiming(proc, pkt);
1143 
1144  return true;
1145 }
1146 
1147 ItsAction
1149 {
1150  if (sys->isAtomicMode()) {
1151  return runProcessAtomic(proc, pkt);
1152  } else if (sys->isTimingMode()) {
1153  return runProcessTiming(proc, pkt);
1154  } else {
1155  panic("Not in timing or atomic mode\n");
1156  }
1157 }
1158 
1159 ItsAction
1161 {
1162  ItsAction action = proc->run(pkt);
1163 
1164  switch (action.type) {
1166  action.pkt->pushSenderState(proc);
1167 
1168  if (packetsToRetry.empty() &&
1169  dmaPort.sendTimingReq(action.pkt)) {
1170 
1171  } else {
1172  packetsToRetry.push(action);
1173  }
1174  break;
1175 
1177  delete proc;
1178  if (!pendingCommands && !commandEvent.scheduled()) {
1180  }
1181  break;
1182 
1183  default:
1184  panic("Unknown action\n");
1185  }
1186 
1187  return action;
1188 }
1189 
1190 ItsAction
1192 {
1193  ItsAction action;
1194  Tick delay = 0;
1195  bool terminate = false;
1196 
1197  do {
1198  action = proc->run(pkt);
1199 
1200  switch (action.type) {
1202  delay += dmaPort.sendAtomic(action.pkt);
1203  pkt = action.pkt;
1204  break;
1205 
1207  delete proc;
1208  terminate = true;
1209  break;
1210 
1211  default:
1212  panic("Unknown action\n");
1213  }
1214 
1215  } while (!terminate);
1216 
1217  action.delay = delay;
1218 
1219  return action;
1220 }
1221 
1222 void
1224 {
1225  DPRINTF(ITS, "Starting Translation Request\n");
1226 
1227  auto *proc = new ItsTranslation(*this);
1228  runProcess(proc, pkt);
1229 }
1230 
1233 {
1234  if (gitsTyper.pta == 1) {
1235  // RDBase is a redistributor address
1236  return gic->getRedistributorByAddr(rd_base << 16);
1237  } else {
1238  // RDBase is a redistributor number
1239  return gic->getRedistributor(rd_base);
1240  }
1241 }
1242 
1243 Addr
1245 {
1246  auto base_it = std::find_if(
1247  tableBases.begin(), tableBases.end(),
1248  [table] (const BASER &b) { return b.type == table; }
1249  );
1250 
1251  panic_if(base_it == tableBases.end(),
1252  "ITS Table not recognised\n");
1253 
1254  const BASER base = *base_it;
1255 
1256  // real address depends on page size
1257  switch (base.pageSize) {
1258  case SIZE_4K:
1259  case SIZE_16K:
1260  return mbits(base, 47, 12);
1261  case SIZE_64K:
1262  return mbits(base, 47, 16) | (bits(base, 15, 12) << 48);
1263  default:
1264  panic("Unsupported page size\n");
1265  }
1266 }
1267 
1268 void
1271 {
1272  const uint64_t largest_lpi_id = 1ULL << (rd1->lpiIDBits + 1);
1273  uint8_t lpi_pending_table[largest_lpi_id / 8];
1274 
1275  // Copying the pending table from redistributor 1 to redistributor 2
1276  rd1->memProxy->readBlob(
1277  rd1->lpiPendingTablePtr, (uint8_t *)lpi_pending_table,
1278  sizeof(lpi_pending_table));
1279 
1280  rd2->memProxy->writeBlob(
1281  rd2->lpiPendingTablePtr, (uint8_t *)lpi_pending_table,
1282  sizeof(lpi_pending_table));
1283 
1284  // Clearing pending table in redistributor 2
1285  rd1->memProxy->memsetBlob(
1286  rd1->lpiPendingTablePtr,
1287  0, sizeof(lpi_pending_table));
1288 
1289  rd2->updateDistributor();
1290 }
1291 
1292 Gicv3Its *
1293 Gicv3ItsParams::create()
1294 {
1295  return new Gicv3Its(this);
1296 }
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:167
#define DPRINTF(x,...)
Definition: trace.hh:229
Gicv3Its::CTE CTE
Definition: gic_v3_its.hh:352
AddrRange RangeSize(Addr start, Addr size)
Definition: addr_range.hh:584
Gicv3Its(const Gicv3ItsParams *params)
Definition: gic_v3_its.cc:776
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
Definition: packet.cc:354
Ports are used to interface objects to each other.
Definition: port.hh:60
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: gic_v3_its.cc:1036
bool deviceOutOfRange(CommandEntry &command) const
Definition: gic_v3_its.hh:520
Definition: gic_v3.hh:54
void doInt(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:462
ItsAction runProcessAtomic(ItsProcess *proc, PacketPtr pkt)
Definition: gic_v3_its.cc:1191
void terminate(Yield &yield)
Definition: gic_v3_its.cc:136
void sync(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:729
Gicv3Its::DTE DTE
Definition: gic_v3_its.hh:350
std::vector< BASER > tableBases
Definition: gic_v3_its.hh:223
Port & getPort(const std::string &if_name, PortID idx) override
Get a port with a given name and index.
Definition: gic_v3_its.cc:1108
bool deviceOutOfRange(uint32_t device_id) const
Returns TRUE if the value supplied has bits above the implemented range or if the value supplied exce...
Definition: gic_v3_its.cc:994
STL pair class.
Definition: stl.hh:61
bool isPendingLPI(uint32_t intid)
DrainState
Object drain/handover states.
Definition: drain.hh:71
Running normally.
static const AddrRange GITS_BASER
Definition: gic_v3_its.hh:113
std::pair< uint32_t, Gicv3Redistributor * > translateLPI(Yield &yield, uint32_t device_id, uint32_t event_id)
Definition: gic_v3_its.cc:259
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
Definition: gic_v3_its.cc:809
virtual ~ItsProcess()
Definition: gic_v3_its.cc:62
Addr pageAddress(enum ItsTables table)
Definition: gic_v3_its.cc:1244
void processCommand(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:375
uint64_t readDeviceTable(Yield &yield, uint32_t device_id)
Definition: gic_v3_its.cc:180
PacketPtr pkt
Definition: gic_v3_its.hh:65
Bitfield< 7, 0 > size
Definition: gic_v3_its.hh:182
bool contains(const Addr &a) const
Determine if the range contains an address.
Definition: addr_range.hh:406
std::shared_ptr< Request > RequestPtr
Definition: request.hh:83
Bitfield< 8 > a
m5::Coroutine< PacketPtr, ItsAction > Coroutine
Definition: gic_v3_its.hh:353
Tick delay
Definition: gic_v3_its.hh:66
virtual void main(Yield &yield)=0
ip6_addr_t addr
Definition: inet.hh:335
ItsAction runProcessTiming(ItsProcess *proc, PacketPtr pkt)
Definition: gic_v3_its.cc:1160
TYPER gitsTyper
Definition: gic_v3_its.hh:216
void mapi(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:584
Gicv3Redistributor * getRedistributorByAddr(Addr address) const
Definition: gic_v3.cc:238
EventFunctionWrapper commandEvent
Definition: gic_v3_its.hh:326
uint64_t readIrqTranslationTable(Yield &yield, const Addr itt_base, uint32_t event_id)
Definition: gic_v3_its.cc:193
bool sizeOutOfRange(uint32_t size) const
Returns TRUE if the value (size) supplied exceeds the maximum allowed by GITS_TYPER.ID_bits.
Definition: gic_v3_its.cc:1000
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: gic_v3_its.cc:1049
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the slave port by calling its corresponding receive function...
Definition: port.hh:445
void writeIrqCollectionTable(Yield &yield, uint32_t collection_id, CTE cte)
Definition: gic_v3_its.cc:168
An ItsTranslation is created whenever a peripheral writes a message in GITS_TRANSLATER (MSI)...
Definition: gic_v3_its.hh:401
Definition: cprintf.cc:42
static const uint32_t NUM_BASER_REGS
Definition: gic_v3_its.hh:115
bool sizeOutOfRange(CommandEntry &command) const
Definition: gic_v3_its.hh:525
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1040
Bitfield< 63 > val
Definition: misc.hh:771
CallerType: A reference to an object of this class will be passed to the coroutine task...
Definition: coroutine.hh:85
RequestPtr req
A pointer to the original request.
Definition: packet.hh:327
void moveAllPendingState(Gicv3Redistributor *rd1, Gicv3Redistributor *rd2)
Definition: gic_v3_its.cc:1269
Gicv3Its & its
Definition: gic_v3_its.hh:389
uint32_t masterId
Definition: gic_v3_its.hh:324
Gicv3 * gic
Definition: gic_v3_its.hh:325
Bitfield< 7 > b
unsigned getSize() const
Definition: packet.hh:736
void invall(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:531
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Definition: addr_range.hh:72
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:645
static const uint64_t BASER_WMASK
Definition: gic_v3_its.hh:124
bool recvTimingResp(PacketPtr pkt)
Definition: gic_v3_its.cc:1134
bool lpiOutOfRange(uint32_t intid) const
Returns TRUE if the value supplied is larger than that permitted by GICD_TYPER.IDbits or not in the L...
Definition: gic_v3_its.cc:1017
#define SERIALIZE_CONTAINER(member)
Definition: serialize.hh:664
bool isAtomicMode() const
Is the system in atomic mode?
Definition: system.hh:139
static std::string commandName(uint32_t cmd)
Definition: gic_v3_its.cc:330
static const uint64_t BASER_WMASK_UNIMPL
Definition: gic_v3_its.hh:126
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:385
void mapti(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:618
Addr pioSize
Size that the device&#39;s address range.
Definition: io_device.hh:160
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
Definition: packet.hh:366
uint64_t readIrqCollectionTable(Yield &yield, uint32_t collection_id)
Definition: gic_v3_its.cc:206
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
Definition: port_proxy.hh:189
void makeAtomicResponse()
Definition: packet.hh:949
std::unordered_map< std::underlying_type< enum CommandType >::type, DispatchEntry > DispatchTable
Definition: gic_v3_its.hh:482
void memsetBlob(Addr addr, uint8_t v, int size) const
Same as tryMemsetBlob, but insists on success.
Definition: port_proxy.hh:199
uint64_t Tick
Tick count type.
Definition: types.hh:63
DataPort dmaPort
Definition: gic_v3_its.hh:99
static const uint32_t IDBITS
bool idOutOfRange(uint32_t event_id, uint8_t itt_range) const
Returns TRUE if the eventID supplied has bits above the implemented size or above the itt_range...
Definition: gic_v3_its.cc:986
Bitfield< 51, 12 > base
Definition: pagetable.hh:142
void setClrLPI(uint64_t data, bool set)
Addr getAddr() const
Definition: packet.hh:726
const Params * params() const
Definition: io_device.hh:170
void checkCommandQueue()
Definition: gic_v3_its.cc:1080
void clear(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:388
ItsProcess is a base coroutine wrapper which is spawned by the Gicv3Its module when the latter needs ...
Definition: gic_v3_its.hh:347
An ItsCommand is created whenever there is a new command in the command queue.
Definition: gic_v3_its.hh:420
void discard(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:423
CRDWR gitsCreadr
Definition: gic_v3_its.hh:218
bool collectionOutOfRange(CommandEntry &command) const
Definition: gic_v3_its.hh:535
#define UNSERIALIZE_CONTAINER(member)
Definition: serialize.hh:667
ItsAction runProcess(ItsProcess *proc, PacketPtr pkt)
Definition: gic_v3_its.cc:1148
static const int INTID_SPURIOUS
Definition: gic_v3.hh:75
Gicv3Redistributor * getRedistributor(ContextID context_id) const
Definition: gic_v3.hh:149
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
ItsCommand(Gicv3Its &_its)
Definition: gic_v3_its.cc:312
Draining buffers pending serialization/handover.
#define ULL(N)
uint64_t constant
Definition: types.hh:50
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
Definition: packet.hh:384
System * sys
Definition: io_device.hh:105
virtual const std::string name() const
Definition: sim_object.hh:120
void mapc(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:551
T safe_cast(U ptr)
Definition: cast.hh:61
void main(Yield &yield) override
Definition: gic_v3_its.cc:337
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:255
CRDWR gitsCwriter
Definition: gic_v3_its.hh:219
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
std::unique_ptr< Coroutine > coroutine
Definition: gic_v3_its.hh:392
void mapd(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:568
Bitfield< 15 > system
Definition: misc.hh:999
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Definition: port_proxy.hh:179
uint64_t maxCommands() const
Definition: gic_v3_its.cc:1074
void vmapi(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:741
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:643
void vinvall(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:735
void incrementReadPointer()
Definition: gic_v3_its.cc:1062
void inv(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:497
static const uint32_t SMALLEST_LPI_ID
Gicv3Its::ITTE ITTE
Definition: gic_v3_its.hh:351
void reinit()
Definition: gic_v3_its.cc:67
std::queue< ItsAction > packetsToRetry
Definition: gic_v3_its.hh:323
void vmapti(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:753
bool pendingCommands
Definition: gic_v3_its.hh:328
static const uint32_t CTLR_QUIESCENT
Definition: gic_v3_its.hh:130
CBASER gitsCbaser
Definition: gic_v3_its.hh:217
void translate(PacketPtr pkt)
Definition: gic_v3_its.cc:1223
std::ostream CheckpointOut
Definition: serialize.hh:68
void vmapp(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:747
void readCommand(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:360
void main(Yield &yield) override
Definition: gic_v3_its.cc:235
#define COMMAND(x, method)
Definition: gic_v3_its.cc:51
ItsProcess(Gicv3Its &_its)
Definition: gic_v3_its.cc:57
Tick pioDelay
Delay that the device experinces on an access.
Definition: io_device.hh:163
void writeDeviceTable(Yield &yield, uint32_t device_id, DTE dte)
Definition: gic_v3_its.cc:146
Bitfield< 27, 24 > gic
void schedule(Event &event, Tick when)
Definition: eventq.hh:744
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: io_device.cc:67
void movi(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:668
void movall(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:654
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: gic_v3_its.cc:819
std::enable_if<!std::is_same< T, void >::value, T >::type get()
get() is the way we can extrapolate arguments from the coroutine caller.
Definition: coroutine.hh:136
Gicv3Redistributor * getRedistributor(uint64_t rd_base)
Definition: gic_v3_its.cc:1232
bool collectionOutOfRange(uint32_t collection_id) const
Returns TRUE if the value supplied has bits above the implemented range or if the value exceeds the t...
Definition: gic_v3_its.cc:1006
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
static DispatchTable cmdDispatcher
Definition: gic_v3_its.hh:484
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
Definition: packet.cc:319
Addr start() const
Get the start address of the range.
Definition: addr_range.hh:297
void doWrite(Yield &yield, Addr addr, void *ptr, size_t size)
Definition: gic_v3_its.cc:112
const std::string name() const
Returns the Gicv3Its name.
Definition: gic_v3_its.cc:74
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
Definition: packet.cc:327
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:237
void writeIrqTranslationTable(Yield &yield, const Addr itt_base, uint32_t event_id, ITTE itte)
Definition: gic_v3_its.cc:157
#define warn(...)
Definition: logging.hh:212
void vmovp(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:765
uint32_t gitsIidr
Definition: gic_v3_its.hh:220
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: gic_v3_its.cc:893
bool isTimingMode() const
Is the system in timing mode?
Definition: system.hh:150
DrainState drain() override
Notify an object that it needs to drain its state.
Definition: gic_v3_its.cc:1025
T mbits(T val, int first, int last)
Mask off the given bits in place like bits() but without shifting.
Definition: bitfield.hh:96
T bits(T val, int first, int last)
Extract the bitfield from position &#39;first&#39; to &#39;last&#39; (inclusive) from &#39;val&#39; and right justify it...
Definition: bitfield.hh:72
void setGIC(Gicv3 *_gic)
Definition: gic_v3_its.cc:802
ItsAction run(PacketPtr pkt)
Definition: gic_v3_its.cc:80
Bitfield< 45, 30 > icid
Definition: gic_v3_its.hh:273
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time...
Definition: port.hh:427
void vmovi(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:759
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:185
uint32_t gitsTranslater
Definition: gic_v3_its.hh:221
ItsActionType type
Definition: gic_v3_its.hh:64
Addr pioAddr
Address that the device listens to.
Definition: io_device.hh:157
bool idOutOfRange(CommandEntry &command, DTE dte) const
Definition: gic_v3_its.hh:515
uint32_t pendingTranslations
Definition: gic_v3_its.hh:329
ItsTranslation(Gicv3Its &_its)
Definition: gic_v3_its.cc:218
void doRead(Yield &yield, Addr addr, void *ptr, size_t size)
Definition: gic_v3_its.cc:88
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:104
GICv3 ITS module.
Definition: gic_v3_its.hh:76
void vsync(Yield &yield, CommandEntry &command)
Definition: gic_v3_its.cc:771
Gicv3Distributor * getDistributor() const
Definition: gic_v3.hh:143
void recvReqRetry()
Definition: gic_v3_its.cc:1117

Generated on Fri Feb 28 2020 16:27:00 for gem5 by doxygen 1.8.13