gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
malta_cchip.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2005 The Regents of The University of Michigan
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * Authors: Ali Saidi
29  * Rick Strong
30  */
31 
36 #include "dev/mips/malta_cchip.hh"
37 
38 #include <deque>
39 #include <string>
40 #include <vector>
41 
42 #include "base/trace.hh"
43 #include "cpu/intr_control.hh"
44 #include "cpu/thread_context.hh"
45 #include "debug/Malta.hh"
46 #include "dev/mips/malta.hh"
47 #include "dev/mips/maltareg.h"
48 #include "mem/packet.hh"
49 #include "mem/packet_access.hh"
50 #include "mem/port.hh"
51 #include "params/MaltaCChip.hh"
52 #include "sim/system.hh"
53 
54 using namespace std;
55 
57  : BasicPioDevice(p, 0xfffffff), malta(p->malta)
58 {
59  warn("MaltaCCHIP::MaltaCChip() not implemented.");
60 
61  //Put back pointer in malta
62  malta->cchip = this;
63 
64 }
65 
66 Tick
68 {
69  panic("MaltaCCHIP::read() not implemented.");
70  return pioDelay;
71 }
72 
73 Tick
75 {
76  panic("MaltaCCHIP::write() not implemented.");
77  return pioDelay;
78 }
79 
80 void
81 MaltaCChip::clearIPI(uint64_t ipintr)
82 {
83  panic("MaltaCCHIP::clear() not implemented.");
84 }
85 
86 void
87 MaltaCChip::clearITI(uint64_t itintr)
88 {
89  panic("MaltaCCHIP::clearITI() not implemented.");
90 }
91 
92 void
93 MaltaCChip::reqIPI(uint64_t ipreq)
94 {
95  panic("MaltaCCHIP::reqIPI() not implemented.");
96 }
97 
98 
99 void
101 {
102  panic("MaltaCCHIP::postRTC() not implemented.");
103 }
104 
105 void
106 MaltaCChip::postIntr(uint32_t interrupt)
107 {
108  uint64_t size = sys->threadContexts.size();
109  assert(size <= Malta::Max_CPUs);
110 
111  for (int i=0; i < size; i++) {
112  //Note: Malta does not use index, but this was added to use the
113  //pre-existing implementation
114  malta->intrctrl->post(i, interrupt, 0);
115  DPRINTF(Malta, "posting interrupt to cpu %d, interrupt %d\n",
116  i, interrupt);
117  }
118 }
119 
120 void
121 MaltaCChip::clearIntr(uint32_t interrupt)
122 {
123  uint64_t size = sys->threadContexts.size();
124  assert(size <= Malta::Max_CPUs);
125 
126  for (int i=0; i < size; i++) {
127  //Note: Malta does not use index, but this was added to use the
128  //pre-existing implementation
129  malta->intrctrl->clear(i, interrupt, 0);
130  DPRINTF(Malta, "clearing interrupt to cpu %d, interrupt %d\n",
131  i, interrupt);
132  }
133 }
134 
135 
136 void
138 {
139 }
140 
141 void
143 {
144 }
145 
146 MaltaCChip *
147 MaltaCChipParams::create()
148 {
149  return new MaltaCChip(this);
150 }
151 
IntrControl * intrctrl
Pointer to the interrupt controller.
Definition: platform.hh:56
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:167
#define DPRINTF(x,...)
Definition: trace.hh:229
void clearIPI(uint64_t ipintr)
post an ipi interrupt to the CPU.
Definition: malta_cchip.cc:81
Emulation of the Malta CChip CSRs.
Malta * malta
pointer to the malta object.
Definition: malta_cchip.hh:55
void clearIntr(uint32_t interrupt)
clear an interrupt previously posted to the CPU.
Definition: malta_cchip.cc:121
Bitfield< 7 > i
void post(int cpu_id, int int_num, int index)
Definition: intr_control.cc:50
PioDeviceParams Params
Definition: io_device.hh:134
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:586
Definition: cprintf.cc:42
void reqIPI(uint64_t ipreq)
request an interrupt be posted to the CPU.
Definition: malta_cchip.cc:93
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: malta_cchip.cc:74
uint64_t Tick
Tick count type.
Definition: types.hh:63
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: malta_cchip.cc:67
Malta CChip CSR Emulation.
Definition: malta_cchip.hh:47
MaltaCChip(Params *p)
Initialize the Malta CChip by setting all of the device register to 0.
Definition: malta_cchip.cc:56
static const int Max_CPUs
Max number of CPUs in a Malta.
Definition: malta.hh:60
std::vector< ThreadContext * > threadContexts
Definition: system.hh:190
Port Object Declaration.
void clearITI(uint64_t itintr)
clear a timer interrupt previously posted to the CPU.
Definition: malta_cchip.cc:87
System * sys
Definition: io_device.hh:105
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:255
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: malta_cchip.cc:137
Top level class for Malta Chipset emulation.
Definition: malta.hh:56
List of Tsunami CSRs.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: malta_cchip.cc:142
Declaration of the Packet class.
std::ostream CheckpointOut
Definition: serialize.hh:68
Tick pioDelay
Delay that the device experinces on an access.
Definition: io_device.hh:163
void postIntr(uint32_t interrupt)
post an interrupt to the CPU.
Definition: malta_cchip.cc:106
#define warn(...)
Definition: logging.hh:212
MaltaCChip * cchip
Pointer to the Malta CChip.
Definition: malta.hh:72
void clear(int cpu_id, int int_num, int index)
Definition: intr_control.cc:59
Bitfield< 0 > p
void postRTC()
post an RTC interrupt to the CPU
Definition: malta_cchip.cc:100
Declaration of top level class for the Malta chipset.

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