#endif
// Execute/writeback any instructions that are available.
+ int insts_to_execute = fromIssue->size;
int inst_num = 0;
- for ( ; inst_num < issueWidth && fromIssue->insts[inst_num];
+ for (; inst_num < insts_to_execute;
++inst_num) {
DPRINTF(IEW, "Execute: Executing instructions from IQ.\n");
- DynInstPtr inst = fromIssue->insts[inst_num];
+ DynInstPtr inst = instQueue.getInstToExecute();
DPRINTF(IEW, "Execute: Processing PC %#x, [tid:%i] [sn:%i].\n",
inst->readPC(), inst->threadNumber,inst->seqNum);
*/
void insertBarrier(DynInstPtr &barr_inst);
+ DynInstPtr getInstToExecute();
+
/**
* Records the instruction as the producer of a register without
* adding it to the rest of the IQ.
/** List of all the instructions in the IQ (some of which may be issued). */
std::list<DynInstPtr> instList[Impl::MaxThreads];
+ std::list<DynInstPtr> instsToExecute;
+
/**
* Struct for comparing entries to be added to the priority queue. This
* gives reverse ordering to the instructions in terms of sequence
insertNonSpec(barr_inst);
}
+template <class Impl>
+typename Impl::DynInstPtr
+InstructionQueue<Impl>::getInstToExecute()
+{
+ assert(!instsToExecute.empty());
+ DynInstPtr inst = instsToExecute.front();
+ instsToExecute.pop_front();
+ return inst;
+}
+
template <class Impl>
void
InstructionQueue<Impl>::addToOrderList(OpClass op_class)
// @todo: This could break if there's multiple multi-cycle ops
// finishing on this cycle. Maybe implement something like
// instToCommit in iew_impl.hh.
- int &size = issueToExecuteQueue->access(0)->size;
+ issueToExecuteQueue->access(0)->size++;
+ instsToExecute.push_back(inst);
+// int &size = issueToExecuteQueue->access(0)->size;
- issueToExecuteQueue->access(0)->insts[size++] = inst;
+// issueToExecuteQueue->access(0)->insts[size++] = inst;
}
// @todo: Figure out a better way to remove the squashed items from the
ListOrderIt order_it = listOrder.begin();
ListOrderIt order_end_it = listOrder.end();
int total_issued = 0;
- int exec_queue_slot = i2e_info->size;
- while (exec_queue_slot < totalWidth && total_issued < totalWidth &&
+ while (total_issued < totalWidth &&
order_it != order_end_it) {
OpClass op_class = (*order_it).queueType;
if (idx == -2 || idx != -1) {
if (op_latency == 1) {
- i2e_info->insts[exec_queue_slot++] = issuing_inst;
+// i2e_info->insts[exec_queue_slot++] = issuing_inst;
i2e_info->size++;
+ instsToExecute.push_back(issuing_inst);
// Add the FU onto the list of FU's to be freed next
// cycle if we used one.