execute.cc (11567:560d7fbbddd1) execute.cc (11568:91e95eb78191)
1/*
2 * Copyright (c) 2013-2014 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

--- 545 unchanged lines hidden (view full) ---

554 bool issued_mem_ref = false;
555
556 if (inst->isBubble()) {
557 /* Skip */
558 issued = true;
559 } else if (cpu.getContext(thread_id)->status() ==
560 ThreadContext::Suspended)
561 {
1/*
2 * Copyright (c) 2013-2014 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

--- 545 unchanged lines hidden (view full) ---

554 bool issued_mem_ref = false;
555
556 if (inst->isBubble()) {
557 /* Skip */
558 issued = true;
559 } else if (cpu.getContext(thread_id)->status() ==
560 ThreadContext::Suspended)
561 {
562 DPRINTF(MinorExecute, "Not issuing inst: %s from suspended"
562 DPRINTF(MinorExecute, "Discarding inst: %s from suspended"
563 " thread\n", *inst);
564
563 " thread\n", *inst);
564
565 issued = false;
565 issued = true;
566 discarded = true;
566 } else if (inst->id.streamSeqNum != thread.streamSeqNum) {
567 DPRINTF(MinorExecute, "Discarding inst: %s as its stream"
568 " state was unexpected, expected: %d\n",
569 *inst, thread.streamSeqNum);
570 issued = true;
571 discarded = true;
572 } else {
573 /* Try and issue an instruction into an FU, assume we didn't and

--- 301 unchanged lines hidden (view full) ---

875 bool completed_inst = true;
876 fault = NoFault;
877
878 /* Is the thread for this instruction suspended? In that case, just
879 * stall as long as there are no pending interrupts */
880 if (thread->status() == ThreadContext::Suspended &&
881 !isInterrupted(thread_id))
882 {
567 } else if (inst->id.streamSeqNum != thread.streamSeqNum) {
568 DPRINTF(MinorExecute, "Discarding inst: %s as its stream"
569 " state was unexpected, expected: %d\n",
570 *inst, thread.streamSeqNum);
571 issued = true;
572 discarded = true;
573 } else {
574 /* Try and issue an instruction into an FU, assume we didn't and

--- 301 unchanged lines hidden (view full) ---

876 bool completed_inst = true;
877 fault = NoFault;
878
879 /* Is the thread for this instruction suspended? In that case, just
880 * stall as long as there are no pending interrupts */
881 if (thread->status() == ThreadContext::Suspended &&
882 !isInterrupted(thread_id))
883 {
883 DPRINTF(MinorExecute, "Not committing inst from suspended thread"
884 " inst: %s\n", *inst);
885 completed_inst = false;
884 panic("We should never hit the case where we try to commit from a "
885 "suspended thread as the streamSeqNum should not match");
886 } else if (inst->isFault()) {
887 ExecContext context(cpu, *cpu.threads[thread_id], *this, inst);
888
889 DPRINTF(MinorExecute, "Fault inst reached Execute: %s\n",
890 inst->fault->name());
891
892 fault = inst->fault;
893 inst->fault->invoke(thread, NULL);

--- 586 unchanged lines hidden (view full) ---

1480 /* Find the next issuable instruction for each thread and see if it can
1481 be issued */
1482 if (getInput(tid)) {
1483 unsigned int input_index = executeInfo[tid].inputIndex;
1484 MinorDynInstPtr inst = getInput(tid)->insts[input_index];
1485 if (inst->isFault()) {
1486 can_issue_next = true;
1487 } else if (!inst->isBubble()) {
886 } else if (inst->isFault()) {
887 ExecContext context(cpu, *cpu.threads[thread_id], *this, inst);
888
889 DPRINTF(MinorExecute, "Fault inst reached Execute: %s\n",
890 inst->fault->name());
891
892 fault = inst->fault;
893 inst->fault->invoke(thread, NULL);

--- 586 unchanged lines hidden (view full) ---

1480 /* Find the next issuable instruction for each thread and see if it can
1481 be issued */
1482 if (getInput(tid)) {
1483 unsigned int input_index = executeInfo[tid].inputIndex;
1484 MinorDynInstPtr inst = getInput(tid)->insts[input_index];
1485 if (inst->isFault()) {
1486 can_issue_next = true;
1487 } else if (!inst->isBubble()) {
1488 if (cpu.getContext(tid)->status() != ThreadContext::Suspended) {
1489 next_issuable_insts.push_back(inst);
1490 }
1488 next_issuable_insts.push_back(inst);
1491 }
1492 }
1493 }
1494
1495 bool becoming_stalled = true;
1496
1497 /* Advance the pipelines and note whether they still need to be
1498 * advanced */

--- 237 unchanged lines hidden (view full) ---

1736 case Enums::Random:
1737 priority_list = cpu.randomPriority();
1738 break;
1739 default:
1740 panic("Invalid thread scheduling policy.");
1741 }
1742
1743 for (auto tid : priority_list) {
1489 }
1490 }
1491 }
1492
1493 bool becoming_stalled = true;
1494
1495 /* Advance the pipelines and note whether they still need to be
1496 * advanced */

--- 237 unchanged lines hidden (view full) ---

1734 case Enums::Random:
1735 priority_list = cpu.randomPriority();
1736 break;
1737 default:
1738 panic("Invalid thread scheduling policy.");
1739 }
1740
1741 for (auto tid : priority_list) {
1744 if (cpu.getContext(tid)->status() == ThreadContext::Active &&
1745 getInput(tid)) {
1742 if (getInput(tid)) {
1746 issuePriority = tid;
1747 return tid;
1748 }
1749 }
1750
1751 return InvalidThreadID;
1752}
1753

--- 64 unchanged lines hidden (view full) ---

1818
1819bool
1820Execute::isDrained()
1821{
1822 if (!lsq.isDrained())
1823 return false;
1824
1825 for (ThreadID tid = 0; tid < cpu.numThreads; tid++) {
1743 issuePriority = tid;
1744 return tid;
1745 }
1746 }
1747
1748 return InvalidThreadID;
1749}
1750

--- 64 unchanged lines hidden (view full) ---

1815
1816bool
1817Execute::isDrained()
1818{
1819 if (!lsq.isDrained())
1820 return false;
1821
1822 for (ThreadID tid = 0; tid < cpu.numThreads; tid++) {
1826 if (executeInfo[tid].drainState != DrainAllInsts ||
1827 !inputBuffer[tid].empty() ||
1823 if (!inputBuffer[tid].empty() ||
1828 !executeInfo[tid].inFlightInsts->empty()) {
1829
1830 return false;
1831 }
1832 }
1833
1834 return true;
1835}

--- 34 unchanged lines hidden ---
1824 !executeInfo[tid].inFlightInsts->empty()) {
1825
1826 return false;
1827 }
1828 }
1829
1830 return true;
1831}

--- 34 unchanged lines hidden ---