OpenASIP 2.2
Loading...
Searching...
No Matches
SoftwareBypasser.cc
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 SoftwareBypasser.cc
26 *
27 * Definition of SoftwareBypasser interface.
28 *
29 * @author Pekka Jääskeläinen 2007 (pjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#include "SoftwareBypasser.hh"
34
35#include "MoveNodeGroup.hh"
37#include "ResourceManager.hh"
38
39/**
40 * Empty constructor.
41 */
42SoftwareBypasser::SoftwareBypasser() : bypassCount_(0), deadResultCount_(0){
43}
44
45/**
46 * Empty destructor.
47 */
50
51/**
52 * Apply software bypassing to as many moves in the given MoveNodeGroup
53 * as possible.
54 *
55 * The given DDG can be used to inspect whether software bypassing is possible.
56 *
57 * @param candidates The moves to which apply software bypassing, if possible.
58 * @param ddg The data dependence grap in which the movenodes belong to.
59 * @param rm The resource manager which is used to check for resource
60 * availability.
61 * @param bypassTrigger whether to bypass the trigger or not.
62 * @return The count of bypassed moves.
63 */
64int
66 MoveNodeGroup& candidates,
68 ResourceManager& rm,
69 bool /*bypassTrigger*/) {
70
71 // use the arguments just to avoid compiler warnings with strict flags
72 candidates.nodeCount();
73 ddg.nodeCount();
74 rm.machine();
75 return 0;
76}
77
78/**
79 * Remove software bypassing from as many moves in the given MoveNodeGroup
80 * as possible.
81 *
82 * @param candidates The moves from which to remove software bypassing, if
83 * possible.
84 * @param ddg The data dependence grap in which the movenodes belong to.
85 * @param rm The resource manager which is used to check for resource
86 * availability.
87 */
88void
90 MoveNodeGroup& candidates,
92 ResourceManager& rm) {
93
94 // use the arguments just to avoid compiler warnings with strict flags
95 candidates.nodeCount();
96 ddg.nodeCount();
97 rm.machine();
98 return;
99}
100
101/**
102 * Remove dead result moves for each bypassed move of given MoveNodeGroup
103 * if possible. That is, no other result reads of result exists.
104 * This assumes that result moves in MoveNodeGroup are also scheduled.
105 *
106 * @param candidates The moves for which remove dead result writes
107 * @param ddg The data dependence grap in which the movenodes belong to.
108 * @param rm The resource manager which is used to check for resource
109 * availability.
110 * @param removedMoves The dead result eliminated moves and their original
111 * cycles, to allow rescheduling of moves that were previously
112 * resource (RF write port usually) constrained by the removed moves.
113 * @return number of dead results killed
114 */
115int
117 MoveNodeGroup& candidates,
119 ResourceManager& rm,
120 std::set<std::pair<TTAProgram::Move*, int> >& removedMoves) {
121
122 // use the arguments just to avoid compiler warnings with strict flags
123 candidates.nodeCount();
124 ddg.nodeCount();
125 rm.machine();
126 removedMoves.begin();
127 return 0;
128}
129
130/*
131 * Registers the selector being used to the bypasser.
132 *
133 * If the bypasser has been registered to the selector,
134 * bypasses can notify the selector about dependence changes
135 * (like WAR/WAW edge removal duo bypassing)
136 *
137 * Default implementation is empty, only actual bypasser implementations
138 * implement this.
139 *
140 * @param selector selector which bypasser notifies on some dependence changes.
141 */
142void
int nodeCount() const
int nodeCount() const
const TTAMachine::Machine & machine() const
virtual int removeDeadResults(MoveNodeGroup &candidates, DataDependenceGraph &ddg, ResourceManager &rm, std::set< std::pair< TTAProgram::Move *, int > > &removedMoves)=0
virtual void setSelector(MoveNodeSelector *selector)
virtual ~SoftwareBypasser()
virtual void removeBypass(MoveNodeGroup &candidates, DataDependenceGraph &ddg, ResourceManager &rm)=0
virtual int bypass(MoveNodeGroup &candidates, DataDependenceGraph &ddg, ResourceManager &rm, bool bypassTrigger)=0