2 * Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 // **PLEASE NOTE!** When adding objects to this file you must also add a line
34 // in the src/mem/ruby/SConscript file. Otherwise the external object's .hh
35 // file will not be copied to the protocol directory and you will encounter a
36 // undefined declaration error.
39 external_type(MessageBuffer, buffer="yes", inport="yes", outport="yes");
40 external_type(OutPort, primitive="yes");
41 external_type(Scalar, primitive="yes");
43 structure(InPort, external = "yes", primitive="yes") {
44 bool isReady(Tick current_time);
45 Tick dequeue(Tick current_time);
46 void recycle(Tick current_time, Tick recycle_latency);
48 bool isStallMapEmpty();
49 int getStallMapSize();
52 external_type(NodeID, default="0", primitive="yes");
53 external_type(MachineID);
55 structure (Set, external = "yes", non_obj="yes") {
65 bool isElement(NodeID);
68 bool intersectionIsEmpty(Set);
69 NodeID smallestElement();
72 structure (NetDest, external = "yes", non_obj="yes") {
74 void setSize(int, int);
78 void addNetDest(NetDest);
79 void setNetDest(MachineType, Set);
81 void remove(MachineID);
83 void removeNetDest(NetDest);
85 void broadcast(MachineType);
90 bool isElement(NodeID);
91 bool isElement(MachineID);
93 bool isSuperset(NetDest);
95 bool intersectionIsEmpty(Set);
96 bool intersectionIsEmpty(NetDest);
97 MachineID smallestElement(MachineType);
100 structure (Sequencer, external = "yes") {
101 void readCallback(Addr, DataBlock);
102 void readCallback(Addr, DataBlock, bool);
103 void readCallback(Addr, DataBlock, bool, MachineType);
104 void readCallback(Addr, DataBlock, bool, MachineType,
105 Cycles, Cycles, Cycles);
107 void writeCallback(Addr, DataBlock);
108 void writeCallback(Addr, DataBlock, bool);
109 void writeCallback(Addr, DataBlock, bool, MachineType);
110 void writeCallback(Addr, DataBlock, bool, MachineType,
111 Cycles, Cycles, Cycles);
113 void checkCoherence(Addr);
114 void evictionCallback(Addr);
115 void recordRequestType(SequencerRequestType);
116 bool checkResourceAvailable(CacheResourceType, Addr);
117 void invalidateSC(Addr);
120 structure(RubyRequest, desc="...", interface="Message", external="yes") {
121 Addr LineAddress, desc="Line address for this request";
122 Addr PhysicalAddress, desc="Physical address for this request";
123 RubyRequestType Type, desc="Type of request (LD, ST, etc)";
124 Addr ProgramCounter, desc="Program counter of the instruction that caused the miss";
125 RubyAccessMode AccessMode, desc="user/supervisor access type";
126 int Size, desc="size in bytes of access";
127 PrefetchBit Prefetch, desc="Is this a prefetch request";
128 int contextId, desc="this goes away but must be replace with Nilay";
131 structure(AbstractEntry, primitive="yes", external = "yes") {
132 void changePermission(AccessPermission);
135 structure (DirectoryMemory, external = "yes") {
136 AbstractEntry allocate(Addr, AbstractEntry);
137 AbstractEntry lookup(Addr);
138 bool isPresent(Addr);
139 void invalidateBlock(Addr);
140 void recordRequestType(DirectoryRequestType);
143 structure(AbstractCacheEntry, primitive="yes", external = "yes") {
144 void changePermission(AccessPermission);
147 structure (CacheMemory, external = "yes") {
148 bool cacheAvail(Addr);
149 Addr cacheProbe(Addr);
150 AbstractCacheEntry allocate(Addr, AbstractCacheEntry);
151 AbstractCacheEntry allocate(Addr, AbstractCacheEntry, bool);
152 void allocateVoid(Addr, AbstractCacheEntry);
153 void deallocate(Addr);
154 AbstractCacheEntry lookup(Addr);
155 bool isTagPresent(Addr);
156 Cycles getTagLatency();
157 Cycles getDataLatency();
159 void setMRU(AbstractCacheEntry);
160 void recordRequestType(CacheRequestType, Addr);
161 bool checkResourceAvailable(CacheResourceType, Addr);
165 Addr getAddressAtIdx(int);
167 Scalar demand_misses;
171 structure (WireBuffer, inport="yes", outport="yes", external = "yes") {
175 structure (DMASequencer, external = "yes") {
177 void dataCallback(DataBlock);
178 void recordRequestType(CacheRequestType);
181 structure (TimerTable, inport="yes", external = "yes") {
184 void set(Addr, Tick);
189 structure (AbstractBloomFilter, external = "yes") {
191 void increment(Addr, int);
192 void decrement(Addr, int);
194 void unset(Addr, int);
196 bool isSet(Addr, int);
197 int getCount(Addr, int);
200 structure (Prefetcher, external = "yes") {
201 void observeMiss(Addr, RubyRequestType);
202 void observePfHit(Addr);
203 void observePfMiss(Addr);