gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  * Authors: Ali Saidi
29  * Andrew Schultz
30  * Miguel Serrano
31  */
32 
37 #ifndef __DEV_MALTA_IO_HH__
38 #define __DEV_MALTA_IO_HH__
39 
40 #include "dev/mips/malta.hh"
41 #include "dev/mips/malta_cchip.hh"
42 #include "dev/intel_8254_timer.hh"
43 #include "dev/io_device.hh"
44 #include "dev/mc146818.hh"
45 #include "params/MaltaIO.hh"
46 #include "sim/eventq.hh"
47 
52 class MaltaIO : public BasicPioDevice
53 {
54  protected:
55 
56  class RTC : public MC146818
57  {
58  public:
60  RTC(const std::string &name, const MaltaIOParams *p);
61 
62  protected:
63  void handleEvent()
64  {
65  //Actually interrupt the processor here
66  malta->cchip->postRTC();
67  }
68  };
69 
71  uint8_t mask1;
72 
74  uint8_t mask2;
75 
77  uint8_t mode1;
78 
80  uint8_t mode2;
81 
83  uint8_t picr; //Raw PIC interrput register
84 
87 
90 
93 
95 
100  uint16_t timerData;
101 
102  public:
107  Tick frequency() const;
108 
109  typedef MaltaIOParams Params;
110 
111  const Params *
112  params() const
113  {
114  return dynamic_cast<const Params *>(_params);
115  }
116 
121  MaltaIO(const Params *p);
122 
123  Tick read(PacketPtr pkt) override;
124  Tick write(PacketPtr pkt) override;
125 
126 
128  void postIntr(uint8_t interrupt);
129 
131  void clearIntr(uint8_t interrupt);
132 
133  void serialize(CheckpointOut &cp) const override;
134  void unserialize(CheckpointIn &cp) override;
135 
139  void startup() override;
140 
141 };
142 
143 #endif // __DEV_MALTA_IO_HH__
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: malta_io.cc:115
MaltaIO(const Params *p)
Initialize all the data for devices supported by Malta I/O.
Definition: malta_io.cc:68
Emulation of the Malta CChip CSRs.
Real-Time Clock (MC146818)
Definition: mc146818.hh:41
MaltaIOParams Params
Definition: malta_io.hh:109
Programmable Interval Timer (Intel 8254)
PioDeviceParams Params
Definition: io_device.hh:116
Malta * malta
Definition: malta_io.hh:59
Tick frequency() const
Return the freqency of the RTC.
Definition: malta_io.cc:81
RTC(const std::string &name, const MaltaIOParams *p)
Definition: malta_io.cc:62
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: malta_io.cc:87
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: malta_io.cc:94
uint8_t mask1
Mask of the PIC1.
Definition: malta_io.hh:71
const std::string & name() const
Definition: mc146818.hh:88
void postIntr(uint8_t interrupt)
Post an Interrupt to the CPU.
Definition: malta_io.cc:101
uint16_t timerData
The interval is set via two writes to the PIT.
Definition: malta_io.hh:100
uint64_t Tick
Tick count type.
Definition: types.hh:63
void clearIntr(uint8_t interrupt)
Clear an Interrupt to the CPU.
Definition: malta_io.cc:108
void startup() override
Start running.
Definition: malta_io.cc:147
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
Intel8254Timer pitimer
Intel 8253 Periodic Interval Timer.
Definition: malta_io.hh:92
RTC rtc
Definition: malta_io.hh:94
Top level class for Malta Chipset emulation.
Definition: malta.hh:56
cbk_int func interrupt
Definition: gpu_nomali.cc:94
Malta * malta
A pointer to the Malta device which be belong to.
Definition: malta_io.hh:89
void handleEvent()
Definition: malta_io.hh:63
std::ostream CheckpointOut
Definition: serialize.hh:67
uint8_t mode1
Mode of PIC1.
Definition: malta_io.hh:77
uint8_t mode2
Mode of PIC2.
Definition: malta_io.hh:80
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:107
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: malta_io.cc:131
MaltaCChip * cchip
Pointer to the Malta CChip.
Definition: malta.hh:72
Malta I/O device is a catch all for all the south bridge stuff we care to implement.
Definition: malta_io.hh:52
uint8_t mask2
Mask of the PIC2.
Definition: malta_io.hh:74
Bitfield< 0 > p
void postRTC()
post an RTC interrupt to the CPU
Definition: malta_cchip.cc:454
bool picInterrupting
Is the pic interrupting right now or not.
Definition: malta_io.hh:86
const Params * params() const
Definition: malta_io.hh:112
Declaration of top level class for the Malta chipset.
uint8_t picr
Raw PIC interrupt register before masking.
Definition: malta_io.hh:83

Generated on Fri Jun 9 2017 13:03:46 for gem5 by doxygen 1.8.6