OpenASIP  2.0
InputPSocketBroker.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file InputPSocketBroker.hh
26  *
27  * Declaration of InputPSocketBroker class.
28  *
29  * @author Ari Mets�halme 2006 (ari.metsahalme-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_INPUT_PSOCKET_BROKER_HH
34 #define TTA_INPUT_PSOCKET_BROKER_HH
35 
36 #include "ResourceBroker.hh"
37 
38 namespace TTAMachine {
39  class Machine;
40  class MachinePart;
41 }
42 
43 class MoveNode;
44 class ResourceMapper;
45 class SchedulingResource;
46 
47 /**
48  * Input p-socket broker takes care of assigning input socket and input
49  * port (of FU or RF) at once.
50  */
52 public:
54  std::string name,
55  ResourceBroker& fub,
56  unsigned int initiationInterval = 0);
57  virtual ~InputPSocketBroker();
58 
60  int cycle, const MoveNode& node, const TTAMachine::Bus* bus,
61  const TTAMachine::FunctionUnit* srcFU,
62  const TTAMachine::FunctionUnit* dstFU,
63  int immWriteCycle,
64  const TTAMachine::ImmediateUnit* immu,
65  int immRegIndex) const override;
66 
67  virtual void assign(int cycle, MoveNode& node, SchedulingResource& res,
68  int immWriteCycle,
69  int immRegIndex) override;
70 
71  virtual void unassign(MoveNode& node) override;
72 
73  virtual int earliestCycle(int cycle, const MoveNode& node,
74  const TTAMachine::Bus* bus,
75  const TTAMachine::FunctionUnit* srcFU,
76  const TTAMachine::FunctionUnit* dstFU,
77  int immWriteCycle,
78  const TTAMachine::ImmediateUnit* immu,
79  int immRegIndex) const override;
80  virtual int latestCycle(int cycle, const MoveNode& node,
81  const TTAMachine::Bus* bus,
82  const TTAMachine::FunctionUnit* srcFU,
83  const TTAMachine::FunctionUnit* dstFU,
84  int immWriteCycle,
85  const TTAMachine::ImmediateUnit* immu,
86  int immRegIndex) const override;
87  virtual bool isAlreadyAssigned(
88  int cycle, const MoveNode& node, const TTAMachine::Bus*) const override;
89  virtual bool isApplicable(
90  const MoveNode& node,
91  const TTAMachine::Bus* preassignedBus = NULL) const override;
92  virtual void buildResources(const TTAMachine::Machine& target) override;
93  virtual void setupResourceLinks(const ResourceMapper& mapper) override;
94 
95  void setBusBroker(ResourceBroker& sb);
96 private:
99 };
100 
101 #endif
InputPSocketBroker::~InputPSocketBroker
virtual ~InputPSocketBroker()
Definition: InputPSocketBroker.cc:66
TTAMachine::Bus
Definition: Bus.hh:53
ResourceBroker
Definition: ResourceBroker.hh:61
InputPSocketBroker
Definition: InputPSocketBroker.hh:51
InputPSocketBroker::isApplicable
virtual bool isApplicable(const MoveNode &node, const TTAMachine::Bus *preassignedBus=NULL) const override
Definition: InputPSocketBroker.cc:210
MoveNode
Definition: MoveNode.hh:65
InputPSocketBroker::latestCycle
virtual int latestCycle(int cycle, const MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const override
Definition: InputPSocketBroker.cc:160
InputPSocketBroker::setupResourceLinks
virtual void setupResourceLinks(const ResourceMapper &mapper) override
Definition: InputPSocketBroker.cc:340
SchedulingResourceSet
Definition: SchedulingResource.hh:161
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
SchedulingResource
Definition: SchedulingResource.hh:52
InputPSocketBroker::unassign
virtual void unassign(MoveNode &node) override
Definition: InputPSocketBroker.cc:288
InputPSocketBroker::allAvailableResources
virtual SchedulingResourceSet allAvailableResources(int cycle, const MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const override
Definition: InputPSocketBroker.cc:79
InputPSocketBroker::busBroker_
ResourceBroker * busBroker_
Definition: InputPSocketBroker.hh:98
InputPSocketBroker::setBusBroker
void setBusBroker(ResourceBroker &sb)
Definition: InputPSocketBroker.cc:391
InputPSocketBroker::earliestCycle
virtual int earliestCycle(int cycle, const MoveNode &node, const TTAMachine::Bus *bus, const TTAMachine::FunctionUnit *srcFU, const TTAMachine::FunctionUnit *dstFU, int immWriteCycle, const TTAMachine::ImmediateUnit *immu, int immRegIndex) const override
Definition: InputPSocketBroker.cc:138
InputPSocketBroker::isAlreadyAssigned
virtual bool isAlreadyAssigned(int cycle, const MoveNode &node, const TTAMachine::Bus *) const override
Definition: InputPSocketBroker.cc:183
ResourceBroker.hh
ResourceMapper
Definition: ResourceMapper.hh:51
InputPSocketBroker::inputFUBroker_
ResourceBroker & inputFUBroker_
Definition: InputPSocketBroker.hh:97
TTAMachine
Definition: Assembler.hh:48
InputPSocketBroker::assign
virtual void assign(int cycle, MoveNode &node, SchedulingResource &res, int immWriteCycle, int immRegIndex) override
Definition: InputPSocketBroker.cc:233
InputPSocketBroker::buildResources
virtual void buildResources(const TTAMachine::Machine &target) override
Definition: InputPSocketBroker.cc:318
InputPSocketBroker::InputPSocketBroker
InputPSocketBroker(std::string name, ResourceBroker &fub, unsigned int initiationInterval=0)
Definition: InputPSocketBroker.cc:57
TTAMachine::Machine
Definition: Machine.hh:73
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50