OpenASIP 2.2
Loading...
Searching...
No Matches
ExecutionPipelineResourceTable.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 ExecutionPipelineResourceTable.hh
26 *
27 * Declaration of the ExecutionPipelineResourceTable class.
28 *
29 * @author Heikki Kultala 2009 (heikki.kultala-no-spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_EXECUTION_PIPELINE_RESOURCE_TABLE_HH
34#define TTA_EXECUTION_PIPELINE_RESOURCE_TABLE_HH
35
36#include <string>
37#include <map>
38#include <vector>
39
40namespace TTAMachine {
41 class FunctionUnit;
42}
43
45public:
46 inline unsigned int numberOfResources() const;
47 inline unsigned int pipelineSize() const;
48 inline unsigned int maximalLatency() const;
49
50 inline bool operationPipeline(int op, int cycle, int res) const;
51
52 inline int operationIndex(const std::string& opName) const;
53
54 inline bool hasOperation(const std::string& opName) const;
55
56 inline const std::map<int,int>& operationLatency(
57 unsigned int operationIndex) const;
58
59
60 inline const std::string& name() const;
61
63 const TTAMachine::FunctionUnit& fu);
64
65 static void finalize();
66private:
68
69 void setLatency(
70 const std::string& opName,
71 const int output,
72 const int latency);
73
74 void setResourceUse(
75 const std::string& opName, const int cycle, const int resIndex);
76
77 std::string name_;
78
79 /// Type for resource vector, represents one cycle of use
80 typedef std::vector<bool> ResourceVector;
81
82 /// Type for resource reservation table, resource vector x latency
83 typedef std::vector<ResourceVector> ResourceTable;
84
85 typedef std::map<const TTAMachine::FunctionUnit*,
87
88 /// Resource and ports vector width, depends on particular FU
90 /// Maximal latency of operation in FU
91 unsigned int maximalLatency_;
92 /// Operations supported, name - index to operation pipeline vector
93 std::map<std::string, int> operationSupported_;
94 // latencies of all operations supported by this FU.
95 std::vector<std::map<int,int> > operationLatencies_;
96 /// Pipelines for operations
97 std::vector<ResourceTable> operationPipelines_;
98
99 /// Contains these tables for all FU's
101};
102
104
105#endif
unsigned int maximalLatency() const
std::map< const TTAMachine::FunctionUnit *, ExecutionPipelineResourceTable * > ResourceTableMap
bool hasOperation(const std::string &opName) const
int operationIndex(const std::string &opName) const
std::map< std::string, int > operationSupported_
Operations supported, name - index to operation pipeline vector.
void setLatency(const std::string &opName, const int output, const int latency)
bool operationPipeline(int op, int cycle, int res) const
static const ExecutionPipelineResourceTable & resourceTable(const TTAMachine::FunctionUnit &fu)
void setResourceUse(const std::string &opName, const int cycle, const int resIndex)
std::vector< bool > ResourceVector
Type for resource vector, represents one cycle of use.
const std::map< int, int > & operationLatency(unsigned int operationIndex) const
const std::string & name() const
unsigned int numberOfResources() const
std::vector< ResourceVector > ResourceTable
Type for resource reservation table, resource vector x latency.
std::vector< std::map< int, int > > operationLatencies_
int numberOfResources_
Resource and ports vector width, depends on particular FU.
std::vector< ResourceTable > operationPipelines_
Pipelines for operations.
unsigned int maximalLatency_
Maximal latency of operation in FU.
unsigned int pipelineSize() const
static ResourceTableMap allResourceTables_
Contains these tables for all FU's.