Go to the documentation of this file.
61 maxCycle_(INT_MAX-1) {
75 std::map<int, std::list< SimpleResourceManager*> >& pool =
77 std::list<SimpleResourceManager*>& iipool = pool[ii];
94 if (rm == NULL)
return;
96 std::map<int, std::list< SimpleResourceManager*> >& pool =
116 std::vector<ResourceBroker*> brokers;
122 brokers.push_back(ifb);
123 brokers.push_back(ofb);
128 brokers.push_back(ipsb);
132 brokers.push_back(opsb);
134 "BusBroker", *ipsb, *opsb,
machine,
136 brokers.push_back(bb);
146 for (
unsigned int i = 0; i < brokers.size(); i++) {
192 int immRegIndex)
const {
198 cycle, node, bus, srcFU, dstFU, immWriteCycle, immu, immRegIndex);
233 cycle, node, bus, srcFU, dstFU, immWriteCycle, immu, immRegIndex);
236 node.
toString() <<
" OK!" << std::endl;
284 int immRegIndex)
const {
286 node, bus, srcFU, dstFU, immWriteCycle, immu, immRegIndex);
319 int immRegIndex)
const {
322 cycle, node, bus, srcFU, dstFU, immWriteCycle, immu, immRegIndex);
355 int immRegIndex)
const {
357 node, bus, srcFU, dstFU, immWriteCycle, immu, immRegIndex);
390 int immRegIndex)
const {
392 cycle, node, bus, srcFU, dstFU, immWriteCycle, immu, immRegIndex);
508 std::shared_ptr<TTAProgram::TerminalImmediate>
545 std::shared_ptr<TTAProgram::Immediate> immediate)
const {
584 std::stringstream temp;
592 std::string target =
"";
593 std::string result =
"";
595 while (getline(temp, target)) {
644 std::map<int, std::list< SimpleResourceManager*> > >
static std::map< const TTAMachine::Machine *, std::map< int, std::list< SimpleResourceManager * > > > rmPool_
virtual int immediateWriteCycle(const MoveNode &) const
void buildResourceModel(const TTAMachine::Machine &machine)
virtual bool canAssign(int cycle, MoveNode &node, const TTAMachine::Bus *bus=NULL, const TTAMachine::FunctionUnit *srcFU=NULL, const TTAMachine::FunctionUnit *dstFU=NULL, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) const override
virtual int latestCycle(MoveNode &node, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) const override
virtual int largestCycle() const override
std::string toString() const
TTAMachine::Machine * machine
the architecture definition of the estimated processor
virtual void unassign(MoveNode &node) override
virtual int smallestCycle() const override
virtual bool isTemplateAvailable(int, std::shared_ptr< TTAProgram::Immediate >) const
virtual bool hasGuard(const MoveNode &node) const
virtual int smallestCycle() const override
virtual std::shared_ptr< TTAProgram::TerminalImmediate > immediateValue(const MoveNode &)
virtual bool canAssign(int cycle, MoveNode &node, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) const override
virtual void assign(int cycle, MoveNode &node, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) override
void setCFG(const ControlFlowGraph *cfg)
virtual bool canTransportImmediate(const MoveNode &node, const TTAMachine::Bus *preAssignedBus) const
virtual void loseInstructionOwnership(int cycle)
virtual void assign(int cycle, MoveNode &node, const TTAMachine::Bus *bus=NULL, const TTAMachine::FunctionUnit *srcFU=NULL, const TTAMachine::FunctionUnit *dstFU=NULL, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) override
static std::ostream & logStream()
virtual unsigned initiationInterval() const
virtual void unassign(MoveNode &node) override
virtual void clearOldResources()
void setBusBroker(ResourceBroker &sb)
virtual ~SimpleResourceManager()
void insertBroker(ResourceBroker &broker)
virtual bool hasGuard(const MoveNode &node) const
void clear()
Clears all bookkeeping done by this RM. The RM can then be reused for different BB.
virtual int earliestCycle(MoveNode &node, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) const override
void setBBN(const BasicBlockNode *bbn)
virtual int largestCycle() const override
virtual int earliestCycle(MoveNode &node, const TTAMachine::Bus *bus=NULL, const TTAMachine::FunctionUnit *srcFU=NULL, const TTAMachine::FunctionUnit *dstFU=NULL, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) const override
void setCFG(const ControlFlowGraph *cfg)
static void disposeRM(SimpleResourceManager *rm, bool allowReuse=true)
void setDDG(const DataDependenceGraph *ddg)
virtual std::shared_ptr< TTAProgram::TerminalImmediate > immediateValue(const MoveNode &)
void build(const TTAMachine::Machine &machine)
SimpleResourceManager(const TTAMachine::Machine &machine, unsigned int ii=0)
static SimpleResourceManager * createRM(const TTAMachine::Machine &machine, unsigned int ii=0)
virtual int immediateWriteCycle(const MoveNode &) const
unsigned int instructionIndex(unsigned int) const
virtual unsigned int resourceCount() const
virtual void print(std::ostream &target) const
SimpleBrokerDirector * director_
Resource manager's broker director.
void setMaxCycle(unsigned int maxCycle)
void addBroker(ResourceBroker &broker)
virtual bool canTransportImmediate(const MoveNode &node, const TTAMachine::Bus *preAssignedBus=NULL) const
const TTAMachine::Machine & machine() const
void setDDG(const DataDependenceGraph *ddg)
virtual TTAProgram::Instruction * instruction(int cycle) const override
AssignmentPlan plan_
Resource assignment plan.
ResourceBuildDirector buildDirector_
Resource build director.
virtual int latestCycle(MoveNode &node, const TTAMachine::Bus *bus=NULL, const TTAMachine::FunctionUnit *srcFU=NULL, const TTAMachine::FunctionUnit *dstFU=NULL, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) const override
virtual bool isTemplateAvailable(int, std::shared_ptr< TTAProgram::Immediate >) const
void setBBN(const BasicBlockNode *bbn)
virtual void loseInstructionOwnership(int cycle)
unsigned int initiationInterval_
virtual bool supportsExternalAssignments() const override
virtual bool supportsExternalAssignments() const override
void print(std::ostream &target_, unsigned int cycles) const
virtual std::string toString() const
virtual TTAProgram::Instruction * instruction(int cycle) const override
void setMaxCycle(unsigned int cycle)