mem-cache: Add match functions to QueueEntry
[gem5.git] / src / mem / protocol / MOESI_CMP_token-msg.sm
1 /*
2 * Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
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
29 /*
30 * $Id$
31 *
32 */
33
34 // CoherenceRequestType
35 enumeration(CoherenceRequestType, desc="...") {
36 GETX, desc="Get eXclusive";
37 GETS, desc="Get Shared";
38 }
39
40 // PersistentType
41 enumeration(PersistentRequestType, desc="...") {
42 GETX_PERSISTENT, desc="...";
43 GETS_PERSISTENT, desc="...";
44 DEACTIVATE_PERSISTENT,desc="...";
45 }
46
47 // CoherenceResponseType
48 enumeration(CoherenceResponseType, desc="...") {
49 DATA_OWNER, desc="Data";
50 ACK_OWNER, desc="data-less owner token";
51 DATA_SHARED, desc="Data";
52 ACK, desc="ACKnowledgment";
53 WB_TOKENS, desc="L1 to L2 writeback";
54 WB_SHARED_DATA, desc="L1 to L2 writeback with data";
55 WB_OWNED, desc="L1 to L2 writeback with data";
56 INV, desc="L1 informing L2 of loss of all tokens";
57 }
58
59 // PersistentMsg
60 structure(PersistentMsg, desc="...", interface="Message") {
61 Addr addr, desc="Physical address for this request";
62 PersistentRequestType Type, desc="Type of starvation request";
63 MachineID Requestor, desc="Node who initiated the request";
64 NetDest Destination, desc="Destination set";
65 MessageSizeType MessageSize, desc="size category of the message";
66 RubyAccessMode AccessMode, desc="user/supervisor access type";
67 PrefetchBit Prefetch, desc="Is this a prefetch request";
68
69 bool functionalRead(Packet *pkt) {
70 // No data in persistent messages
71 return false;
72 }
73
74 bool functionalWrite(Packet *pkt) {
75 // No data in persistent messages
76 return false;
77 }
78 }
79
80 // RequestMsg
81 structure(RequestMsg, desc="...", interface="Message") {
82 Addr addr, desc="Physical address for this request";
83 CoherenceRequestType Type, desc="Type of request (GetS, GetX, PutX, etc)";
84 MachineID Requestor, desc="Node who initiated the request";
85 NetDest Destination, desc="Multicast destination mask";
86 bool isLocal, desc="Is this request from a local L1";
87 int RetryNum, desc="retry sequence number";
88 MessageSizeType MessageSize, desc="size category of the message";
89 RubyAccessMode AccessMode, desc="user/supervisor access type";
90 PrefetchBit Prefetch, desc="Is this a prefetch request";
91
92 bool functionalRead(Packet *pkt) {
93 // No data in request messages
94 return false;
95 }
96
97 bool functionalWrite(Packet *pkt) {
98 // No data in request messages
99 return false;
100 }
101 }
102
103 // ResponseMsg
104 structure(ResponseMsg, desc="...", interface="Message") {
105 Addr addr, desc="Physical address for this request";
106 CoherenceResponseType Type, desc="Type of response (Ack, Data, etc)";
107 MachineID Sender, desc="Node who sent the data";
108 NetDest Destination, desc="Node to whom the data is sent";
109 int Tokens, desc="Number of tokens being transfered for this line";
110 DataBlock DataBlk, desc="data for the cache line";
111 bool Dirty, desc="Is the data dirty (different than memory)?";
112 MessageSizeType MessageSize, desc="size category of the message";
113
114 bool functionalRead(Packet *pkt) {
115 // No check being carried out on the message type. Would be added later.
116 return testAndRead(addr, DataBlk, pkt);
117 }
118
119 bool functionalWrite(Packet *pkt) {
120 // No check required since all messages are written.
121 return testAndWrite(addr, DataBlk, pkt);
122 }
123 }
124
125 enumeration(DMARequestType, desc="...", default="DMARequestType_NULL") {
126 READ, desc="Memory Read";
127 WRITE, desc="Memory Write";
128 NULL, desc="Invalid";
129 }
130
131 enumeration(DMAResponseType, desc="...", default="DMAResponseType_NULL") {
132 DATA, desc="DATA read";
133 ACK, desc="ACK write";
134 NULL, desc="Invalid";
135 }
136
137 structure(DMARequestMsg, desc="...", interface="Message") {
138 DMARequestType Type, desc="Request type (read/write)";
139 Addr PhysicalAddress, desc="Physical address for this request";
140 Addr LineAddress, desc="Line address for this request";
141 MachineID Requestor, desc="Node who initiated the request";
142 NetDest Destination, desc="Destination";
143 DataBlock DataBlk, desc="DataBlk attached to this request";
144 int Len, desc="The length of the request";
145 MessageSizeType MessageSize, desc="size category of the message";
146
147 bool functionalRead(Packet *pkt) {
148 return false;
149 }
150
151 bool functionalWrite(Packet *pkt) {
152 return testAndWrite(LineAddress, DataBlk, pkt);
153 }
154 }
155
156 structure(DMAResponseMsg, desc="...", interface="Message") {
157 DMAResponseType Type, desc="Response type (DATA/ACK)";
158 Addr PhysicalAddress, desc="Physical address for this request";
159 Addr LineAddress, desc="Line address for this request";
160 NetDest Destination, desc="Destination";
161 DataBlock DataBlk, desc="DataBlk attached to this request";
162 MessageSizeType MessageSize, desc="size category of the message";
163
164 bool functionalRead(Packet *pkt) {
165 return false;
166 }
167
168 bool functionalWrite(Packet *pkt) {
169 return testAndWrite(LineAddress, DataBlk, pkt);
170 }
171 }