OpenASIP  2.0
CostDBTypes.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 CostDBTypes.hh
26  *
27  * Declaration of CostDBTypes class.
28  *
29  * @author Tommi Rantanen 2004 (tommi.rantanen-no.spam-tut.fi)
30  * @author Jari Mäntyneva 2005 (jari.mantyneva-no.spam-tut.fi)
31  * @note rating: red
32  */
33 
34 
35 #ifndef TTA_COST_DB_TYPES_HH
36 #define TTA_COST_DB_TYPES_HH
37 
38 
39 #include <string>
40 #include <vector>
41 
42 class CostDBEntry;
43 class MatchType;
44 
45 /**
46  * Type definiotions and constant for the cost database.
47  */
48 class CostDBTypes {
49 public:
50  /**
51  * Type of match to be accepted in the database queries for a
52  * certain field.
53  */
54  enum TypeOfMatch {
55  MATCH_ALL, //< All entries accepted.
56  MATCH_EXACT, //< Equally matching entries accepted.
57  MATCH_SUBSET, //< Smaller or equally matching entries accepted.
58  MATCH_SUPERSET, //< Greater or equally matching entries accepted.
59  MATCH_INTERPOLATION //< Interpolation of smaller and greater entries.
60  };
61 
62  /// Entry type for function units.
63  static const std::string EK_UNIT;
64  /// Entry type for register files.
65  static const std::string EK_RFILE;
66  /// Entry type for move bus.
67  static const std::string EK_MBUS;
68  /// Entry type for sockets.
69  static const std::string EK_SOCKET;
70  /// Entry type for input sockets.
71  static const std::string EK_INPUT_SOCKET;
72  /// Entry type for output sockets.
73  static const std::string EK_OUTPUT_SOCKET;
74  /// Entry type for immediate sockets.
75  static const std::string EK_INLINE_IMM_SOCKET;
76 
77  /// Field type for bit width of an entry.
78  static const std::string EKF_BIT_WIDTH;
79  /// Field type for operations supported by an entry.
80  static const std::string EKF_OPERATIONS;
81  /// Field type for latency of an entry.
82  static const std::string EKF_LATENCY;
83  /// Field type for number of registers in an entry.
84  static const std::string EKF_NUM_REGISTERS;
85  /// Field type for number of read ports in an entry.
86  static const std::string EKF_READ_PORTS;
87  /// Field type for number of write ports in an entry.
88  static const std::string EKF_WRITE_PORTS;
89  /// Field type for number of bidirectional ports in an entry.
90  static const std::string EKF_BIDIR_PORTS;
91  /// Field type for number of max simultaneous reads in an entry.
92  static const std::string EKF_MAX_READS;
93  /// Field type for number of max simultaneous writes in an entry.
94  static const std::string EKF_MAX_WRITES;
95  /// Field type for fanin of bus in an entry.
96  static const std::string EKF_BUS_FANIN;
97  /// Field type for fanout of bus in an entry.
98  static const std::string EKF_BUS_FANOUT;
99  /// Field type for fanin of input socket in an entry.
100  static const std::string EKF_INPUT_SOCKET_FANIN;
101  /// Field type for fanout of output socket in an entry.
102  static const std::string EKF_OUTPUT_SOCKET_FANOUT;
103  /// Field type for guard support in an entry.
104  static const std::string EKF_GUARD_SUPPORT;
105  /// Field type for guard latency in an entry.
106  static const std::string EKF_GUARD_LATENCY;
107  /// Field type for function unit entry;
108  static const std::string EKF_FUNCTION_UNIT;
109 
110  /// Table of database entries.
111  typedef std::vector<CostDBEntry*> EntryTable;
112 
113  /// Table of types of match.
114  typedef std::vector<MatchType*> MatchTypeTable;
115 };
116 
117 #endif
CostDBTypes::MATCH_SUPERSET
@ MATCH_SUPERSET
Definition: CostDBTypes.hh:58
CostDBTypes::EK_RFILE
static const std::string EK_RFILE
Entry type for register files.
Definition: CostDBTypes.hh:65
CostDBTypes::EKF_GUARD_SUPPORT
static const std::string EKF_GUARD_SUPPORT
Field type for guard support in an entry.
Definition: CostDBTypes.hh:104
MatchType
Definition: MatchType.hh:49
CostDBTypes::EKF_BIT_WIDTH
static const std::string EKF_BIT_WIDTH
Field type for bit width of an entry.
Definition: CostDBTypes.hh:78
CostDBTypes::MatchTypeTable
std::vector< MatchType * > MatchTypeTable
Table of types of match.
Definition: CostDBTypes.hh:114
CostDBTypes
Definition: CostDBTypes.hh:48
CostDBTypes::EKF_WRITE_PORTS
static const std::string EKF_WRITE_PORTS
Field type for number of write ports in an entry.
Definition: CostDBTypes.hh:88
CostDBTypes::EK_INLINE_IMM_SOCKET
static const std::string EK_INLINE_IMM_SOCKET
Entry type for immediate sockets.
Definition: CostDBTypes.hh:75
CostDBTypes::TypeOfMatch
TypeOfMatch
Definition: CostDBTypes.hh:54
CostDBTypes::EntryTable
std::vector< CostDBEntry * > EntryTable
Table of database entries.
Definition: CostDBTypes.hh:111
CostDBTypes::EK_UNIT
static const std::string EK_UNIT
Entry type for function units.
Definition: CostDBTypes.hh:63
CostDBTypes::MATCH_EXACT
@ MATCH_EXACT
Definition: CostDBTypes.hh:56
CostDBTypes::EKF_NUM_REGISTERS
static const std::string EKF_NUM_REGISTERS
Field type for number of registers in an entry.
Definition: CostDBTypes.hh:84
CostDBTypes::MATCH_INTERPOLATION
@ MATCH_INTERPOLATION
Definition: CostDBTypes.hh:59
CostDBEntry
Definition: CostDBEntry.hh:52
CostDBTypes::EKF_BUS_FANIN
static const std::string EKF_BUS_FANIN
Field type for fanin of bus in an entry.
Definition: CostDBTypes.hh:96
CostDBTypes::EKF_OPERATIONS
static const std::string EKF_OPERATIONS
Field type for operations supported by an entry.
Definition: CostDBTypes.hh:80
CostDBTypes::EK_OUTPUT_SOCKET
static const std::string EK_OUTPUT_SOCKET
Entry type for output sockets.
Definition: CostDBTypes.hh:73
CostDBTypes::EK_INPUT_SOCKET
static const std::string EK_INPUT_SOCKET
Entry type for input sockets.
Definition: CostDBTypes.hh:71
CostDBTypes::EKF_OUTPUT_SOCKET_FANOUT
static const std::string EKF_OUTPUT_SOCKET_FANOUT
Field type for fanout of output socket in an entry.
Definition: CostDBTypes.hh:102
CostDBTypes::MATCH_ALL
@ MATCH_ALL
Definition: CostDBTypes.hh:55
CostDBTypes::EKF_BIDIR_PORTS
static const std::string EKF_BIDIR_PORTS
Field type for number of bidirectional ports in an entry.
Definition: CostDBTypes.hh:90
CostDBTypes::EKF_INPUT_SOCKET_FANIN
static const std::string EKF_INPUT_SOCKET_FANIN
Field type for fanin of input socket in an entry.
Definition: CostDBTypes.hh:100
CostDBTypes::EKF_BUS_FANOUT
static const std::string EKF_BUS_FANOUT
Field type for fanout of bus in an entry.
Definition: CostDBTypes.hh:98
CostDBTypes::MATCH_SUBSET
@ MATCH_SUBSET
Definition: CostDBTypes.hh:57
CostDBTypes::EKF_MAX_WRITES
static const std::string EKF_MAX_WRITES
Field type for number of max simultaneous writes in an entry.
Definition: CostDBTypes.hh:94
CostDBTypes::EKF_FUNCTION_UNIT
static const std::string EKF_FUNCTION_UNIT
Field type for function unit entry;.
Definition: CostDBTypes.hh:108
CostDBTypes::EKF_READ_PORTS
static const std::string EKF_READ_PORTS
Field type for number of read ports in an entry.
Definition: CostDBTypes.hh:86
CostDBTypes::EKF_MAX_READS
static const std::string EKF_MAX_READS
Field type for number of max simultaneous reads in an entry.
Definition: CostDBTypes.hh:92
CostDBTypes::EKF_GUARD_LATENCY
static const std::string EKF_GUARD_LATENCY
Field type for guard latency in an entry.
Definition: CostDBTypes.hh:106
CostDBTypes::EK_MBUS
static const std::string EK_MBUS
Entry type for move bus.
Definition: CostDBTypes.hh:67
CostDBTypes::EKF_LATENCY
static const std::string EKF_LATENCY
Field type for latency of an entry.
Definition: CostDBTypes.hh:82
CostDBTypes::EK_SOCKET
static const std::string EK_SOCKET
Entry type for sockets.
Definition: CostDBTypes.hh:69