gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
i82094aa.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 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: Gabe Black
29  */
30 
31 #ifndef __DEV_X86_I82094AA_HH__
32 #define __DEV_X86_I82094AA_HH__
33 
34 #include <map>
35 
36 #include "base/bitunion.hh"
37 #include "dev/x86/intdev.hh"
38 #include "dev/intpin.hh"
39 #include "dev/io_device.hh"
40 #include "params/I82094AA.hh"
41 
42 namespace X86ISA
43 {
44 
45 class I8259;
46 class Interrupts;
47 
48 class I82094AA : public BasicPioDevice
49 {
50  public:
51  BitUnion64(RedirTableEntry)
52  Bitfield<63, 32> topDW;
53  Bitfield<55, 32> topReserved;
54  Bitfield<31, 0> bottomDW;
55  Bitfield<31, 17> bottomReserved;
56  Bitfield<63, 56> dest;
57  Bitfield<16> mask;
58  Bitfield<15> trigger;
59  Bitfield<14> remoteIRR;
60  Bitfield<13> polarity;
61  Bitfield<12> deliveryStatus;
62  Bitfield<11> destMode;
63  Bitfield<10, 8> deliveryMode;
64  Bitfield<7, 0> vector;
65  EndBitUnion(RedirTableEntry)
66 
67  protected:
68  I8259 * extIntPic;
69 
70  uint8_t regSel;
71  uint8_t initialApicId;
72  uint8_t id;
73  uint8_t arbId;
74 
76 
77  static const uint8_t TableSize = 24;
78  // This implementation is based on version 0x11, but 0x14 avoids having
79  // to deal with the arbitration and APIC bus guck.
80  static const uint8_t APICVersion = 0x14;
81 
82  RedirTableEntry redirTable[TableSize];
83  bool pinStates[TableSize];
84 
86 
88 
89  public:
90  typedef I82094AAParams Params;
91 
92  const Params *
93  params() const
94  {
95  return dynamic_cast<const Params *>(_params);
96  }
97 
98  I82094AA(Params *p);
99 
100  void init() override;
101 
102  Tick read(PacketPtr pkt) override;
103  Tick write(PacketPtr pkt) override;
104 
105  void writeReg(uint8_t offset, uint32_t value);
106  uint32_t readReg(uint8_t offset);
107 
108  Port &getPort(const std::string &if_name,
109  PortID idx=InvalidPortID) override;
110 
111  bool recvResponse(PacketPtr pkt);
112 
113  void signalInterrupt(int line);
114  void raiseInterruptPin(int number);
115  void lowerInterruptPin(int number);
116 
117  void serialize(CheckpointOut &cp) const override;
118  void unserialize(CheckpointIn &cp) override;
119 };
120 
121 } // namespace X86ISA
122 
123 #endif //__DEV_X86_SOUTH_BRIDGE_I8254_HH__
Bitfield< 15 > trigger
Definition: i82094aa.hh:58
void signalInterrupt(int line)
Definition: i82094aa.cc:181
offset
Definition: misc.hh:1026
Ports are used to interface objects to each other.
Definition: port.hh:60
bool pinStates[TableSize]
Definition: i82094aa.hh:83
Bitfield< 31, 17 > bottomReserved
Definition: i82094aa.hh:55
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: i82094aa.cc:82
const PortID InvalidPortID
Definition: types.hh:238
void raiseInterruptPin(int number)
Definition: i82094aa.cc:253
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: i82094aa.cc:70
I82094AA(Params *p)
Definition: i82094aa.cc:44
EndBitUnion(TriggerIntMessage) namespace DeliveryMode
Definition: intmessage.hh:51
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: i82094aa.cc:112
PioDeviceParams Params
Definition: io_device.hh:134
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:586
Bitfield< 13 > polarity
Definition: i82094aa.hh:60
Definition: cprintf.cc:42
static const uint8_t TableSize
Definition: i82094aa.hh:77
std::vector< IntSinkPin< I82094AA > * > inputs
Definition: i82094aa.hh:85
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: i82094aa.cc:269
Bitfield< 10, 8 > deliveryMode
Definition: i82094aa.hh:63
uint32_t readReg(uint8_t offset)
Definition: i82094aa.cc:156
uint64_t Tick
Tick count type.
Definition: types.hh:63
BitUnion64(RedirTableEntry) Bitfield< 63
uint8_t arbId
Definition: i82094aa.hh:73
bool recvResponse(PacketPtr pkt)
Bitfield< 16 > mask
Definition: i82094aa.hh:57
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: i82094aa.cc:93
void lowerInterruptPin(int number)
Definition: i82094aa.cc:262
Bitfield< 12 > deliveryStatus
Definition: i82094aa.hh:61
const Params * params() const
Definition: i82094aa.hh:93
Bitfield< 14 > remoteIRR
Definition: i82094aa.hh:59
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:255
void writeReg(uint8_t offset, uint32_t value)
Definition: i82094aa.cc:131
uint8_t initialApicId
Definition: i82094aa.hh:71
Bitfield< 31, 0 > bottomDW
Definition: i82094aa.hh:54
EndBitUnion(RedirTableEntry) protected uint8_t regSel
Definition: i82094aa.hh:65
Bitfield< 55, 32 > topReserved
Definition: i82094aa.hh:53
Bitfield< 7, 0 > vector
Definition: i82094aa.hh:64
std::ostream CheckpointOut
Definition: serialize.hh:68
This is exposed globally, independent of the ISA.
Definition: acpi.hh:57
IntMasterPort< I82094AA > intMasterPort
Definition: i82094aa.hh:87
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: i82094aa.cc:282
uint64_t lowestPriorityOffset
Definition: i82094aa.hh:75
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:110
RedirTableEntry redirTable[TableSize]
Definition: i82094aa.hh:82
static const uint8_t APICVersion
Definition: i82094aa.hh:80
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:237
Bitfield< 0 > p
Definition: pagetable.hh:152
Bitfield< 11 > destMode
Definition: i82094aa.hh:62
Bitfield< 63, 56 > dest
Definition: i82094aa.hh:56

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