gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tsunami_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_TSUNAMI_IO_HH__
38 #define __DEV_TSUNAMI_IO_HH__
39 
40 #include "dev/alpha/tsunami.hh"
42 #include "dev/intel_8254_timer.hh"
43 #include "dev/io_device.hh"
44 #include "dev/mc146818.hh"
45 #include "params/TsunamiIO.hh"
46 #include "sim/eventq.hh"
47 
52 class TsunamiIO : public BasicPioDevice
53 {
54 
55  protected:
56 
57  class RTC : public MC146818
58  {
59  public:
61  RTC(const std::string &n, const TsunamiIOParams *p);
62 
63  protected:
64  void handleEvent()
65  {
66  //Actually interrupt the processor here
67  tsunami->cchip->postRTC();
68  }
69  };
70 
72  uint8_t mask1;
73 
75  uint8_t mask2;
76 
78  uint8_t mode1;
79 
81  uint8_t mode2;
82 
84  uint8_t picr; //Raw PIC interrput register
85 
88 
91 
94 
96 
97  uint8_t rtcAddr;
98 
103  uint16_t timerData;
104 
105  public:
110  Tick frequency() const;
111 
112  public:
113  typedef TsunamiIOParams Params;
118  TsunamiIO(const Params *p);
119 
120  const Params *
121  params() const
122  {
123  return dynamic_cast<const Params *>(_params);
124  }
125 
126  Tick read(PacketPtr pkt) override;
127  Tick write(PacketPtr pkt) override;
128 
133  void postPIC(uint8_t bitvector);
134 
139  void clearPIC(uint8_t bitvector);
140 
141  void serialize(CheckpointOut &cp) const override;
142  void unserialize(CheckpointIn &cp) override;
143 
147  void startup() override;
148 
149 };
150 
151 #endif // __DEV_TSUNAMI_IO_HH__
Emulation of the Tsunami CChip CSRs.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: tsunami_io.cc:255
Real-Time Clock (MC146818)
Definition: mc146818.hh:41
void postRTC()
post an RTC interrupt to the CPU
Programmable Interval Timer (Intel 8254)
Top level class for Tsunami Chipset emulation.
Definition: tsunami.hh:56
uint8_t mode1
Mode of PIC1.
Definition: tsunami_io.hh:78
void clearPIC(uint8_t bitvector)
Clear a posted interrupt.
Definition: tsunami_io.cc:244
void startup() override
Start running.
Definition: tsunami_io.cc:289
Tsunami * tsunami
Definition: tsunami_io.hh:60
TsunamiCChip * cchip
Pointer to the Tsunami CChip.
Definition: tsunami.hh:72
Bitfield< 31 > n
Definition: miscregs.hh:1636
uint16_t timerData
The interval is set via two writes to the PIT.
Definition: tsunami_io.hh:103
bool picInterrupting
Is the pic interrupting right now or not.
Definition: tsunami_io.hh:87
const Params * params() const
Definition: tsunami_io.hh:121
uint8_t rtcAddr
Definition: tsunami_io.hh:97
uint64_t Tick
Tick count type.
Definition: types.hh:63
Declaration of top level class for the Tsunami chipset.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: tsunami_io.cc:272
RTC(const std::string &n, const TsunamiIOParams *p)
Definition: tsunami_io.cc:66
Tsunami * tsunami
A pointer to the Tsunami device which be belong to.
Definition: tsunami_io.hh:90
Tick frequency() const
Return the freqency of the RTC.
Definition: tsunami_io.cc:85
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: tsunami_io.cc:154
TsunamiIO(const Params *p)
Initialize all the data for devices supported by Tsunami I/O.
Definition: tsunami_io.cc:72
TsunamiIOParams Params
Definition: tsunami_io.hh:113
uint8_t mode2
Mode of PIC2.
Definition: tsunami_io.hh:81
uint8_t mask2
Mask of the PIC2.
Definition: tsunami_io.hh:75
std::ostream CheckpointOut
Definition: serialize.hh:67
Intel8254Timer pitimer
Intel 8253 Periodic Interval Timer.
Definition: tsunami_io.hh:93
uint8_t picr
Raw PIC interrupt register before masking.
Definition: tsunami_io.hh:84
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:107
Tsunami I/O device is a catch all for all the south bridge stuff we care to implement.
Definition: tsunami_io.hh:52
uint8_t mask1
Mask of the PIC1.
Definition: tsunami_io.hh:72
void postPIC(uint8_t bitvector)
Post an PIC interrupt to the CPU via the CChip.
Definition: tsunami_io.cc:233
void handleEvent()
Definition: tsunami_io.hh:64
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: tsunami_io.cc:91
Bitfield< 0 > p

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