scoreboard.cc (6658:f4de76601762) | scoreboard.cc (7699:addb847910d2) |
---|---|
1/* 2 * Copyright (c) 2005-2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 37 unchanged lines hidden (view full) --- 46 numMiscRegs(_numMiscRegs), 47 zeroRegIdx(_zeroRegIdx) 48{ 49 //Get Register Sizes 50 numLogicalRegs = numLogicalIntRegs + numLogicalFloatRegs; 51 numPhysicalRegs = numPhysicalIntRegs + numPhysicalFloatRegs; 52 53 //Resize scoreboard appropriately | 1/* 2 * Copyright (c) 2005-2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 37 unchanged lines hidden (view full) --- 46 numMiscRegs(_numMiscRegs), 47 zeroRegIdx(_zeroRegIdx) 48{ 49 //Get Register Sizes 50 numLogicalRegs = numLogicalIntRegs + numLogicalFloatRegs; 51 numPhysicalRegs = numPhysicalIntRegs + numPhysicalFloatRegs; 52 53 //Resize scoreboard appropriately |
54 regScoreBoard.resize(numPhysicalRegs + (numMiscRegs * activeThreads)); | 54 resize(numPhysicalRegs + (numMiscRegs * activeThreads)); |
55 56 //Initialize values 57 for (int i=0; i < numLogicalIntRegs * activeThreads; i++) { | 55 56 //Initialize values 57 for (int i=0; i < numLogicalIntRegs * activeThreads; i++) { |
58 assert(indexInBounds(i)); |
|
58 regScoreBoard[i] = 1; 59 } 60 61 for (int i= numPhysicalIntRegs; 62 i < numPhysicalIntRegs + (numLogicalFloatRegs * activeThreads); 63 i++) { | 59 regScoreBoard[i] = 1; 60 } 61 62 for (int i= numPhysicalIntRegs; 63 i < numPhysicalIntRegs + (numLogicalFloatRegs * activeThreads); 64 i++) { |
65 assert(indexInBounds(i)); |
|
64 regScoreBoard[i] = 1; 65 } 66 67 for (int i = numPhysicalRegs; 68 i < numPhysicalRegs + (numMiscRegs * activeThreads); 69 i++) { | 66 regScoreBoard[i] = 1; 67 } 68 69 for (int i = numPhysicalRegs; 70 i < numPhysicalRegs + (numMiscRegs * activeThreads); 71 i++) { |
72 assert(indexInBounds(i)); |
|
70 regScoreBoard[i] = 1; 71 } 72} 73 74std::string 75Scoreboard::name() const 76{ 77 return "cpu.scoreboard"; --- 10 unchanged lines hidden (view full) --- 88 } 89#else 90 // Always ready if int zero reg. 91 if (phys_reg == zeroRegIdx) { 92 return 1; 93 } 94#endif 95 | 73 regScoreBoard[i] = 1; 74 } 75} 76 77std::string 78Scoreboard::name() const 79{ 80 return "cpu.scoreboard"; --- 10 unchanged lines hidden (view full) --- 91 } 92#else 93 // Always ready if int zero reg. 94 if (phys_reg == zeroRegIdx) { 95 return 1; 96 } 97#endif 98 |
99 assert(indexInBounds(phys_reg)); |
|
96 return regScoreBoard[phys_reg]; 97} 98 99void 100Scoreboard::setReg(PhysRegIndex phys_reg) 101{ 102 DPRINTF(Scoreboard, "Setting reg %i as ready\n", phys_reg); 103 | 100 return regScoreBoard[phys_reg]; 101} 102 103void 104Scoreboard::setReg(PhysRegIndex phys_reg) 105{ 106 DPRINTF(Scoreboard, "Setting reg %i as ready\n", phys_reg); 107 |
108 assert(indexInBounds(phys_reg)); |
|
104 regScoreBoard[phys_reg] = 1; 105} 106 107void 108Scoreboard::unsetReg(PhysRegIndex ready_reg) 109{ 110#if THE_ISA == ALPHA_ISA 111 if (ready_reg == zeroRegIdx || 112 ready_reg == (zeroRegIdx + numPhysicalIntRegs)) { 113 // Don't do anything if int or fp zero reg. 114 return; 115 } 116#else 117 if (ready_reg == zeroRegIdx) { 118 // Don't do anything if int zero reg. 119 return; 120 } 121#endif 122 | 109 regScoreBoard[phys_reg] = 1; 110} 111 112void 113Scoreboard::unsetReg(PhysRegIndex ready_reg) 114{ 115#if THE_ISA == ALPHA_ISA 116 if (ready_reg == zeroRegIdx || 117 ready_reg == (zeroRegIdx + numPhysicalIntRegs)) { 118 // Don't do anything if int or fp zero reg. 119 return; 120 } 121#else 122 if (ready_reg == zeroRegIdx) { 123 // Don't do anything if int zero reg. 124 return; 125 } 126#endif 127 |
128 assert(indexInBounds(ready_reg)); |
|
123 regScoreBoard[ready_reg] = 0; 124} | 129 regScoreBoard[ready_reg] = 0; 130} |