OpenASIP  2.0
OutputPSocketBroker.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 OutputPSocketBroker.hh
26  *
27  * Declaration of OutputPSocketBroker class.
28  *
29  * @author Ari Mets�halme 2006 (ari.metsahalme-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_OUTPUT_PSOCKET_BROKER_HH
34 #define TTA_OUTPUT_PSOCKET_BROKER_HH
35 
36 #include "ResourceBroker.hh"
37 #include "SimpleResourceManager.hh"
38 
39 namespace TTAMachine {
40  class Machine;
41  class MachinePart;
42 }
43 
44 class MoveNode;
45 class ResourceMapper;
46 class SchedulingResource;
47 
48 /**
49  * Output p-socket broker.
50  */
52 public:
53  OutputPSocketBroker(std::string name,
54  ResourceBroker& ofb,
56  unsigned int initiationInterval = 0);
57 
58  virtual ~OutputPSocketBroker();
59 
61  int cycle, const MoveNode& node,
62  const TTAMachine::Bus* bus,
63  const TTAMachine::FunctionUnit* srcFU,
64  const TTAMachine::FunctionUnit* dstFU,
65  int immWriteCycle,
66  const TTAMachine::ImmediateUnit* immu,
67  int immRegIndex) const override;
69  int cycle, const MoveNode& node,
70  const TTAMachine::Bus* bus,
71  const TTAMachine::FunctionUnit* srcFU,
72  const TTAMachine::FunctionUnit* dstFU,
73  int immWriteCycle,
74  const TTAMachine::ImmediateUnit* immu,
75  int immRegIndex) const override;
76  virtual void assign(int cycle, MoveNode& node, SchedulingResource& res,
77  int immWriteCycle, int immRegIndex) override;
78 
79  virtual void unassign(MoveNode& node) override;
80 
81  virtual int earliestCycle(int cycle, const MoveNode& node,
82  const TTAMachine::Bus* bus,
83  const TTAMachine::FunctionUnit* srcFU,
84  const TTAMachine::FunctionUnit* dstFU,
85  int immWriteCycle,
86  const TTAMachine::ImmediateUnit* immu,
87  int immRegIndex) const override;
88  virtual int latestCycle(int cycle, const MoveNode& node,
89  const TTAMachine::Bus* bus,
90  const TTAMachine::FunctionUnit* srcFU,
91  const TTAMachine::FunctionUnit* dstFU,
92  int immWriteCycle,
93  const TTAMachine::ImmediateUnit* immu,
94  int immRegIndex) const override;
95  virtual bool isAlreadyAssigned(
96  int cycle, const MoveNode& node,
97  const TTAMachine::Bus* preassignedBus) const override;
98  virtual bool isApplicable(
99  const MoveNode& node, const TTAMachine::Bus* b) const override;
100  virtual void buildResources(const TTAMachine::Machine& target) override;
101  virtual void setupResourceLinks(const ResourceMapper& mapper) override;
102  void setBusBroker(ResourceBroker& sb);
103 private:
106  // Pointer to resource manager, needed to get information about
107  // immediate from IUBroker
109 };
110 
111 #endif
OutputPSocketBroker::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: OutputPSocketBroker.cc:338
OutputPSocketBroker::rm_
SimpleResourceManager * rm_
Definition: OutputPSocketBroker.hh:108
OutputPSocketBroker::outputFUBroker_
ResourceBroker & outputFUBroker_
Definition: OutputPSocketBroker.hh:104
OutputPSocketBroker::assign
virtual void assign(int cycle, MoveNode &node, SchedulingResource &res, int immWriteCycle, int immRegIndex) override
Definition: OutputPSocketBroker.cc:237
TTAMachine::Bus
Definition: Bus.hh:53
OutputPSocketBroker::~OutputPSocketBroker
virtual ~OutputPSocketBroker()
Definition: OutputPSocketBroker.cc:69
OutputPSocketBroker::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: OutputPSocketBroker.cc:82
ResourceBroker
Definition: ResourceBroker.hh:61
MoveNode
Definition: MoveNode.hh:65
OutputPSocketBroker::setBusBroker
void setBusBroker(ResourceBroker &sb)
Definition: OutputPSocketBroker.cc:511
SchedulingResourceSet
Definition: SchedulingResource.hh:161
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
OutputPSocketBroker::isApplicable
virtual bool isApplicable(const MoveNode &node, const TTAMachine::Bus *b) const override
Definition: OutputPSocketBroker.cc:398
OutputPSocketBroker::setupResourceLinks
virtual void setupResourceLinks(const ResourceMapper &mapper) override
Definition: OutputPSocketBroker.cc:452
OutputPSocketBroker::isAlreadyAssigned
virtual bool isAlreadyAssigned(int cycle, const MoveNode &node, const TTAMachine::Bus *preassignedBus) const override
Definition: OutputPSocketBroker.cc:362
SchedulingResource
Definition: SchedulingResource.hh:52
OutputPSocketBroker::OutputPSocketBroker
OutputPSocketBroker(std::string name, ResourceBroker &ofb, SimpleResourceManager *, unsigned int initiationInterval=0)
Definition: OutputPSocketBroker.cc:57
OutputPSocketBroker
Definition: OutputPSocketBroker.hh:51
OutputPSocketBroker::buildResources
virtual void buildResources(const TTAMachine::Machine &target) override
Definition: OutputPSocketBroker.cc:429
OutputPSocketBroker::unassign
virtual void unassign(MoveNode &node) override
Definition: OutputPSocketBroker.cc:294
OutputPSocketBroker::isAnyResourceAvailable
bool isAnyResourceAvailable(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: OutputPSocketBroker.cc:155
ResourceBroker.hh
ResourceMapper
Definition: ResourceMapper.hh:51
SimpleResourceManager.hh
SimpleResourceManager
Definition: SimpleResourceManager.hh:58
OutputPSocketBroker::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: OutputPSocketBroker.cc:316
TTAMachine
Definition: Assembler.hh:48
OutputPSocketBroker::busBroker_
ResourceBroker * busBroker_
Definition: OutputPSocketBroker.hh:105
TTAMachine::Machine
Definition: Machine.hh:73
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50