OpenASIP
2.0
|
#include <PendingAssignment.hh>
Public Member Functions | |
PendingAssignment (ResourceBroker &broker) | |
virtual | ~PendingAssignment () |
ResourceBroker & | broker () |
void | setRequest (int cycle, MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) |
bool | isAssignmentPossible () |
void | tryNext () |
void | undoAssignment () |
void | forget () |
void | clear () |
SchedulingResource & | resource (int index) |
int | lastTriedAssignment () const |
Private Attributes | |
ResourceBroker & | broker_ |
Corresponding resource broker. More... | |
int | cycle_ |
MoveNode * | node_ |
const TTAMachine::Bus * | bus_ |
const TTAMachine::FunctionUnit * | srcFU_ |
const TTAMachine::FunctionUnit * | dstFU_ |
int | immWriteCycle_ |
bool | assignmentTried_ |
SchedulingResourceSet | availableResources_ |
int | lastTriedAssignment_ |
const TTAMachine::ImmediateUnit * | immu_ |
int | immRegIndex_ |
Definition at line 48 of file PendingAssignment.hh.
PendingAssignment::PendingAssignment | ( | ResourceBroker & | broker | ) |
|
virtual |
ResourceBroker & PendingAssignment::broker | ( | ) |
Return the broker of this pending assignment.
Definition at line 61 of file PendingAssignment.cc.
References broker_.
Referenced by AssignmentPlan::backtrack(), AssignmentPlan::isTestedAssignmentPossible(), and AssignmentPlan::tryNextAssignment().
void PendingAssignment::clear | ( | ) |
Clears the pending assignment.
Does not unassign anything.
Definition at line 177 of file PendingAssignment.cc.
References assignmentTried_, availableResources_, bus_, SchedulingResourceSet::clear(), cycle_, immRegIndex_, immu_, immWriteCycle_, lastTriedAssignment_, and node_.
void PendingAssignment::forget | ( | ) |
Clear out the record of the possible resource assignments of the current broker that have been already tried.
If one of the possible resources is still assigned to the node, unassign it.
Definition at line 164 of file PendingAssignment.cc.
References broker_, bus_, cycle_, ResourceBroker::isAlreadyAssigned(), lastTriedAssignment_, node_, and ResourceBroker::unassign().
Referenced by AssignmentPlan::backtrack().
bool PendingAssignment::isAssignmentPossible | ( | ) |
Return true if, for the currently applied assignments, there exists at least one tentative assignment which has not been tried yet.
Definition at line 99 of file PendingAssignment.cc.
References ResourceBroker::allAvailableResources(), availableResources_, broker_, bus_, SchedulingResourceSet::count(), cycle_, dstFU_, immRegIndex_, immu_, immWriteCycle_, lastTriedAssignment_, node_, SchedulingResourceSet::sort(), and srcFU_.
|
inline |
Definition at line 68 of file PendingAssignment.hh.
References lastTriedAssignment_.
Referenced by AssignmentPlan::isTestedAssignmentPossible().
|
inline |
Definition at line 66 of file PendingAssignment.hh.
References availableResources_, and SchedulingResourceSet::resource().
Referenced by AssignmentPlan::isTestedAssignmentPossible().
void PendingAssignment::setRequest | ( | int | cycle, |
MoveNode & | node, | ||
const TTAMachine::Bus * | bus, | ||
const TTAMachine::FunctionUnit * | srcFU, | ||
const TTAMachine::FunctionUnit * | dstFU, | ||
int | immWriteCycle, | ||
const TTAMachine::ImmediateUnit * | immu, | ||
int | immRegIndex | ||
) |
Record the input node to which resources have to be assigned or allocated, and the cycle in which the node should be placed.
cycle | Cycle. |
node | Node. |
Definition at line 73 of file PendingAssignment.cc.
References bus_, cycle_, dstFU_, immRegIndex_, immu_, immWriteCycle_, lastTriedAssignment_, node_, and srcFU_.
void PendingAssignment::tryNext | ( | ) |
Try to assign the next possible assignment found by current broker.
ModuleRunTimeError | If this PendingAssignment has run out of possible assignments. |
Definition at line 119 of file PendingAssignment.cc.
References __func__, ResourceBroker::assign(), assignmentTried_, availableResources_, broker_, SchedulingResourceSet::count(), cycle_, immRegIndex_, immWriteCycle_, lastTriedAssignment_, node_, and SchedulingResourceSet::resource().
Referenced by AssignmentPlan::tryNextAssignment().
void PendingAssignment::undoAssignment | ( | ) |
Unassign the resource of this pending assignment currently assigned to the node.
Last tried assignment is remembered.
ModuleRunTimeError | If no resource in the set of resources of this pending assignment is currently assigned to the node. |
Definition at line 146 of file PendingAssignment.cc.
References __func__, broker_, bus_, cycle_, ResourceBroker::isAlreadyAssigned(), node_, and ResourceBroker::unassign().
Referenced by AssignmentPlan::backtrack(), and AssignmentPlan::tryNextAssignment().
|
private |
Definition at line 78 of file PendingAssignment.hh.
|
private |
Definition at line 79 of file PendingAssignment.hh.
Referenced by clear(), isAssignmentPossible(), resource(), and tryNext().
|
private |
Corresponding resource broker.
Definition at line 71 of file PendingAssignment.hh.
Referenced by broker(), forget(), isAssignmentPossible(), tryNext(), and undoAssignment().
|
private |
Definition at line 74 of file PendingAssignment.hh.
Referenced by clear(), forget(), isAssignmentPossible(), setRequest(), and undoAssignment().
|
private |
Definition at line 72 of file PendingAssignment.hh.
Referenced by clear(), forget(), isAssignmentPossible(), setRequest(), tryNext(), and undoAssignment().
|
private |
Definition at line 76 of file PendingAssignment.hh.
Referenced by isAssignmentPossible(), and setRequest().
|
private |
Definition at line 82 of file PendingAssignment.hh.
Referenced by clear(), isAssignmentPossible(), setRequest(), and tryNext().
|
private |
Definition at line 81 of file PendingAssignment.hh.
Referenced by clear(), isAssignmentPossible(), and setRequest().
|
private |
Definition at line 77 of file PendingAssignment.hh.
Referenced by clear(), isAssignmentPossible(), setRequest(), and tryNext().
|
private |
Definition at line 80 of file PendingAssignment.hh.
Referenced by clear(), forget(), isAssignmentPossible(), lastTriedAssignment(), setRequest(), and tryNext().
|
private |
Definition at line 73 of file PendingAssignment.hh.
Referenced by clear(), forget(), isAssignmentPossible(), setRequest(), tryNext(), and undoAssignment().
|
private |
Definition at line 75 of file PendingAssignment.hh.
Referenced by isAssignmentPossible(), and setRequest().