gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
40namespace gem5
41{
42
43const int MaxNiagaraProcs = 32;
44// IOB Managment Addresses
45const Addr IntManAddr = 0x0000;
46const Addr IntManSize = 0x0020;
47const Addr IntCtlAddr = 0x0400;
48const Addr IntCtlSize = 0x0020;
49const Addr JIntVecAddr = 0x0A00;
50const Addr IntVecDisAddr = 0x0800;
51const Addr IntVecDisSize = 0x0100;
52
53
54// IOB Control Addresses
55const Addr JIntData0Addr = 0x0400;
56const Addr JIntData1Addr = 0x0500;
57const Addr JIntDataA0Addr = 0x0600;
58const Addr JIntDataA1Addr = 0x0700;
59const Addr JIntBusyAddr = 0x0900;
60const Addr JIntBusySize = 0x0100;
61const Addr JIntABusyAddr = 0x0B00;
62
63
64// IOB Masks
65const uint64_t IntManMask = 0x01F3F;
66const uint64_t IntCtlMask = 0x00006;
67const uint64_t JIntVecMask = 0x0003F;
68const uint64_t IntVecDis = 0x31F3F;
69const uint64_t JIntBusyMask = 0x0003F;
70
71
72class Iob : public PioDevice
73{
74 private:
80
82 {
84 Error = 1,
85 SSI = 2,
88 };
89
90 struct IntMan
91 {
92 int cpu;
93 int vector;
94 };
95
96 struct IntCtl
97 {
98 bool mask;
99 bool pend;
100 };
101
102 struct IntBusy
103 {
104 bool busy;
106 };
107
115
118 uint64_t jIntVec;
122
123 void writeIob(PacketPtr pkt);
124 void writeJBus(PacketPtr pkt);
125 void readIob(PacketPtr pkt);
126 void readJBus(PacketPtr pkt);
127
128 public:
130 Iob(const Params &p);
131
132 Tick read(PacketPtr pkt) override;
133 Tick write(PacketPtr pkt) override;
134 void generateIpi(Type type, int cpu_id, int vector);
136 bool receiveJBusInterrupt(int cpu_id, int source, uint64_t d0,
137 uint64_t d1);
138
139 AddrRangeList getAddrRanges() const override;
140
141 void serialize(CheckpointOut &cp) const override;
142 void unserialize(CheckpointIn &cp) override;
143};
144
145} // namespace gem5
146
147#endif //__DEV_SPARC_IOB_HH__
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition iob.cc:370
IntCtl intCtl[NumDeviceIds]
Definition iob.hh:117
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
Definition iob.cc:339
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition iob.cc:76
Addr iobJBusAddr
Definition iob.hh:77
bool receiveJBusInterrupt(int cpu_id, int source, uint64_t d0, uint64_t d1)
Definition iob.cc:317
void readJBus(PacketPtr pkt)
Definition iob.cc:120
uint64_t jBusData1[MaxNiagaraProcs]
Definition iob.hh:120
Iob(const Params &p)
Definition iob.cc:56
void writeIob(PacketPtr pkt)
Definition iob.cc:185
IntMan intMan[NumDeviceIds]
Definition iob.hh:116
Addr iobJBusSize
Definition iob.hh:78
Addr iobManAddr
Definition iob.hh:75
void readIob(PacketPtr pkt)
Definition iob.cc:91
Tick pioDelay
Definition iob.hh:79
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition iob.cc:349
IntBusy jIntBusy[MaxNiagaraProcs]
Definition iob.hh:121
@ Reset
Definition iob.hh:111
@ Resume
Definition iob.hh:113
@ Idle
Definition iob.hh:112
@ Interrupt
Definition iob.hh:110
Addr iobManSize
Definition iob.hh:76
DeviceId
Definition iob.hh:82
@ SSI
Definition iob.hh:85
@ Interal
Definition iob.hh:83
@ Error
Definition iob.hh:84
@ Reserved
Definition iob.hh:86
@ NumDeviceIds
Definition iob.hh:87
uint64_t jBusData0[MaxNiagaraProcs]
Definition iob.hh:119
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition iob.cc:170
void generateIpi(Type type, int cpu_id, int vector)
Definition iob.cc:279
uint64_t jIntVec
Definition iob.hh:118
void receiveDeviceInterrupt(DeviceId devid)
Definition iob.cc:263
void writeJBus(PacketPtr pkt)
Definition iob.cc:236
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
This device is the base class which all devices senstive to an address range inherit from.
Definition io_device.hh:103
PioDeviceParams Params
Definition io_device.hh:134
Bitfield< 0 > p
Bitfield< 20, 16 > d1
Definition types.hh:66
Bitfield< 15, 6 > d0
Definition types.hh:65
Bitfield< 15, 8 > vector
Definition intmessage.hh:48
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
const Addr IntVecDisSize
Definition iob.hh:51
const uint64_t IntCtlMask
Definition iob.hh:66
const Addr JIntDataA1Addr
Definition iob.hh:58
const Addr IntManSize
Definition iob.hh:46
const Addr JIntBusyAddr
Definition iob.hh:59
const Addr JIntData1Addr
Definition iob.hh:56
std::ostream CheckpointOut
Definition serialize.hh:66
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
const Addr IntCtlSize
Definition iob.hh:48
const Addr IntCtlAddr
Definition iob.hh:47
uint64_t Tick
Tick count type.
Definition types.hh:58
const Addr JIntVecAddr
Definition iob.hh:49
const Addr JIntABusyAddr
Definition iob.hh:61
const uint64_t JIntVecMask
Definition iob.hh:67
const uint64_t IntManMask
Definition iob.hh:65
const uint64_t IntVecDis
Definition iob.hh:68
const Addr JIntData0Addr
Definition iob.hh:55
const int MaxNiagaraProcs
Definition iob.hh:43
const Addr IntVecDisAddr
Definition iob.hh:50
const Addr JIntBusySize
Definition iob.hh:60
const uint64_t JIntBusyMask
Definition iob.hh:69
const Addr IntManAddr
Definition iob.hh:45
const Addr JIntDataA0Addr
Definition iob.hh:57

Generated on Tue Jun 18 2024 16:24:03 for gem5 by doxygen 1.11.0