68 int retval = funcUnitsIdx[idx++];
117 for (; j != end; ++j) {
123 for (
int k = 0;
k < (*i)->number; ++
k)
127 fu->addCapability((*j)->opClass, (*j)->opLat, (*j)->pipelined);
132 if (!(*j)->pipelined)
139 fu->name = (*i)->name() +
"(0)";
142 for (
int c = 1;
c < (*i)->number; ++
c) {
143 std::ostringstream
s;
147 s << (*i)->name() <<
"(" <<
c <<
")";
170 int start_idx = fu_idx;
176 if (fu_idx == start_idx) {
182 assert(fu_idx <
numFU);
212 std::cout <<
"Function Unit Pool (" <<
name() <<
")\n";
213 std::cout <<
"======================================\n";
214 std::cout <<
"Free List:\n";
221 std::cout <<
" [" <<
i <<
"] : ";
228 std::cout <<
"======================================\n";
229 std::cout <<
"Busy List:\n";
235 std::cout <<
" [" <<
i <<
"] : ";
246 bool is_drained =
true;
Cycles is a wrapper class for representing cycle counts, i.e.
virtual std::string name() const
Abstract superclass for simulation objects.
int size
Size of the queue.
std::vector< int > funcUnitsIdx
Queue of FU indices.
void addFU(int fu_idx)
Adds a FU to the queue.
int getFU()
Returns the index of the FU at the head of the queue, and changes the index to the next element.
std::array< bool, Num_OpClasses > pipelined
Whether op is pipelined or not.
void processFreeUnits()
Frees all FUs on the list.
void dump()
Debugging function used to dump FU information.
FUIdxQueue fuPerCapList[Num_OpClasses]
Per op class queues of FUs that provide that capability.
std::vector< bool > unitBusy
Bitvector listing which FUs are busy.
FUPool(const Params &p)
Constructs a FU pool.
void freeUnitNextCycle(int fu_idx)
Frees a FU at the end of this cycle.
bool isDrained() const
Have all the FUs drained?
int size()
Returns the total number of FUs.
std::vector< FuncUnit * >::iterator fuListIterator
std::vector< FuncUnit * > funcUnits
Functional units.
std::array< Cycles, Num_OpClasses > maxOpLatencies
Maximum op execution latencies, per op class.
std::vector< int > unitsToBeFreed
List of units to be freed at the end of this cycle.
int getUnit(OpClass capability)
Gets a FU providing the requested capability.
std::bitset< Num_OpClasses > capabilityList
Bitvector listing capabilities of this FU pool.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::vector< FUDesc * >::const_iterator FUDDiterator
std::vector< OpDesc * >::const_iterator OPDDiterator