Ruby: Remove CacheMsg class from SLICC
[gem5.git] / src / mem / protocol / RubySlicc_Types.sm
1
2 /*
3 * Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
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.
16 *
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.
28 */
29
30 // External Types
31
32 //
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.
37 //
38
39 external_type(MessageBuffer, buffer="yes", inport="yes", outport="yes");
40
41 external_type(OutPort, primitive="yes");
42
43 structure(InPort, external = "yes", primitive="yes") {
44 bool isReady();
45 void dequeue();
46 int dequeue_getDelayCycles();
47 void recycle();
48 bool isEmpty();
49 }
50
51 external_type(NodeID, default="0");
52 external_type(MachineID);
53
54 MessageBuffer getMandatoryQueue(int core_id);
55
56 structure (Set, external = "yes", non_obj="yes") {
57 void setSize(int);
58 void add(NodeID);
59 void addSet(Set);
60 void remove(NodeID);
61 void removeSet(Set);
62 void broadcast();
63 void addRandom();
64 void clear();
65 int count();
66 bool isElement(NodeID);
67 bool isEqual(Set);
68 bool isSuperset(Set);
69 bool intersectionIsEmpty(Set);
70 NodeID smallestElement();
71 }
72
73 structure (NetDest, external = "yes", non_obj="yes") {
74 void setSize(int);
75 void setSize(int, int);
76 void add(NodeID);
77 void add(MachineID);
78 void addSet(Set);
79 void addNetDest(NetDest);
80 void setNetDest(MachineType, Set);
81 void remove(NodeID);
82 void remove(MachineID);
83 void removeSet(Set);
84 void removeNetDest(NetDest);
85 void broadcast();
86 void broadcast(MachineType);
87 void addRandom();
88 void clear();
89 Set toSet();
90 int count();
91 bool isElement(NodeID);
92 bool isElement(MachineID);
93 bool isSuperset(Set);
94 bool isSuperset(NetDest);
95 bool isEmpty();
96 bool intersectionIsEmpty(Set);
97 bool intersectionIsEmpty(NetDest);
98 MachineID smallestElement(MachineType);
99 }
100
101 structure (Sequencer, external = "yes") {
102 void readCallback(Address, DataBlock);
103 void readCallback(Address, GenericMachineType, DataBlock);
104 void readCallback(Address, GenericMachineType, DataBlock, Time, Time, Time);
105 void writeCallback(Address, DataBlock);
106 void writeCallback(Address, GenericMachineType, DataBlock);
107 void writeCallback(Address, GenericMachineType, DataBlock, Time, Time, Time);
108 void checkCoherence(Address);
109 void profileNack(Address, int, int, uint64);
110 }
111
112 structure(RubyRequest, desc="...", interface="Message", external="yes") {
113 Address LineAddress, desc="Line address for this request";
114 Address PhysicalAddress, desc="Physical address for this request";
115 RubyRequestType Type, desc="Type of request (LD, ST, etc)";
116 Address ProgramCounter, desc="Program counter of the instruction that caused the miss";
117 RubyAccessMode AccessMode, desc="user/supervisor access type";
118 int Size, desc="size in bytes of access";
119 PrefetchBit Prefetch, desc="Is this a prefetch request";
120 }
121
122 external_type(AbstractEntry, primitive="yes");
123
124 structure (DirectoryMemory, external = "yes") {
125 AbstractEntry lookup(Address);
126 bool isPresent(Address);
127 void invalidateBlock(Address);
128 }
129
130 external_type(AbstractCacheEntry, primitive="yes");
131
132 structure (CacheMemory, external = "yes") {
133 bool cacheAvail(Address);
134 Address cacheProbe(Address);
135 AbstractCacheEntry allocate(Address, AbstractCacheEntry);
136 void deallocate(Address);
137 AbstractCacheEntry lookup(Address);
138 bool isTagPresent(Address);
139 void profileMiss(RubyRequest);
140
141 void profileGenericRequest(GenericRequestType,
142 RubyAccessMode,
143 PrefetchBit);
144
145 void setMRU(Address);
146 }
147
148 structure (MemoryControl, inport="yes", outport="yes", external = "yes") {
149
150 }
151
152 structure (DMASequencer, external = "yes") {
153 void ackCallback();
154 void dataCallback(DataBlock);
155 }
156
157 structure (TimerTable, inport="yes", external = "yes") {
158 bool isReady();
159 Address readyAddress();
160 void set(Address, int);
161 void unset(Address);
162 bool isSet(Address);
163 }
164
165 structure (GenericBloomFilter, external = "yes") {
166 void clear(int);
167 void increment(Address, int);
168 void decrement(Address, int);
169 void set(Address, int);
170 void unset(Address, int);
171
172 bool isSet(Address, int);
173 int getCount(Address, int);
174 }