torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PortDelay.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef TORC_GENERIC_PORTDELAY_HPP
17 #define TORC_GENERIC_PORTDELAY_HPP
18 
19 #ifdef GENOM_SERIALIZATION
20 #include <boost/serialization/access.hpp>
21 #endif //GENOM_SERIALIZATION
24 #include "torc/generic/Value.hpp"
25 
26 namespace torc {
27 namespace generic {
28 
29 /**
30  * @brief Represents the portDelay attribute on Port or PortReference
31  *
32  * The Portdelay class stores the delay inSource for a port. Currently it supports storing only
33  * static delay values. Load dependent delay inSource support (using the loadDelay construct) is
34  * not present.
35  */
36 class PortDelay {
37 public:
38  /**
39  * @enum DelayType
40  *
41  * Types of possible delay
42  */
43  enum Type {
45  };
46 #ifdef GENOM_SERIALIZATION
47  friend class boost::serialization::access;
48 #endif //GENOM_SERIALIZATION
49 public:
50  /**
51  * Get derivation
52  *
53  * @return Derivation value
54  */
55  inline const Derivation getDerivation() const;
56 
57  /**
58  * Set derivation
59  *
60  * @param[in] inSource Derivation inSource
61  */
62  void setDerivation(const Derivation& inSource);
63 
64  /**
65  * Get whether value is delay or loadDelay
66  *
67  * @return Type
68  */
69  inline const PortDelay::Type getType() const;
70 
71  /**
72  * Set whether value is delay or loadDelay
73  *
74  * @param[in] inSource Type of data
75  */
76  void setType(Type inSource);
77 
78  /**
79  * Get delay
80  *
81  * @return MiNoMax value
82  */
83  inline const Value::MiNoMax getDelay() const;
84 
85  /**
86  * Set delay
87  *
88  * @param[in] inSource Delay value.
89  */
90  void setDelay(const Value::MiNoMax& inSource);
91 
92  /**
93  * Get the AcLoad value. This is valid when value type is loadDelay
94  *
95  * @return MiNoMax value
96  */
97  inline const Value::MiNoMax getAcLoad() const;
98 
99  /**
100  * Set AC Load
101  *
102  * @param[in] inSource Load value
103  */
104  void setAcLoad(const Value::MiNoMax& inSource);
105 
106  /**
107  * Get the pointer to logic state value(transition/becomes).
108  *
109  * @return Pointer to logic state value(transition/becomes).
110  */
111  inline const LogicElementSharedPtr getTransition() const;
112 
113  /**
114  * Set the pointer to logic state value(transition/becomes).
115  *
116  * @param[in] inSource Pointer to logic state value(transition/becomes).
117  */
118  void setTransition(const LogicElementSharedPtr& inSource);
119 
120  PortDelay();
121 
122  ~PortDelay() throw ();
123 
124  PortDelay(const PortDelay& source);
125 
126  PortDelay&
127  operator=(const PortDelay& source);
128 
129 private:
130 #ifdef GENOM_SERIALIZATION
131  template <class Archive> void serialize(Archive& ar, unsigned int);
132 #endif //GENOM_SERIALIZATION
138 };
139 
140 inline const Derivation PortDelay::getDerivation() const {
141  return mDerivation;
142 }
143 
144 inline const PortDelay::Type PortDelay::getType() const {
145  return mType;
146 }
147 
148 inline const Value::MiNoMax PortDelay::getDelay() const {
149  return mDelay;
150 }
151 
152 inline const Value::MiNoMax PortDelay::getAcLoad() const {
153  return mAcLoad;
154 }
155 
156 /**
157  * Get the pointer to logic state value(transition/becomes).
158  *
159  * @return Pointer to logic state value(transition/becomes).
160  */
162  return mTransition;
163 }
164 
165 } // namespace generic
166 } // namespace torc
167 
168 #endif // TORC_GENERIC_PORTDELAY_HPP
LogicElementSharedPtr mTransition
Definition: PortDelay.hpp:137
Value::MiNoMax mDelay
Definition: PortDelay.hpp:135
boost::shared_ptr< LogicElement > LogicElementSharedPtr
const Value::MiNoMax getDelay() const
Definition: PortDelay.hpp:148
Represents the portDelay attribute on Port or PortReference.
Definition: PortDelay.hpp:36
void setAcLoad(const Value::MiNoMax &inSource)
Definition: PortDelay.cpp:42
const Value::MiNoMax getAcLoad() const
Definition: PortDelay.hpp:152
void setDelay(const Value::MiNoMax &inSource)
Definition: PortDelay.cpp:38
const Derivation getDerivation() const
Definition: PortDelay.hpp:140
void setType(Type inSource)
Definition: PortDelay.cpp:34
void setDerivation(const Derivation &inSource)
Definition: PortDelay.cpp:30
const LogicElementSharedPtr getTransition() const
Definition: PortDelay.hpp:161
Value::MiNoMax mAcLoad
Definition: PortDelay.hpp:136
void setTransition(const LogicElementSharedPtr &inSource)
Definition: PortDelay.cpp:46
const PortDelay::Type getType() const
Definition: PortDelay.hpp:144