TCE  1.22
HDLPort.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2010 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 HDLPort.hh
26  *
27  * Declaration of HDLPort class.
28  *
29  * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_HDL_PORT_HH
34 #define TTA_HDL_PORT_HH
35 
36 #include "TCEString.hh"
37 #include "ProGeTypes.hh"
38 #include "HDBTypes.hh"
39 #include "NetlistPort.hh"
40 
41 namespace ProGe {
42  class NetlistBlock;
43 }
44 
45 
46 /**
47  * Represents a HDL port which is on higher abstraction level than NetlistPort
48  */
49 class HDLPort {
50 public:
51 
52  HDLPort(
53  const TCEString name,
54  const TCEString& widthFormula,
55  ProGe::DataType type,
56  HDB::Direction direction,
57  bool needsInversion);
58 
59  HDLPort(
60  const TCEString name,
61  const TCEString& widthFormula,
62  ProGe::DataType type,
63  HDB::Direction direction,
64  bool needsInversion,
65  int width);
66 
67  HDLPort(const HDLPort& old);
68 
69  HDLPort(const ProGe::NetlistPort& port);
70 
71  TCEString name() const;
72 
73  TCEString widthFormula() const;
74 
75  void updateWidthFormula(const TCEString& widthFormula);
76 
77  bool hasRealWidth() const;
78 
79  int realWidth() const;
80 
81  HDB::Direction direction() const;
82 
83  ProGe::DataType type() const;
84 
85  bool needsInversion() const;
86 
87  ProGe::NetlistPort* convertToNetlistPort(ProGe::NetlistBlock& block) const;
88 
89  void setToStatic(ProGe::StaticSignal value);
90 
91  bool hasStaticValue() const;
92 
93  ProGe::StaticSignal staticValue() const;
94 
95 private:
96 
102  bool hasWidth_;
103  int width_;
106 
107 };
108 
109 #endif
ProGe::DataType type_
Definition: HDLPort.hh:99
TCEString name_
Definition: HDLPort.hh:97
TCEString widthFormula_
Definition: HDLPort.hh:98
DataType
Data types of hardware ports.
Definition: ProGeTypes.hh:46
HDB::Direction direction_
Definition: HDLPort.hh:100
StaticSignal
Definition: NetlistPort.hh:44
ProGe::StaticSignal staticValue_
Definition: HDLPort.hh:105
Definition: HDLPort.hh:41
Direction
Direction of port.
Definition: HDBTypes.hh:40
bool hasWidth_
Definition: HDLPort.hh:102
bool hasStaticValue_
Definition: HDLPort.hh:104
int width_
Definition: HDLPort.hh:103
bool needsInversion_
Definition: HDLPort.hh:101