gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
iob.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006 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  */
30 
36 #ifndef __DEV_SPARC_IOB_HH__
37 #define __DEV_SPARC_IOB_HH__
38 
39 #include "dev/io_device.hh"
40 #include "params/Iob.hh"
41 
42 class IntrControl;
43 
44 const int MaxNiagaraProcs = 32;
45 // IOB Managment Addresses
46 const Addr IntManAddr = 0x0000;
47 const Addr IntManSize = 0x0020;
48 const Addr IntCtlAddr = 0x0400;
49 const Addr IntCtlSize = 0x0020;
50 const Addr JIntVecAddr = 0x0A00;
51 const Addr IntVecDisAddr = 0x0800;
52 const Addr IntVecDisSize = 0x0100;
53 
54 
55 // IOB Control Addresses
56 const Addr JIntData0Addr = 0x0400;
57 const Addr JIntData1Addr = 0x0500;
58 const Addr JIntDataA0Addr = 0x0600;
59 const Addr JIntDataA1Addr = 0x0700;
60 const Addr JIntBusyAddr = 0x0900;
61 const Addr JIntBusySize = 0x0100;
62 const Addr JIntABusyAddr = 0x0B00;
63 
64 
65 // IOB Masks
66 const uint64_t IntManMask = 0x01F3F;
67 const uint64_t IntCtlMask = 0x00006;
68 const uint64_t JIntVecMask = 0x0003F;
69 const uint64_t IntVecDis = 0x31F3F;
70 const uint64_t JIntBusyMask = 0x0003F;
71 
72 
73 class Iob : public PioDevice
74 {
75  private:
82 
83  enum DeviceId {
84  Interal = 0,
85  Error = 1,
86  SSI = 2,
87  Reserved = 3,
89  };
90 
91  struct IntMan {
92  int cpu;
93  int vector;
94  };
95 
96  struct IntCtl {
97  bool mask;
98  bool pend;
99  };
100 
101  struct IntBusy {
102  bool busy;
103  int source;
104  };
105 
106  enum Type {
111  };
112 
115  uint64_t jIntVec;
119 
120  void writeIob(PacketPtr pkt);
121  void writeJBus(PacketPtr pkt);
122  void readIob(PacketPtr pkt);
123  void readJBus(PacketPtr pkt);
124 
125  public:
126  typedef IobParams Params;
127  Iob(const Params *p);
128 
129  const Params *
130  params() const
131  {
132  return dynamic_cast<const Params *>(_params);
133  }
134 
135  Tick read(PacketPtr pkt) override;
136  Tick write(PacketPtr pkt) override;
137  void generateIpi(Type type, int cpu_id, int vector);
138  void receiveDeviceInterrupt(DeviceId devid);
139  bool receiveJBusInterrupt(int cpu_id, int source, uint64_t d0,
140  uint64_t d1);
141 
142  AddrRangeList getAddrRanges() const override;
143 
144  void serialize(CheckpointOut &cp) const override;
145  void unserialize(CheckpointIn &cp) override;
146 };
147 
148 #endif //__DEV_SPARC_IOB_HH__
149 
Addr iobManAddr
Definition: iob.hh:77
Addr iobManSize
Definition: iob.hh:78
const uint64_t IntCtlMask
Definition: iob.hh:67
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
Definition: iob.cc:330
void receiveDeviceInterrupt(DeviceId devid)
Definition: iob.cc:263
bool mask
Definition: iob.hh:97
bool busy
Definition: iob.hh:102
const Addr JIntVecAddr
Definition: iob.hh:50
const uint64_t IntVecDis
Definition: iob.hh:69
PioDeviceParams Params
Definition: io_device.hh:116
Type
Definition: iob.hh:106
IntMan intMan[NumDeviceIds]
Definition: iob.hh:113
const Addr JIntDataA1Addr
Definition: iob.hh:59
void generateIpi(Type type, int cpu_id, int vector)
Definition: iob.cc:277
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: iob.cc:170
void writeJBus(PacketPtr pkt)
Definition: iob.cc:236
const Addr IntCtlSize
Definition: iob.hh:49
Iob(const Params *p)
Definition: iob.cc:55
uint64_t jIntVec
Definition: iob.hh:115
uint64_t Tick
Tick count type.
Definition: types.hh:63
void writeIob(PacketPtr pkt)
Definition: iob.cc:185
Definition: iob.hh:73
Tick pioDelay
Definition: iob.hh:81
const uint64_t JIntBusyMask
Definition: iob.hh:70
int vector
Definition: iob.hh:93
DeviceId
Definition: iob.hh:83
const Addr JIntBusySize
Definition: iob.hh:61
bool receiveJBusInterrupt(int cpu_id, int source, uint64_t d0, uint64_t d1)
Definition: iob.cc:310
uint64_t jBusData0[MaxNiagaraProcs]
Definition: iob.hh:116
This device is the base class which all devices senstive to an address range inherit from...
Definition: io_device.hh:84
const Addr JIntBusyAddr
Definition: iob.hh:60
const Addr JIntABusyAddr
Definition: iob.hh:62
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
bool pend
Definition: iob.hh:98
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
Bitfield< 15, 8 > vector
Definition: intmessage.hh:45
void readIob(PacketPtr pkt)
Definition: iob.cc:91
Addr iobJBusAddr
Definition: iob.hh:79
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: iob.cc:340
void readJBus(PacketPtr pkt)
Definition: iob.cc:120
IobParams Params
Definition: iob.hh:126
const Addr IntVecDisAddr
Definition: iob.hh:51
const uint64_t IntManMask
Definition: iob.hh:66
type
Definition: misc.hh:728
const Addr IntVecDisSize
Definition: iob.hh:52
std::ostream CheckpointOut
Definition: serialize.hh:67
const Params * params() const
Definition: iob.hh:130
const Addr IntCtlAddr
Definition: iob.hh:48
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:107
IntBusy jIntBusy[MaxNiagaraProcs]
Definition: iob.hh:118
const Addr JIntData0Addr
Definition: iob.hh:56
IntrControl * ic
Definition: iob.hh:76
const uint64_t JIntVecMask
Definition: iob.hh:68
int cpu
Definition: iob.hh:92
const int MaxNiagaraProcs
Definition: iob.hh:44
Addr iobJBusSize
Definition: iob.hh:80
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: iob.cc:76
const Addr JIntDataA0Addr
Definition: iob.hh:58
uint64_t jBusData1[MaxNiagaraProcs]
Definition: iob.hh:117
Bitfield< 0 > p
IntCtl intCtl[NumDeviceIds]
Definition: iob.hh:114
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: iob.cc:361
int source
Definition: iob.hh:103
const Addr JIntData1Addr
Definition: iob.hh:57
Definition: iob.hh:86
const Addr IntManAddr
Definition: iob.hh:46
const Addr IntManSize
Definition: iob.hh:47

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