gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
34
35#include <deque>
36#include <string>
37#include <vector>
38
39#include "base/trace.hh"
40#include "cpu/base.hh"
41#include "cpu/thread_context.hh"
42#include "debug/Malta.hh"
43#include "dev/mips/malta.hh"
44#include "dev/mips/maltareg.h"
45#include "mem/packet.hh"
46#include "mem/packet_access.hh"
47#include "mem/port.hh"
48#include "params/MaltaCChip.hh"
49#include "sim/system.hh"
50
51namespace gem5
52{
53
55 : BasicPioDevice(p, 0xfffffff), malta(p.malta)
56{
57 warn("MaltaCCHIP::MaltaCChip() not implemented.");
58
59 //Put back pointer in malta
60 malta->cchip = this;
61
62}
63
64Tick
66{
67 panic("MaltaCCHIP::read() not implemented.");
68 return pioDelay;
69}
70
71Tick
73{
74 panic("MaltaCCHIP::write() not implemented.");
75 return pioDelay;
76}
77
78void
79MaltaCChip::clearIPI(uint64_t ipintr)
80{
81 panic("MaltaCCHIP::clear() not implemented.");
82}
83
84void
85MaltaCChip::clearITI(uint64_t itintr)
86{
87 panic("MaltaCCHIP::clearITI() not implemented.");
88}
89
90void
91MaltaCChip::reqIPI(uint64_t ipreq)
92{
93 panic("MaltaCCHIP::reqIPI() not implemented.");
94}
95
96
97void
99{
100 panic("MaltaCCHIP::postRTC() not implemented.");
101}
102
103void
104MaltaCChip::postIntr(uint32_t interrupt)
105{
106 uint64_t size = sys->threads.size();
107 assert(size <= Malta::Max_CPUs);
108
109 for (int i=0; i < size; i++) {
110 //Note: Malta does not use index, but this was added to use the
111 //pre-existing implementation
112 auto tc = sys->threads[i];
113 tc->getCpuPtr()->postInterrupt(tc->threadId(), interrupt, 0);
114 DPRINTF(Malta, "posting interrupt to cpu %d, interrupt %d\n",
115 i, interrupt);
116 }
117}
118
119void
120MaltaCChip::clearIntr(uint32_t interrupt)
121{
122 uint64_t size = sys->threads.size();
123 assert(size <= Malta::Max_CPUs);
124
125 for (int i=0; i < size; i++) {
126 //Note: Malta does not use index, but this was added to use the
127 //pre-existing implementation
128 auto tc = sys->threads[i];
129 tc->getCpuPtr()->clearInterrupt(tc->threadId(), interrupt, 0);
130 DPRINTF(Malta, "clearing interrupt to cpu %d, interrupt %d\n",
131 i, interrupt);
132 }
133}
134
135
136void
140
141void
145
146} // namespace gem5
#define DPRINTF(x,...)
Definition trace.hh:210
Tick pioDelay
Delay that the device experinces on an access.
Definition io_device.hh:157
MaltaCChip(const Params &p)
Initialize the Malta CChip by setting all of the device register to 0.
void clearIntr(uint32_t interrupt)
clear an interrupt previously posted to the CPU.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
MaltaCChipParams Params
The dims are device interrupt mask registers.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void reqIPI(uint64_t ipreq)
request an interrupt be posted to the CPU.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
void clearIPI(uint64_t ipintr)
post an ipi interrupt to the CPU.
void clearITI(uint64_t itintr)
clear a timer interrupt previously posted to the CPU.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
void postIntr(uint32_t interrupt)
post an interrupt to the CPU.
void postRTC()
post an RTC interrupt to the CPU
Malta * malta
pointer to the malta object.
Top level class for Malta Chipset emulation.
Definition malta.hh:55
static const int Max_CPUs
Max number of CPUs in a Malta.
Definition malta.hh:58
MaltaCChip * cchip
Pointer to the Malta CChip.
Definition malta.hh:67
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
int size() const
Definition system.hh:210
Threads threads
Definition system.hh:310
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
#define warn(...)
Definition logging.hh:256
Declaration of top level class for the Malta chipset.
Emulation of the Malta CChip CSRs.
List of Tsunami CSRs.
Port Object Declaration.
Bitfield< 7 > i
Definition misc_types.hh:67
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::ostream CheckpointOut
Definition serialize.hh:66
uint64_t Tick
Tick count type.
Definition types.hh:58
Declaration of the Packet class.

Generated on Tue Jun 18 2024 16:24:03 for gem5 by doxygen 1.11.0