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

Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17