gem5 v24.0.0.0
Loading...
Searching...
No Matches
malta_io.hh
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
33#ifndef __DEV_MALTA_IO_HH__
34#define __DEV_MALTA_IO_HH__
35
36#include "dev/mips/malta.hh"
39#include "dev/io_device.hh"
40#include "dev/mc146818.hh"
41#include "params/MaltaIO.hh"
42#include "sim/eventq.hh"
43
44namespace gem5
45{
46
51class MaltaIO : public BasicPioDevice
52{
53 protected:
54
55 class RTC : public MC146818
56 {
57 public:
59 RTC(const std::string &name, const MaltaIOParams &p);
60
61 protected:
63 {
64 //Actually interrupt the processor here
66 }
67 };
68
70 uint8_t mask1;
71
73 uint8_t mask2;
74
76 uint8_t mode1;
77
79 uint8_t mode2;
80
82 uint8_t picr; //Raw PIC interrput register
83
86
89
92
94
99 uint16_t timerData;
100
101 public:
106 Tick frequency() const;
107
109
114 MaltaIO(const Params &p);
115
116 Tick read(PacketPtr pkt) override;
117 Tick write(PacketPtr pkt) override;
118
119
121 void postIntr(uint8_t interrupt);
122
124 void clearIntr(uint8_t interrupt);
125
126 void serialize(CheckpointOut &cp) const override;
127 void unserialize(CheckpointIn &cp) override;
128
132 void startup() override;
133
134};
135
136} // namespace gem5
137
138#endif // __DEV_MALTA_IO_HH__
Programmable Interval Timer (Intel 8254)
Real-Time Clock (MC146818)
Definition mc146818.hh:42
const std::string & name() const
Definition mc146818.hh:88
void postRTC()
post an RTC interrupt to the CPU
RTC(const std::string &name, const MaltaIOParams &p)
Definition malta_io.cc:57
Malta I/O device is a catch all for all the south bridge stuff we care to implement.
Definition malta_io.hh:52
bool picInterrupting
Is the pic interrupting right now or not.
Definition malta_io.hh:85
void postIntr(uint8_t interrupt)
Post an Interrupt to the CPU.
Definition malta_io.cc:96
void clearIntr(uint8_t interrupt)
Clear an Interrupt to the CPU.
Definition malta_io.cc:103
uint8_t mode2
Mode of PIC2.
Definition malta_io.hh:79
uint8_t picr
Raw PIC interrupt register before masking.
Definition malta_io.hh:82
uint8_t mask2
Mask of the PIC2.
Definition malta_io.hh:73
Tick frequency() const
Return the freqency of the RTC.
Definition malta_io.cc:76
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition malta_io.cc:82
void startup() override
Start running.
Definition malta_io.cc:142
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition malta_io.cc:89
PARAMS(MaltaIO)
Malta * malta
A pointer to the Malta device which be belong to.
Definition malta_io.hh:88
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition malta_io.cc:126
Intel8254Timer pitimer
Intel 8253 Periodic Interval Timer.
Definition malta_io.hh:91
uint16_t timerData
The interval is set via two writes to the PIT.
Definition malta_io.hh:99
uint8_t mode1
Mode of PIC1.
Definition malta_io.hh:76
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition malta_io.cc:110
uint8_t mask1
Mask of the PIC1.
Definition malta_io.hh:70
MaltaIO(const Params &p)
Initialize all the data for devices supported by Malta I/O.
Definition malta_io.cc:63
Top level class for Malta Chipset emulation.
Definition malta.hh:55
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
PioDeviceParams Params
Definition io_device.hh:134
Declaration of top level class for the Malta chipset.
Emulation of the Malta CChip CSRs.
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

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