forked from umd-memsys/DRAMSim2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandQueue.cpp
763 lines (702 loc) · 20.7 KB
/
CommandQueue.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
/*********************************************************************************
* Copyright (c) 2010-2011, Elliott Cooper-Balis
* Paul Rosenfeld
* Bruce Jacob
* University of Maryland
* dramninjas [at] gmail [dot] com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*********************************************************************************/
//CommandQueue.cpp
//
//Class file for command queue object
//
#include "CommandQueue.h"
#include "MemoryController.h"
#include <assert.h>
using namespace DRAMSim;
CommandQueue::CommandQueue(vector< vector<BankState> > &states, ostream &dramsim_log_) :
dramsim_log(dramsim_log_),
bankStates(states),
nextBank(0),
nextRank(0),
nextBankPRE(0),
nextRankPRE(0),
refreshRank(0),
refreshWaiting(false),
sendAct(true)
{
//set here to avoid compile errors
currentClockCycle = 0;
//use numBankQueus below to create queue structure
size_t numBankQueues;
if (queuingStructure==PerRank)
{
numBankQueues = 1;
}
else if (queuingStructure==PerRankPerBank)
{
numBankQueues = NUM_BANKS;
}
else
{
ERROR("== Error - Unknown queuing structure");
exit(0);
}
//vector of counters used to ensure rows don't stay open too long
rowAccessCounters = vector< vector<unsigned> >(NUM_RANKS, vector<unsigned>(NUM_BANKS,0));
//create queue based on the structure we want
BusPacket1D actualQueue;
BusPacket2D perBankQueue = BusPacket2D();
queues = BusPacket3D();
for (size_t rank=0; rank<NUM_RANKS; rank++)
{
//this loop will run only once for per-rank and NUM_BANKS times for per-rank-per-bank
for (size_t bank=0; bank<numBankQueues; bank++)
{
actualQueue = BusPacket1D();
perBankQueue.push_back(actualQueue);
}
queues.push_back(perBankQueue);
}
//FOUR-bank activation window
// this will count the number of activations within a given window
// (decrementing counter)
//
//countdown vector will have decrementing counters starting at tFAW
// when the 0th element reaches 0, remove it
tFAWCountdown.reserve(NUM_RANKS);
for (size_t i=0;i<NUM_RANKS;i++)
{
//init the empty vectors here so we don't seg fault later
tFAWCountdown.push_back(vector<unsigned>());
}
}
CommandQueue::~CommandQueue()
{
//ERROR("COMMAND QUEUE destructor");
size_t bankMax = NUM_RANKS;
if (queuingStructure == PerRank) {
bankMax = 1;
}
for (size_t r=0; r< NUM_RANKS; r++)
{
for (size_t b=0; b<bankMax; b++)
{
for (size_t i=0; i<queues[r][b].size(); i++)
{
delete(queues[r][b][i]);
}
queues[r][b].clear();
}
}
}
//Adds a command to appropriate queue
void CommandQueue::enqueue(BusPacket *newBusPacket)
{
unsigned rank = newBusPacket->rank;
unsigned bank = newBusPacket->bank;
if (queuingStructure==PerRank)
{
queues[rank][0].push_back(newBusPacket);
if (queues[rank][0].size()>CMD_QUEUE_DEPTH)
{
ERROR("== Error - Enqueued more than allowed in command queue");
ERROR(" Need to call .hasRoomFor(int numberToEnqueue, unsigned rank, unsigned bank) first");
exit(0);
}
}
else if (queuingStructure==PerRankPerBank)
{
queues[rank][bank].push_back(newBusPacket);
if (queues[rank][bank].size()>CMD_QUEUE_DEPTH)
{
ERROR("== Error - Enqueued more than allowed in command queue");
ERROR(" Need to call .hasRoomFor(int numberToEnqueue, unsigned rank, unsigned bank) first");
exit(0);
}
}
else
{
ERROR("== Error - Unknown queuing structure");
exit(0);
}
}
//Removes the next item from the command queue based on the system's
//command scheduling policy
bool CommandQueue::pop(BusPacket **busPacket)
{
//this can be done here because pop() is called every clock cycle by the parent MemoryController
// figures out the sliding window requirement for tFAW
//
//deal with tFAW book-keeping
// each rank has it's own counter since the restriction is on a device level
for (size_t i=0;i<NUM_RANKS;i++)
{
//decrement all the counters we have going
for (size_t j=0;j<tFAWCountdown[i].size();j++)
{
tFAWCountdown[i][j]--;
}
//the head will always be the smallest counter, so check if it has reached 0
if (tFAWCountdown[i].size()>0 && tFAWCountdown[i][0]==0)
{
tFAWCountdown[i].erase(tFAWCountdown[i].begin());
}
}
/* Now we need to find a packet to issue. When the code picks a packet, it will set
*busPacket = [some eligible packet]
First the code looks if any refreshes need to go
Then it looks for data packets
Otherwise, it starts looking for rows to close (in open page)
*/
if (rowBufferPolicy==ClosePage)
{
bool sendingREF = false;
//if the memory controller set the flags signaling that we need to issue a refresh
if (refreshWaiting)
{
bool foundActiveOrTooEarly = false;
//look for an open bank
for (size_t b=0;b<NUM_BANKS;b++)
{
vector<BusPacket *> &queue = getCommandQueue(refreshRank,b);
//checks to make sure that all banks are idle
if (bankStates[refreshRank][b].currentBankState == RowActive)
{
foundActiveOrTooEarly = true;
//if the bank is open, make sure there is nothing else
// going there before we close it
for (size_t j=0;j<queue.size();j++)
{
BusPacket *packet = queue[j];
if (packet->row == bankStates[refreshRank][b].openRowAddress &&
packet->bank == b)
{
if (packet->busPacketType != ACTIVATE && isIssuable(packet))
{
*busPacket = packet;
queue.erase(queue.begin() + j);
sendingREF = true;
}
break;
}
}
break;
}
// NOTE: checks nextActivate time for each bank to make sure tRP is being
// satisfied. the next ACT and next REF can be issued at the same
// point in the future, so just use nextActivate field instead of
// creating a nextRefresh field
else if (bankStates[refreshRank][b].nextActivate > currentClockCycle)
{
foundActiveOrTooEarly = true;
break;
}
}
//if there are no open banks and timing has been met, send out the refresh
// reset flags and rank pointer
if (!foundActiveOrTooEarly && bankStates[refreshRank][0].currentBankState != PowerDown)
{
*busPacket = new BusPacket(REFRESH, 0, 0, 0, refreshRank, 0, 0, dramsim_log);
refreshRank = -1;
refreshWaiting = false;
sendingREF = true;
}
} // refreshWaiting
//if we're not sending a REF, proceed as normal
if (!sendingREF)
{
bool foundIssuable = false;
unsigned startingRank = nextRank;
unsigned startingBank = nextBank;
do
{
vector<BusPacket *> &queue = getCommandQueue(nextRank, nextBank);
//make sure there is something in this queue first
// also make sure a rank isn't waiting for a refresh
// if a rank is waiting for a refesh, don't issue anything to it until the
// refresh logic above has sent one out (ie, letting banks close)
if (!queue.empty() && !((nextRank == refreshRank) && refreshWaiting))
{
if (queuingStructure == PerRank)
{
//search from beginning to find first issuable bus packet
for (size_t i=0;i<queue.size();i++)
{
if (isIssuable(queue[i]))
{
//check to make sure we aren't removing a read/write that is paired with an activate
if (i>0 && queue[i-1]->busPacketType==ACTIVATE &&
queue[i-1]->physicalAddress == queue[i]->physicalAddress)
continue;
*busPacket = queue[i];
queue.erase(queue.begin()+i);
foundIssuable = true;
break;
}
}
}
else
{
if (isIssuable(queue[0]))
{
//no need to search because if the front can't be sent,
// then no chance something behind it can go instead
*busPacket = queue[0];
queue.erase(queue.begin());
foundIssuable = true;
}
}
}
//if we found something, break out of do-while
if (foundIssuable) break;
//rank round robin
if (queuingStructure == PerRank)
{
nextRank = (nextRank + 1) % NUM_RANKS;
if (startingRank == nextRank)
{
break;
}
}
else
{
nextRankAndBank(nextRank, nextBank);
if (startingRank == nextRank && startingBank == nextBank)
{
break;
}
}
}
while (true);
//if we couldn't find anything to send, return false
if (!foundIssuable) return false;
}
}
else if (rowBufferPolicy==OpenPage)
{
bool sendingREForPRE = false;
if (refreshWaiting)
{
bool sendREF = true;
//make sure all banks idle and timing met for a REF
for (size_t b=0;b<NUM_BANKS;b++)
{
//if a bank is active we can't send a REF yet
if (bankStates[refreshRank][b].currentBankState == RowActive)
{
sendREF = false;
bool closeRow = true;
//search for commands going to an open row
vector <BusPacket *> &refreshQueue = getCommandQueue(refreshRank,b);
for (size_t j=0;j<refreshQueue.size();j++)
{
BusPacket *packet = refreshQueue[j];
//if a command in the queue is going to the same row . . .
if (bankStates[refreshRank][b].openRowAddress == packet->row &&
b == packet->bank)
{
// . . . and is not an activate . . .
if (packet->busPacketType != ACTIVATE)
{
closeRow = false;
// . . . and can be issued . . .
if (isIssuable(packet))
{
//send it out
*busPacket = packet;
refreshQueue.erase(refreshQueue.begin()+j);
sendingREForPRE = true;
}
break;
}
else //command is an activate
{
//if we've encountered another act, no other command will be of interest
break;
}
}
}
//if the bank is open and we are allowed to close it, then send a PRE
if (closeRow && currentClockCycle >= bankStates[refreshRank][b].nextPrecharge)
{
rowAccessCounters[refreshRank][b]=0;
*busPacket = new BusPacket(PRECHARGE, 0, 0, 0, refreshRank, b, 0, dramsim_log);
sendingREForPRE = true;
}
break;
}
// NOTE: the next ACT and next REF can be issued at the same
// point in the future, so just use nextActivate field instead of
// creating a nextRefresh field
else if (bankStates[refreshRank][b].nextActivate > currentClockCycle) //and this bank doesn't have an open row
{
sendREF = false;
break;
}
}
//if there are no open banks and timing has been met, send out the refresh
// reset flags and rank pointer
if (sendREF && bankStates[refreshRank][0].currentBankState != PowerDown)
{
*busPacket = new BusPacket(REFRESH, 0, 0, 0, refreshRank, 0, 0, dramsim_log);
refreshRank = -1;
refreshWaiting = false;
sendingREForPRE = true;
}
}
if (!sendingREForPRE)
{
unsigned startingRank = nextRank;
unsigned startingBank = nextBank;
bool foundIssuable = false;
do // round robin over queues
{
vector<BusPacket *> &queue = getCommandQueue(nextRank,nextBank);
//make sure there is something there first
if (!queue.empty() && !((nextRank == refreshRank) && refreshWaiting))
{
//search from the beginning to find first issuable bus packet
for (size_t i=0;i<queue.size();i++)
{
BusPacket *packet = queue[i];
if (isIssuable(packet))
{
//check for dependencies
bool dependencyFound = false;
for (size_t j=0;j<i;j++)
{
BusPacket *prevPacket = queue[j];
if (prevPacket->busPacketType != ACTIVATE &&
prevPacket->bank == packet->bank &&
prevPacket->row == packet->row)
{
dependencyFound = true;
break;
}
}
if (dependencyFound) continue;
*busPacket = packet;
//if the bus packet before is an activate, that is the act that was
// paired with the column access we are removing, so we have to remove
// that activate as well (check i>0 because if i==0 then theres nothing before it)
if (i>0 && queue[i-1]->busPacketType == ACTIVATE)
{
rowAccessCounters[(*busPacket)->rank][(*busPacket)->bank]++;
// i is being returned, but i-1 is being thrown away, so must delete it here
delete (queue[i-1]);
// remove both i-1 (the activate) and i (we've saved the pointer in *busPacket)
queue.erase(queue.begin()+i-1,queue.begin()+i+1);
}
else // there's no activate before this packet
{
//or just remove the one bus packet
queue.erase(queue.begin()+i);
}
foundIssuable = true;
break;
}
}
}
//if we found something, break out of do-while
if (foundIssuable) break;
//rank round robin
if (queuingStructure == PerRank)
{
nextRank = (nextRank + 1) % NUM_RANKS;
if (startingRank == nextRank)
{
break;
}
}
else
{
nextRankAndBank(nextRank, nextBank);
if (startingRank == nextRank && startingBank == nextBank)
{
break;
}
}
}
while (true);
//if nothing was issuable, see if we can issue a PRE to an open bank
// that has no other commands waiting
if (!foundIssuable)
{
//search for banks to close
bool sendingPRE = false;
unsigned startingRank = nextRankPRE;
unsigned startingBank = nextBankPRE;
do // round robin over all ranks and banks
{
vector <BusPacket *> &queue = getCommandQueue(nextRankPRE, nextBankPRE);
bool found = false;
//check if bank is open
if (bankStates[nextRankPRE][nextBankPRE].currentBankState == RowActive)
{
for (size_t i=0;i<queue.size();i++)
{
//if there is something going to that bank and row, then we don't want to send a PRE
if (queue[i]->bank == nextBankPRE &&
queue[i]->row == bankStates[nextRankPRE][nextBankPRE].openRowAddress)
{
found = true;
break;
}
}
//if nothing found going to that bank and row or too many accesses have happend, close it
if (!found || rowAccessCounters[nextRankPRE][nextBankPRE]==TOTAL_ROW_ACCESSES)
{
if (currentClockCycle >= bankStates[nextRankPRE][nextBankPRE].nextPrecharge)
{
sendingPRE = true;
rowAccessCounters[nextRankPRE][nextBankPRE] = 0;
*busPacket = new BusPacket(PRECHARGE, 0, 0, 0, nextRankPRE, nextBankPRE, 0, dramsim_log);
break;
}
}
}
nextRankAndBank(nextRankPRE, nextBankPRE);
}
while (!(startingRank == nextRankPRE && startingBank == nextBankPRE));
//if no PREs could be sent, just return false
if (!sendingPRE) return false;
}
}
}
//sendAct is flag used for posted-cas
// posted-cas is enabled when AL>0
// when sendAct is true, when don't want to increment our indexes
// so we send the column access that is paid with this act
if (AL>0 && sendAct)
{
sendAct = false;
}
else
{
sendAct = true;
nextRankAndBank(nextRank, nextBank);
}
//if its an activate, add a tfaw counter
if ((*busPacket)->busPacketType==ACTIVATE)
{
tFAWCountdown[(*busPacket)->rank].push_back(tFAW);
}
return true;
}
//check if a rank/bank queue has room for a certain number of bus packets
bool CommandQueue::hasRoomFor(unsigned numberToEnqueue, unsigned rank, unsigned bank)
{
vector<BusPacket *> &queue = getCommandQueue(rank, bank);
return (CMD_QUEUE_DEPTH - queue.size() >= numberToEnqueue);
}
//prints the contents of the command queue
void CommandQueue::print()
{
if (queuingStructure==PerRank)
{
PRINT(endl << "== Printing Per Rank Queue" );
for (size_t i=0;i<NUM_RANKS;i++)
{
PRINT(" = Rank " << i << " size : " << queues[i][0].size() );
for (size_t j=0;j<queues[i][0].size();j++)
{
PRINTN(" "<< j << "]");
queues[i][0][j]->print();
}
}
}
else if (queuingStructure==PerRankPerBank)
{
PRINT("\n== Printing Per Rank, Per Bank Queue" );
for (size_t i=0;i<NUM_RANKS;i++)
{
PRINT(" = Rank " << i );
for (size_t j=0;j<NUM_BANKS;j++)
{
PRINT(" Bank "<< j << " size : " << queues[i][j].size() );
for (size_t k=0;k<queues[i][j].size();k++)
{
PRINTN(" " << k << "]");
queues[i][j][k]->print();
}
}
}
}
}
/**
* return a reference to the queue for a given rank, bank. Since we
* don't always have a per bank queuing structure, sometimes the bank
* argument is ignored (and the 0th index is returned
*/
vector<BusPacket *> &CommandQueue::getCommandQueue(unsigned rank, unsigned bank)
{
if (queuingStructure == PerRankPerBank)
{
return queues[rank][bank];
}
else if (queuingStructure == PerRank)
{
return queues[rank][0];
}
else
{
ERROR("Unknown queue structure");
abort();
}
}
//checks if busPacket is allowed to be issued
bool CommandQueue::isIssuable(BusPacket *busPacket)
{
switch (busPacket->busPacketType)
{
case REFRESH:
break;
case ACTIVATE:
if ((bankStates[busPacket->rank][busPacket->bank].currentBankState == Idle ||
bankStates[busPacket->rank][busPacket->bank].currentBankState == Refreshing) &&
currentClockCycle >= bankStates[busPacket->rank][busPacket->bank].nextActivate &&
tFAWCountdown[busPacket->rank].size() < 4)
{
return true;
}
else
{
return false;
}
break;
case WRITE:
case WRITE_P:
if (bankStates[busPacket->rank][busPacket->bank].currentBankState == RowActive &&
currentClockCycle >= bankStates[busPacket->rank][busPacket->bank].nextWrite &&
busPacket->row == bankStates[busPacket->rank][busPacket->bank].openRowAddress &&
rowAccessCounters[busPacket->rank][busPacket->bank] < TOTAL_ROW_ACCESSES)
{
return true;
}
else
{
return false;
}
break;
case READ_P:
case READ:
if (bankStates[busPacket->rank][busPacket->bank].currentBankState == RowActive &&
currentClockCycle >= bankStates[busPacket->rank][busPacket->bank].nextRead &&
busPacket->row == bankStates[busPacket->rank][busPacket->bank].openRowAddress &&
rowAccessCounters[busPacket->rank][busPacket->bank] < TOTAL_ROW_ACCESSES)
{
return true;
}
else
{
return false;
}
break;
case PRECHARGE:
if (bankStates[busPacket->rank][busPacket->bank].currentBankState == RowActive &&
currentClockCycle >= bankStates[busPacket->rank][busPacket->bank].nextPrecharge)
{
return true;
}
else
{
return false;
}
break;
default:
ERROR("== Error - Trying to issue a crazy bus packet type : ");
busPacket->print();
exit(0);
}
return false;
}
//figures out if a rank's queue is empty
bool CommandQueue::isEmpty(unsigned rank)
{
if (queuingStructure == PerRank)
{
return queues[rank][0].empty();
}
else if (queuingStructure == PerRankPerBank)
{
for (size_t i=0;i<NUM_BANKS;i++)
{
if (!queues[rank][i].empty()) return false;
}
return true;
}
else
{
DEBUG("Invalid Queueing Stucture");
abort();
}
}
//tells the command queue that a particular rank is in need of a refresh
void CommandQueue::needRefresh(unsigned rank)
{
refreshWaiting = true;
refreshRank = rank;
}
void CommandQueue::nextRankAndBank(unsigned &rank, unsigned &bank)
{
if (schedulingPolicy == RankThenBankRoundRobin)
{
rank++;
if (rank == NUM_RANKS)
{
rank = 0;
bank++;
if (bank == NUM_BANKS)
{
bank = 0;
}
}
}
//bank-then-rank round robin
else if (schedulingPolicy == BankThenRankRoundRobin)
{
bank++;
if (bank == NUM_BANKS)
{
bank = 0;
rank++;
if (rank == NUM_RANKS)
{
rank = 0;
}
}
}
else
{
ERROR("== Error - Unknown scheduling policy");
exit(0);
}
}
void CommandQueue::update()
{
//do nothing since pop() is effectively update(),
//needed for SimulatorObject
//TODO: make CommandQueue not a SimulatorObject
}