109 | | === 3.2 new protocol === |
110 | | |
111 | | In the new protocol, there is no more LL on the network : |
112 | | |
113 | | * Linked Loads become simple Reads, where the data sent to the processor is recorded in a register of the L1 cache. When the processor issues a Store Conditional, the L1 cache sends a "SC" packet, where the first flits contain the data previously read and the next flits contain the data to write in the memory. So this new SC packet is 2 (32 bits accesses) or 4 flits (64 bits accesses) long. |
114 | | |
115 | | * The memory cache controller then compares the data read by the L1 cache to the data in the memory cache. If these two values are equal, the Store Conditional is done, and the response to the SC is success (0 value), else the Store Conditional is not done, and the response is failure (1 value). |
116 | | |
117 | | === 3.3 memory cache controller === |
118 | | |
119 | | The memory cache controller does not have a linked access buffer any more. It simply has to be capable of recording pending Store Conditional in the table of transactions to the external RAM controller, in case of miss in the memory cache. |
120 | | |
121 | | The actions done by the memory cache controller for the various commands are described below : |
122 | | |
123 | | |
124 | | '''SC(SRCID, X)''' |
125 | | {{{ |
126 | | Read the data in the memory cache. |
127 | | If ( data read by the L1 cache == data from the memory cache ) { |
128 | | - write data in the memory cache |
129 | | - send updates or invalidates to the owners of this cache line |
130 | | - after all responses to UPDATE or INVALIDATE have been received, return true |
131 | | to the L1 cache. |
132 | | } else { |
133 | | return false to the L1 cache |
134 | | } |
135 | | }}} |
136 | | |
137 | | '''WRITE(SRCID, X)''' |
138 | | {{{ |
139 | | - Scan the linked list of copies to send an UPDATE request |
140 | | to the L1 caches (other than SRCID) |
141 | | - Write data in the memory cache |
142 | | - after all responses to UPDATE have been received, acknowledge the |
143 | | write request. |
144 | | }}} |
145 | | |
146 | | '''READ(SRCID, X)''' |
147 | | {{{ |
148 | | If ( cachable request ) { |
149 | | - register the SRCID in the list of copies associated to the X address. |
150 | | - return the complete or partial cache line |
151 | | } else { |
152 | | - return a single word. |
153 | | } |
154 | | }}} |
155 | | |
156 | | === 3.4 L1 cache controller === |
157 | | |
158 | | The L1 cache controller receiving a new LL(X) request from the processor must locally register this request on the X address and the data sent to the processor. When it receives a SC(X) request from the processor, it checks the LL register and, if this register is valid, it sends a Store Conditional to the memory cache controller containing both the data read by the LL(X) and the data to write. This requires an extra register to store the address, the data, a VALID flip-flop, and a LONG flip-flop (in case of 64 bits LL/SC) in the L1 cache controller. |
159 | | |
160 | | The actions done by the L1 cache controller for the various commands are described below : |
161 | | |
162 | | '''LL(X) from processor''' |
163 | | {{{ |
164 | | If (VALID = true & ADDRESS = X) { // local spin-lock |
165 | | return the read data to the processor |
166 | | } else { // first LL access |
167 | | VALID <= true |
168 | | ADDRESS <= X |
169 | | DATA <= READ(X), |
170 | | and return the read value to the processor |
171 | | } |
172 | | }}} |
173 | | |
174 | | '''SC(X) from processor''' |
175 | | {{{ |
176 | | If (VALID = true & ADDRESS = X) { // possible success |
177 | | send a SC(X) request to the memory cache containing the data stored in the LL register and the data to write, |
178 | | and return the Boolean response to the processor |
179 | | VALID <= false |
180 | | } else { // failure |
181 | | return a false value to the processor |
182 | | VALID <= false |
183 | | } |
184 | | }}} |
185 | | |
186 | | '''INVAL(L) or UPDATE(L) from memory controller''' |
187 | | {{{ |
188 | | The LL register must not be invalidated. |
189 | | The L1 cache is updated or invalidated. |
190 | | }}} |