dist_iface.hh (11703:08b78e0a3717) | dist_iface.hh (11757:78ef8daecd81) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2015 ARM Limited | 2 * Copyright (c) 2015-2016 ARM Limited |
3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 136 unchanged lines hidden (view full) --- 147 /** 148 * The repeat value for the next periodic sync 149 */ 150 Tick nextRepeat; 151 /** 152 * Tick for the next periodic sync (if the event is not scheduled yet) 153 */ 154 Tick nextAt; | 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 136 unchanged lines hidden (view full) --- 147 /** 148 * The repeat value for the next periodic sync 149 */ 150 Tick nextRepeat; 151 /** 152 * Tick for the next periodic sync (if the event is not scheduled yet) 153 */ 154 Tick nextAt; |
155 /** 156 * Flag is set if the sync is aborted (e.g. due to connection lost) 157 */ 158 bool isAbort; |
|
155 156 friend class SyncEvent; 157 158 public: 159 /** 160 * Initialize periodic sync params. 161 * 162 * @param start Start tick for dist synchronisation 163 * @param repeat Frequency of dist synchronisation 164 * 165 */ 166 void init(Tick start, Tick repeat); 167 /** 168 * Core method to perform a full dist sync. | 159 160 friend class SyncEvent; 161 162 public: 163 /** 164 * Initialize periodic sync params. 165 * 166 * @param start Start tick for dist synchronisation 167 * @param repeat Frequency of dist synchronisation 168 * 169 */ 170 void init(Tick start, Tick repeat); 171 /** 172 * Core method to perform a full dist sync. |
173 * 174 * @return true if the sync completes, false if it gets aborted |
|
169 */ | 175 */ |
170 virtual void run(bool same_tick) = 0; | 176 virtual bool run(bool same_tick) = 0; |
171 /** 172 * Callback when the receiver thread gets a sync ack message. | 177 /** 178 * Callback when the receiver thread gets a sync ack message. |
179 * 180 * @return false if the receiver thread needs to stop (e.g. 181 * simulation is to exit) |
|
173 */ | 182 */ |
174 virtual void progress(Tick send_tick, | 183 virtual bool progress(Tick send_tick, |
175 Tick next_repeat, 176 ReqType do_ckpt, 177 ReqType do_exit, 178 ReqType do_stop_sync) = 0; | 184 Tick next_repeat, 185 ReqType do_ckpt, 186 ReqType do_exit, 187 ReqType do_stop_sync) = 0; |
188 /** 189 * Abort processing an on-going sync event (in case of an error, e.g. 190 * lost connection to a peer gem5) 191 */ 192 void abort(); |
|
179 180 virtual void requestCkpt(ReqType req) = 0; 181 virtual void requestExit(ReqType req) = 0; 182 virtual void requestStopSync(ReqType req) = 0; 183 184 void drainComplete(); 185 186 virtual void serialize(CheckpointOut &cp) const override = 0; --- 15 unchanged lines hidden (view full) --- 202 * Sync stop requested 203 */ 204 ReqType needStopSync; 205 206 public: 207 208 SyncNode(); 209 ~SyncNode() {} | 193 194 virtual void requestCkpt(ReqType req) = 0; 195 virtual void requestExit(ReqType req) = 0; 196 virtual void requestStopSync(ReqType req) = 0; 197 198 void drainComplete(); 199 200 virtual void serialize(CheckpointOut &cp) const override = 0; --- 15 unchanged lines hidden (view full) --- 216 * Sync stop requested 217 */ 218 ReqType needStopSync; 219 220 public: 221 222 SyncNode(); 223 ~SyncNode() {} |
210 void run(bool same_tick) override; 211 void progress(Tick max_req_tick, | 224 bool run(bool same_tick) override; 225 bool progress(Tick max_req_tick, |
212 Tick next_repeat, 213 ReqType do_ckpt, 214 ReqType do_exit, 215 ReqType do_stop_sync) override; 216 217 void requestCkpt(ReqType req) override; 218 void requestExit(ReqType req) override; 219 void requestStopSync(ReqType req) override; --- 21 unchanged lines hidden (view full) --- 241 * Number of connected simulated nodes 242 */ 243 unsigned numNodes; 244 245 public: 246 SyncSwitch(int num_nodes); 247 ~SyncSwitch() {} 248 | 226 Tick next_repeat, 227 ReqType do_ckpt, 228 ReqType do_exit, 229 ReqType do_stop_sync) override; 230 231 void requestCkpt(ReqType req) override; 232 void requestExit(ReqType req) override; 233 void requestStopSync(ReqType req) override; --- 21 unchanged lines hidden (view full) --- 255 * Number of connected simulated nodes 256 */ 257 unsigned numNodes; 258 259 public: 260 SyncSwitch(int num_nodes); 261 ~SyncSwitch() {} 262 |
249 void run(bool same_tick) override; 250 void progress(Tick max_req_tick, | 263 bool run(bool same_tick) override; 264 bool progress(Tick max_req_tick, |
251 Tick next_repeat, 252 ReqType do_ckpt, 253 ReqType do_exit, 254 ReqType do_stop_sync) override; 255 256 void requestCkpt(ReqType) override { 257 panic("Switch requested checkpoint"); 258 } --- 372 unchanged lines hidden --- | 265 Tick next_repeat, 266 ReqType do_ckpt, 267 ReqType do_exit, 268 ReqType do_stop_sync) override; 269 270 void requestCkpt(ReqType) override { 271 panic("Switch requested checkpoint"); 272 } --- 372 unchanged lines hidden --- |