torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::physical::Design Class Reference

Physical netlist design. More...

#include <Design.hpp>

+ Inheritance diagram for torc::physical::Design:
+ Collaboration diagram for torc::physical::Design:

Public Types

typedef
ModuleSharedPtrVector::const_iterator 
ModuleSharedPtrConstIterator
 Constant iterator for Module shared pointers. More...
 
typedef
ModuleSharedPtrVector::iterator 
ModuleSharedPtrIterator
 Non-constant iterator for Module shared pointers. More...
 
typedef
InstanceSharedPtrVector::const_iterator 
InstanceSharedPtrConstIterator
 Constant iterator to Instance shared pointers. More...
 
typedef
InstanceSharedPtrVector::iterator 
InstanceSharedPtrIterator
 Non-constant iterator to Instance shared pointers. More...
 
typedef
NetSharedPtrVector::const_iterator 
NetSharedPtrConstIterator
 Constant iterator to Net shared pointers. More...
 
typedef
NetSharedPtrVector::iterator 
NetSharedPtrIterator
 Non-constant iterator to Net shared pointers. More...
 
typedef const_iterator const_iterator
 Constant iterator to {setting,Config} pairs. More...
 
enum  EAnnotationType {
  ePlacerInstanceTypeIndex, ePlacerInstanceSitePtr, ePlacerInstanceDependentInstanceAbove, ePlacerInstanceDependsOnInstanceBelow,
  eRouterNetTilewireSources, eRouterNetTilewireSinks, eRouterNetArcList, eRouterNetRouteNodePtrVector,
  eRouterNetRouteTime, eRouterNetArcVector, eAnnotationGlobalRouter, eAnnotationCount
}
 Enumeration for all types of annotations. More...
 

Public Member Functions

ModuleSharedPtrIterator findModule (const string &inName)
 Find a design module by name. More...
 
bool addModule (ModuleSharedPtr &inModulePtr)
 Add a module to the design. More...
 
bool removeModule (ModuleSharedPtr &inModulePtr)
 Remove a module from the design. More...
 
const stringgetDevice (void) const
 Returns the target device for this design. More...
 
const stringgetPackage (void) const
 Returns the device package for this design. More...
 
const stringgetSpeedGrade (void) const
 Returns the device speed grade for this design. More...
 
const stringgetXdlVersion (void) const
 Returns the XDL version for this design. More...
 
void setDevice (const string &inDevice)
 Sets the target device for this design. More...
 
void setPackage (const string &inPackage)
 Sets the device package for this design. More...
 
void setSpeedGrade (const string &inSpeedGrade)
 Sets the device speed grade for this design. More...
 
void setXdlVersion (const string &inXdlVersion)
 Sets the XDL version for this design. More...
 
size_t getModuleCount (void) const
 Returns the number of modules in the design. More...
 
ModuleSharedPtrConstIterator modulesBegin (void) const
 Returns the begin constant iterator for modules. More...
 
ModuleSharedPtrConstIterator modulesEnd (void) const
 Returns the end constant iterator for modules. More...
 
ModuleSharedPtrIterator modulesBegin (void)
 Returns the begin non-constant iterator for modules. More...
 
ModuleSharedPtrIterator modulesEnd (void)
 Returns the end non-constant iterator for modules. More...
 
InstanceSharedPtrIterator findInstance (const string &inName)
 Find a circuit instance by name. More...
 
bool addInstance (InstanceSharedPtr &inInstancePtr)
 Add an instance to the circuit. More...
 
bool removeInstance (InstanceSharedPtr &inInstancePtr)
 Remove an instance from the circuit. More...
 
void unplace (void)
 Unplace the circuit by discarding placement information for each instance. More...
 
NetSharedPtrIterator findNet (const string &inName)
 Find a circuit net by name. More...
 
bool addNet (NetSharedPtr &inNetPtr)
 Add a net to the circuit. More...
 
bool removeNet (NetSharedPtr &inNetPtr)
 Remove a net from the circuit. More...
 
void unroute (void)
 Unroute the circuit by discarding routing information for each net. More...
 
InstanceSharedPtrConstIterator instancesBegin (void) const
 Returns the begin constant iterator for instances. More...
 
InstanceSharedPtrIterator instancesBegin (void)
 Returns the begin non-constant iterator for instances. More...
 
InstanceSharedPtrConstIterator instancesEnd (void) const
 Returns the end constant iterator for instances. More...
 
InstanceSharedPtrIterator instancesEnd (void)
 Returns the end non-constant iterator for instances. More...
 
size_t getInstanceCount (void) const
 Returns the number of instances in the circuit. More...
 
NetSharedPtrConstIterator netsBegin (void) const
 Returns the begin constant iterator for nets. More...
 
NetSharedPtrIterator netsBegin (void)
 Returns the begin non-constant iterator for nets. More...
 
NetSharedPtrConstIterator netsEnd (void) const
 Returns the end constant iterator for nets. More...
 
NetSharedPtrIterator netsEnd (void)
 Returns the end non-constant iterator for nets. More...
 
size_t getNetCount (void) const
 Returns the number of nets in the circuit. More...
 
const stringgetName (void) const
 Returns the object name. More...
 
bool operator== (const Named &rhs) const
 Equality operator. More...
 
const WeakPtrTypegetParentWeakPtr (void) const
 Returns a weak pointer to the parent. More...
 
void setParentWeakPtr (WeakPtrType inParentPtr)
 Sets the weak pointer to the parent. More...
 
void resetParentWeakPtr (void)
 Method to reset and orphan this object. More...
 
const SharedPtrTypegetParentSharedPtr (void) const
 Returns a shared pointer to the parent (WARNING: Does not work right). More...
 
const_iterator configBegin (void) const
 Returns the begin constant iterator for configurations. More...
 
const_iterator configEnd (void) const
 Returns the end constant iterator for configurations. More...
 
size_t getConfigCount (void) const
 Returns the number of configurations in the map. More...
 
bool configIsEmpty (void) const
 Returns true if the configuration map is empty. More...
 
void clearConfig (void)
 Clears the configuration map. More...
 
bool hasConfig (const string &inSetting) const
 Returns true if the specified setting exists in the map. More...
 
bool getConfig (const string &inSetting, Config &outConfig)
 Looks up the specified setting in the map. More...
 
bool getConfig (const string &inSetting, string &outName, string &outValue)
 Looks up the specified setting in the map. More...
 
void setConfig (const string &inSetting, const Config &inConfig)
 Sets the configuration for the given setting. More...
 
void setConfig (const string &inSetting, const string &inName, const string &inValue)
 Sets the configuration for the given setting. More...
 
bool removeConfig (const string &inSetting)
 Removes the named configuration. More...
 
void addConfigs (const ConfigMap &inConfigMap)
 Merges the configurations from the given ConfigMap into this one. More...
 
std::pair< iterator, iterator > getMultiConfigValues (const string &inSetting)
 Returns a range that encompasses all of the configurations for the given setting. More...
 
size_type getMultiConfigCount (const string &inSetting)
 Returns the number of configurations for the given setting. More...
 
boost::any getAnnotation (uint32 inKey)
 Get an annotation. Returns an empty annotation if the index doesn't exist. More...
 
void setAnnotation (uint32 inKey, boost::any inValue)
 Set an annotation. More...
 
void removeAnnotation (uint32 inKey)
 Remove an annotation. More...
 
bool hasAnnotation (uint32 inKey)
 Check if an annotation exists. More...
 

Static Public Member Functions

static bool allowConfigDuplicates (const string &inSetting)
 Returns true if multiple configurations are allowed for the given setting. More...
 

Protected Types

typedef std::string string
 Imported type name. More...
 
typedef boost::int64_t int64_t
 Imported type name. More...
 
typedef std::map< std::string,
int64_t
NameToIndexMap
 Map from an element name to a vector index. More...
 
typedef boost::weak_ptr< class
Circuit
WeakPtrType
 Weak pointer of our own type. More...
 
typedef boost::weak_ptr< class
Circuit
WeakPtrType
 Weak pointer of our own type. More...
 
typedef boost::shared_ptr
< class Circuit
SharedPtrType
 Shared pointer of our own type. More...
 
typedef boost::shared_ptr
< class Circuit
SharedPtrType
 Shared pointer of our own type. More...
 
typedef std::multimap
< std::string, Config
super
 Convenience typedef to represent our superclass. More...
 

Protected Member Functions

 Design (const string &inName, const string &inDevice, const string &inPackage, const string &inSpeedGrade, const string &inXdlVersion)
 Protected constructor. Designs must be created by the Factory. More...
 
void setSelfWeakPtr (WeakPtrType inSelfPtr)
 Sets the weak pointer to this object. More...
 
const WeakPtrTypegetSelfWeakPtr (void) const
 Returns a weak pointer to this object. More...
 

Protected Attributes

ModuleSharedPtrVector mModules
 Vector of module shared pointers. More...
 
string mDevice
 The target device specified for this design. More...
 
string mPackage
 The device package specified for this design. More...
 
string mSpeedGrade
 The device speed grade specified for this design. More...
 
string mXdlVersion
 The XDL version specified for this design. More...
 
InstanceSharedPtrVector mInstances
 Vector of Instance shared pointers for the circuit. More...
 
NameToIndexMap mInstanceMap
 Instance name to index mapping for this circuit. More...
 
NetSharedPtrVector mNets
 Vector of Net shared pointers for the circuit. More...
 
NameToIndexMap mNetMap
 Net name to index mapping for this circuit. More...
 
string mName
 The name of the object. More...
 
WeakPtrType mParentWeakPtr
 Weak pointer to the parent. More...
 
SequenceIndex mNextSequenceIndex
 Sequence index to use for the next configuration added to this map. More...
 
boost::unordered_map
< boost::uint32_t, boost::any > 
mAnnotations
 Map containing any annotations. More...
 
WeakPtrType mSelfWeakPtr
 Weak pointer this object. More...
 

Friends

class Factory
 The Factory class has direct access to our internals. More...
 

Detailed Description

Physical netlist design.

The design is the top-level entity. It consists of an arbitrary number of modules, instances, and nets.

Design objects must be created by the Factory class.

Definition at line 33 of file physical/Design.hpp.

Member Typedef Documentation

Constant iterator to {setting,Config} pairs.

Definition at line 52 of file ConfigMap.hpp.

typedef InstanceSharedPtrVector::const_iterator torc::physical::Circuit::InstanceSharedPtrConstIterator
inherited

Constant iterator to Instance shared pointers.

Definition at line 72 of file Circuit.hpp.

typedef InstanceSharedPtrVector::iterator torc::physical::Circuit::InstanceSharedPtrIterator
inherited

Non-constant iterator to Instance shared pointers.

Definition at line 74 of file Circuit.hpp.

typedef boost::int64_t torc::physical::Circuit::int64_t
protectedinherited

Imported type name.

Definition at line 53 of file Circuit.hpp.

typedef ModuleSharedPtrVector::const_iterator torc::physical::Design::ModuleSharedPtrConstIterator

Constant iterator for Module shared pointers.

Definition at line 66 of file physical/Design.hpp.

typedef ModuleSharedPtrVector::iterator torc::physical::Design::ModuleSharedPtrIterator

Non-constant iterator for Module shared pointers.

Definition at line 68 of file physical/Design.hpp.

typedef std::map<std::string, int64_t> torc::physical::Circuit::NameToIndexMap
protectedinherited

Map from an element name to a vector index.

Definition at line 55 of file Circuit.hpp.

typedef NetSharedPtrVector::const_iterator torc::physical::Circuit::NetSharedPtrConstIterator
inherited

Constant iterator to Net shared pointers.

Definition at line 76 of file Circuit.hpp.

typedef NetSharedPtrVector::iterator torc::physical::Circuit::NetSharedPtrIterator
inherited

Non-constant iterator to Net shared pointers.

Definition at line 78 of file Circuit.hpp.

typedef boost::shared_ptr<class Circuit > torc::physical::Progeny< class Circuit >::SharedPtrType
protectedinherited

Shared pointer of our own type.

Definition at line 35 of file Progeny.hpp.

typedef boost::shared_ptr<class Circuit > torc::physical::Progenitor< class Circuit >::SharedPtrType
protectedinherited

Shared pointer of our own type.

Definition at line 52 of file Progenitor.hpp.

typedef std::string torc::physical::Design::string
protected

Imported type name.

Definition at line 40 of file physical/Design.hpp.

typedef std::multimap<std::string, Config> torc::physical::ConfigMap::super
protectedinherited

Convenience typedef to represent our superclass.

Definition at line 45 of file ConfigMap.hpp.

typedef boost::weak_ptr<class Circuit > torc::physical::Progeny< class Circuit >::WeakPtrType
protectedinherited

Weak pointer of our own type.

Definition at line 33 of file Progeny.hpp.

typedef boost::weak_ptr<class Circuit > torc::physical::Progenitor< class Circuit >::WeakPtrType
protectedinherited

Weak pointer of our own type.

Definition at line 50 of file Progenitor.hpp.

Member Enumeration Documentation

Enumeration for all types of annotations.

Enumerator
ePlacerInstanceTypeIndex 
ePlacerInstanceSitePtr 
ePlacerInstanceDependentInstanceAbove 
ePlacerInstanceDependsOnInstanceBelow 
eRouterNetTilewireSources 
eRouterNetTilewireSinks 
eRouterNetArcList 
eRouterNetRouteNodePtrVector 
eRouterNetRouteTime 
eRouterNetArcVector 
eAnnotationGlobalRouter 
eAnnotationCount 

Definition at line 57 of file Annotated.hpp.

Constructor & Destructor Documentation

torc::physical::Design::Design ( const string inName,
const string inDevice,
const string inPackage,
const string inSpeedGrade,
const string inXdlVersion 
)
inlineprotected

Protected constructor. Designs must be created by the Factory.

Parameters
inNameThe design name.
inDeviceThe design device.
inPackageThe device package.
inSpeedGradeThe device speed grade.
inXdlVersionThe design XDL version.

Definition at line 59 of file physical/Design.hpp.

60  : Circuit(inName),
61  mDevice(inDevice), mPackage(inPackage), mSpeedGrade(inSpeedGrade),
62  mXdlVersion(inXdlVersion) {}
string mXdlVersion
The XDL version specified for this design.
Circuit(const string &inName)
Protected constructor. Circuit objects cannot be instantiated.
Definition: Circuit.hpp:68
string mSpeedGrade
The device speed grade specified for this design.
string mPackage
The device package specified for this design.
string mDevice
The target device specified for this design.

Member Function Documentation

void torc::physical::ConfigMap::addConfigs ( const ConfigMap inConfigMap)
inlineinherited

Merges the configurations from the given ConfigMap into this one.

For each setting, if the setting does not already exist in the map, it is added. If the setting does exist, then the incoming configuration either replaces the existing setting (in the case of regular settings), or is added to the map (in the case of special settings for which multiple configurations are allowed).

Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 159 of file ConfigMap.hpp.

159  {
160  if(inConfigMap.empty()) return;
161  /// \todo Acquire mutex.
162  const_iterator p = inConfigMap.begin();
163  const_iterator e = inConfigMap.end();
164  while(p != e) {
165  // look up the config information
166  const string& setting = p->first;
167  const Config& config = p->second;
168  // try to insert the setting into the map (while respecting our special semantics)
169  setConfig(setting, config);
170  p++;
171  }
172  /// \todo Release mutex.
173  }
void setConfig(const string &inSetting, const Config &inConfig)
Sets the configuration for the given setting.
Definition: ConfigMap.hpp:119
const_iterator const_iterator
Constant iterator to {setting,Config} pairs.
Definition: ConfigMap.hpp:52

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::physical::Circuit::addInstance ( InstanceSharedPtr inInstancePtr)
inlineinherited

Add an instance to the circuit.

Parameters
inInstancePtrThe instance to add.
Returns
true if the instance was added, or false if an instance with the same name already exists in the circuit.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 94 of file Circuit.hpp.

94  {
95  /// \todo Acquire mutex.
96  const std::string& name = inInstancePtr->getName();
99  if(result != e) return false;
100  inInstancePtr->setParentWeakPtr(mParentWeakPtr);
101  mInstanceMap[name] = mInstances.size();
102  mInstances.push_back(inInstancePtr);
103  return true;
104  /// \todo Release mutex.
105  }
NameToIndexMap mInstanceMap
Instance name to index mapping for this circuit.
Definition: Circuit.hpp:60
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
std::string string
InstanceSharedPtrIterator findInstance(const string &inName)
Find a circuit instance by name.
Definition: Circuit.hpp:84
InstanceSharedPtrVector mInstances
Vector of Instance shared pointers for the circuit.
Definition: Circuit.hpp:58
InstanceSharedPtrVector::iterator InstanceSharedPtrIterator
Non-constant iterator to Instance shared pointers.
Definition: Circuit.hpp:74

+ Here is the call graph for this function:

bool torc::physical::Design::addModule ( ModuleSharedPtr inModulePtr)
inline

Add a module to the design.

Parameters
inModulePtrThe module to add.
Returns
true if the module was added, or false if a module with the same name already exists in the design.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 82 of file physical/Design.hpp.

82  {
83  /// \todo Acquire mutex.
84  ModuleSharedPtrVector::iterator e = mModules.end();
85  ModuleSharedPtrVector::iterator result = findModule(inModulePtr->getName());
86  if(result == e) mModules.push_back(inModulePtr);
87  inModulePtr->setParentWeakPtr(mSelfWeakPtr);
88  return result == e; // return true if we added the module
89  /// \todo Release mutex.
90  }
ModuleSharedPtrVector mModules
Vector of module shared pointers.
ModuleSharedPtrIterator findModule(const string &inName)
Find a design module by name.
WeakPtrType mSelfWeakPtr
Weak pointer this object.
Definition: Progenitor.hpp:57

+ Here is the call graph for this function:

bool torc::physical::Circuit::addNet ( NetSharedPtr inNetPtr)
inlineinherited

Add a net to the circuit.

Parameters
inNetPtrThe net to add.
Returns
true if the net was added, or false if a net with the same name already exists in the circuit.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 151 of file Circuit.hpp.

151  {
152  /// \todo Acquire mutex.
153  const std::string& name = inNetPtr->getName();
154  NetSharedPtrIterator e = mNets.end();
155  NetSharedPtrIterator result = findNet(name);
156  if(result != e) return false;
157  inNetPtr->setParentWeakPtr(mParentWeakPtr);
158  mNetMap[name] = mNets.size();
159  mNets.push_back(inNetPtr);
160  return true;
161  /// \todo Release mutex.
162  }
NetSharedPtrVector mNets
Vector of Net shared pointers for the circuit.
Definition: Circuit.hpp:62
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
std::string string
NetSharedPtrIterator findNet(const string &inName)
Find a circuit net by name.
Definition: Circuit.hpp:141
NetSharedPtrVector::iterator NetSharedPtrIterator
Non-constant iterator to Net shared pointers.
Definition: Circuit.hpp:78
NameToIndexMap mNetMap
Net name to index mapping for this circuit.
Definition: Circuit.hpp:64

+ Here is the call graph for this function:

static bool torc::physical::ConfigMap::allowConfigDuplicates ( const string inSetting)
inlinestaticinherited

Returns true if multiple configurations are allowed for the given setting.

Special Xilinx settings prefixed with an underscore may have multiple configurations in the map.

Definition at line 177 of file ConfigMap.hpp.

177  {
178  return inSetting.size() >= 1 && inSetting[0] == '_';
179  }

+ Here is the caller graph for this function:

void torc::physical::ConfigMap::clearConfig ( void  )
inlineinherited

Clears the configuration map.

Definition at line 67 of file ConfigMap.hpp.

67 { ConfigMap::clear(); }

+ Here is the caller graph for this function:

const_iterator torc::physical::ConfigMap::configBegin ( void  ) const
inlineinherited

Returns the begin constant iterator for configurations.

Definition at line 58 of file ConfigMap.hpp.

58 { return super::begin(); }

+ Here is the caller graph for this function:

const_iterator torc::physical::ConfigMap::configEnd ( void  ) const
inlineinherited

Returns the end constant iterator for configurations.

Definition at line 60 of file ConfigMap.hpp.

60 { return super::end(); }

+ Here is the caller graph for this function:

bool torc::physical::ConfigMap::configIsEmpty ( void  ) const
inlineinherited

Returns true if the configuration map is empty.

Definition at line 65 of file ConfigMap.hpp.

65 { return super::empty(); }

+ Here is the caller graph for this function:

InstanceSharedPtrIterator torc::physical::Circuit::findInstance ( const string inName)
inlineinherited

Find a circuit instance by name.

Parameters
inNameThe instance name to look for.
Returns
an iterator for the specified instance, or instancesEnd() if the name was not found.

Definition at line 84 of file Circuit.hpp.

84  {
85  NameToIndexMap::iterator result = mInstanceMap.find(inName);
86  NameToIndexMap::iterator e = mInstanceMap.end();
87  if(result == e) return instancesEnd();
88  return instancesBegin() + result->second;
89  }
NameToIndexMap mInstanceMap
Instance name to index mapping for this circuit.
Definition: Circuit.hpp:60
InstanceSharedPtrConstIterator instancesBegin(void) const
Returns the begin constant iterator for instances.
Definition: Circuit.hpp:197
InstanceSharedPtrConstIterator instancesEnd(void) const
Returns the end constant iterator for instances.
Definition: Circuit.hpp:199

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ModuleSharedPtrIterator torc::physical::Design::findModule ( const string inName)
inline

Find a design module by name.

Parameters
inNameThe module name to look for.
Returns
an iterator for the specified module, or modulesEnd() if the name was not found.

Definition at line 74 of file physical/Design.hpp.

74  {
75  NameComparator predicate(inName);
76  return std::find_if(modulesBegin(), modulesEnd(), predicate);
77  }
ModuleSharedPtrConstIterator modulesEnd(void) const
Returns the end constant iterator for modules.
ModuleSharedPtrConstIterator modulesBegin(void) const
Returns the begin constant iterator for modules.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

NetSharedPtrIterator torc::physical::Circuit::findNet ( const string inName)
inlineinherited

Find a circuit net by name.

Parameters
inNameThe net name to look for.
Returns
an iterator to the specified net, or netsEnd() if the name was not found.

Definition at line 141 of file Circuit.hpp.

141  {
142  NameToIndexMap::iterator result = mNetMap.find(inName);
143  NameToIndexMap::iterator e = mNetMap.end();
144  if(result == e) return netsEnd();
145  return netsBegin() + result->second;
146  }
NetSharedPtrConstIterator netsEnd(void) const
Returns the end constant iterator for nets.
Definition: Circuit.hpp:209
NameToIndexMap mNetMap
Net name to index mapping for this circuit.
Definition: Circuit.hpp:64
NetSharedPtrConstIterator netsBegin(void) const
Returns the begin constant iterator for nets.
Definition: Circuit.hpp:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

boost::any torc::common::Annotated::getAnnotation ( uint32  inKey)
inlineinherited

Get an annotation. Returns an empty annotation if the index doesn't exist.

Definition at line 45 of file Annotated.hpp.

45 { return mAnnotations[inKey]; }
boost::unordered_map< boost::uint32_t, boost::any > mAnnotations
Map containing any annotations.
Definition: Annotated.hpp:34

+ Here is the caller graph for this function:

bool torc::physical::ConfigMap::getConfig ( const string inSetting,
Config outConfig 
)
inlineinherited

Looks up the specified setting in the map.

Parameters
inSettingThe setting to query.
outConfigReference to a configuration to be populated if the setting exists in the map. Default values are used if the setting does not exist.
Note
If this is a special setting with multiple configuration entries, only the first one will be placed in outConfig.
Returns
true if the settings exists in the map, or false otherwise.

Definition at line 82 of file ConfigMap.hpp.

82  {
83  // employ friendship status to reach in and reference the config name and value members
84  return getConfig(inSetting, outConfig.mName, outConfig.mValue);
85  }
bool getConfig(const string &inSetting, Config &outConfig)
Looks up the specified setting in the map.
Definition: ConfigMap.hpp:82

+ Here is the caller graph for this function:

bool torc::physical::ConfigMap::getConfig ( const string inSetting,
string outName,
string outValue 
)
inlineinherited

Looks up the specified setting in the map.

Parameters
inSettingThe setting to query.
outNameReference to a string to accept the configuration name, or the default name if the setting does not exist.
outValueReference to a string to accept the configuration value, or the default value if the setting does not exist.
Note
If this is a special setting with multiple configuration entries, only the first one will be placed in outName and outValue.
Returns
true if the settings exists in the map, or false otherwise.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 95 of file ConfigMap.hpp.

95  {
96  /// \todo Acquire mutex.
97  iterator result = find(inSetting);
98  if(result == end()) {
99  // if the key doesn't exist, return default values
100  outName = Config::sConfigDefaultName;
101  outValue = Config::sConfigDefaultValue;
102  return false;
103  } else {
104  // otherwise return the config data
105  Config& config = result->second;
106  outName = config.getName();
107  outValue = config.getValue();
108  return true;
109  }
110  /// \todo Release mutex.
111  }
static const char * sConfigDefaultValue
Default configuration value.
Definition: Config.hpp:53
static const char * sConfigDefaultName
Default configuration name.
Definition: Config.hpp:51

+ Here is the call graph for this function:

size_t torc::physical::ConfigMap::getConfigCount ( void  ) const
inlineinherited

Returns the number of configurations in the map.

Definition at line 63 of file ConfigMap.hpp.

63 { return super::size(); }

+ Here is the caller graph for this function:

const string& torc::physical::Design::getDevice ( void  ) const
inline

Returns the target device for this design.

Definition at line 105 of file physical/Design.hpp.

105 { return mDevice; }
string mDevice
The target device specified for this design.

+ Here is the caller graph for this function:

size_t torc::physical::Circuit::getInstanceCount ( void  ) const
inlineinherited

Returns the number of instances in the circuit.

Definition at line 205 of file Circuit.hpp.

205 { return mInstances.size(); }
InstanceSharedPtrVector mInstances
Vector of Instance shared pointers for the circuit.
Definition: Circuit.hpp:58
size_t torc::physical::Design::getModuleCount ( void  ) const
inline

Returns the number of modules in the design.

Definition at line 121 of file physical/Design.hpp.

121 { return mModules.size(); }
ModuleSharedPtrVector mModules
Vector of module shared pointers.
size_type torc::physical::ConfigMap::getMultiConfigCount ( const string inSetting)
inlineinherited

Returns the number of configurations for the given setting.

Definition at line 186 of file ConfigMap.hpp.

186 { return count(inSetting); }

+ Here is the caller graph for this function:

std::pair<iterator, iterator> torc::physical::ConfigMap::getMultiConfigValues ( const string inSetting)
inlineinherited

Returns a range that encompasses all of the configurations for the given setting.

Returns
An iterator pair that encompasses all configurations for the setting. Refer to std::pair to determine how to extract the iterators.

Definition at line 183 of file ConfigMap.hpp.

184  { return equal_range(inSetting); }

+ Here is the caller graph for this function:

const string& torc::physical::Named::getName ( void  ) const
inlineinherited

Returns the object name.

Definition at line 51 of file Named.hpp.

51 { return mName; }
string mName
The name of the object.
Definition: Named.hpp:43

+ Here is the caller graph for this function:

size_t torc::physical::Circuit::getNetCount ( void  ) const
inlineinherited

Returns the number of nets in the circuit.

Definition at line 215 of file Circuit.hpp.

215 { return mNets.size(); }
NetSharedPtrVector mNets
Vector of Net shared pointers for the circuit.
Definition: Circuit.hpp:62
const string& torc::physical::Design::getPackage ( void  ) const
inline

Returns the device package for this design.

Definition at line 107 of file physical/Design.hpp.

107 { return mPackage; }
string mPackage
The device package specified for this design.

+ Here is the caller graph for this function:

const SharedPtrType& torc::physical::Progeny< class Circuit >::getParentSharedPtr ( void  ) const
inlineinherited

Returns a shared pointer to the parent (WARNING: Does not work right).

Always seems to generate a "Returning reference to temporary" warning, and I cannot figure out why.

It is the caller's responsibility to reset the shared pointer when done.

Todo:
Figure out why Progeny<T>::getParentSharedPtr() yields a "Returning reference to temporary" warning.

Definition at line 59 of file Progeny.hpp.

59 { return mParentWeakPtr.lock(); }
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
const WeakPtrType& torc::physical::Progeny< class Circuit >::getParentWeakPtr ( void  ) const
inlineinherited

Returns a weak pointer to the parent.

Definition at line 47 of file Progeny.hpp.

47 { return mParentWeakPtr; }
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
const WeakPtrType& torc::physical::Progenitor< class Circuit >::getSelfWeakPtr ( void  ) const
inlineinherited

Returns a weak pointer to this object.

Definition at line 68 of file Progenitor.hpp.

68 { return mSelfWeakPtr; }
WeakPtrType mSelfWeakPtr
Weak pointer this object.
Definition: Progenitor.hpp:57
const string& torc::physical::Design::getSpeedGrade ( void  ) const
inline

Returns the device speed grade for this design.

Definition at line 109 of file physical/Design.hpp.

109 { return mSpeedGrade; }
string mSpeedGrade
The device speed grade specified for this design.

+ Here is the caller graph for this function:

const string& torc::physical::Design::getXdlVersion ( void  ) const
inline

Returns the XDL version for this design.

Definition at line 111 of file physical/Design.hpp.

111 { return mXdlVersion; }
string mXdlVersion
The XDL version specified for this design.

+ Here is the caller graph for this function:

bool torc::common::Annotated::hasAnnotation ( uint32  inKey)
inlineinherited

Check if an annotation exists.

Definition at line 51 of file Annotated.hpp.

51  {
52  return (mAnnotations.find(inKey) != mAnnotations.end());
53  }
boost::unordered_map< boost::uint32_t, boost::any > mAnnotations
Map containing any annotations.
Definition: Annotated.hpp:34

+ Here is the caller graph for this function:

bool torc::physical::ConfigMap::hasConfig ( const string inSetting) const
inlineinherited

Returns true if the specified setting exists in the map.

Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 69 of file ConfigMap.hpp.

69  {
70  /// \todo Acquire mutex.
71  const_iterator result = find(inSetting);
72  return result != end();
73  /// \todo Release mutex.
74  }
const_iterator const_iterator
Constant iterator to {setting,Config} pairs.
Definition: ConfigMap.hpp:52

+ Here is the caller graph for this function:

InstanceSharedPtrConstIterator torc::physical::Circuit::instancesBegin ( void  ) const
inlineinherited

Returns the begin constant iterator for instances.

Definition at line 197 of file Circuit.hpp.

197 { return mInstances.begin(); }
InstanceSharedPtrVector mInstances
Vector of Instance shared pointers for the circuit.
Definition: Circuit.hpp:58

+ Here is the caller graph for this function:

InstanceSharedPtrIterator torc::physical::Circuit::instancesBegin ( void  )
inlineinherited

Returns the begin non-constant iterator for instances.

Definition at line 201 of file Circuit.hpp.

201 { return mInstances.begin(); }
InstanceSharedPtrVector mInstances
Vector of Instance shared pointers for the circuit.
Definition: Circuit.hpp:58
InstanceSharedPtrConstIterator torc::physical::Circuit::instancesEnd ( void  ) const
inlineinherited

Returns the end constant iterator for instances.

Definition at line 199 of file Circuit.hpp.

199 { return mInstances.end(); }
InstanceSharedPtrVector mInstances
Vector of Instance shared pointers for the circuit.
Definition: Circuit.hpp:58

+ Here is the caller graph for this function:

InstanceSharedPtrIterator torc::physical::Circuit::instancesEnd ( void  )
inlineinherited

Returns the end non-constant iterator for instances.

Definition at line 203 of file Circuit.hpp.

203 { return mInstances.end(); }
InstanceSharedPtrVector mInstances
Vector of Instance shared pointers for the circuit.
Definition: Circuit.hpp:58
ModuleSharedPtrConstIterator torc::physical::Design::modulesBegin ( void  ) const
inline

Returns the begin constant iterator for modules.

Definition at line 124 of file physical/Design.hpp.

124 { return mModules.begin(); }
ModuleSharedPtrVector mModules
Vector of module shared pointers.

+ Here is the caller graph for this function:

ModuleSharedPtrIterator torc::physical::Design::modulesBegin ( void  )
inline

Returns the begin non-constant iterator for modules.

Definition at line 128 of file physical/Design.hpp.

128 { return mModules.begin(); }
ModuleSharedPtrVector mModules
Vector of module shared pointers.
ModuleSharedPtrConstIterator torc::physical::Design::modulesEnd ( void  ) const
inline

Returns the end constant iterator for modules.

Definition at line 126 of file physical/Design.hpp.

126 { return mModules.end(); }
ModuleSharedPtrVector mModules
Vector of module shared pointers.

+ Here is the caller graph for this function:

ModuleSharedPtrIterator torc::physical::Design::modulesEnd ( void  )
inline

Returns the end non-constant iterator for modules.

Definition at line 130 of file physical/Design.hpp.

130 { return mModules.end(); }
ModuleSharedPtrVector mModules
Vector of module shared pointers.
NetSharedPtrConstIterator torc::physical::Circuit::netsBegin ( void  ) const
inlineinherited

Returns the begin constant iterator for nets.

Definition at line 207 of file Circuit.hpp.

207 { return mNets.begin(); }
NetSharedPtrVector mNets
Vector of Net shared pointers for the circuit.
Definition: Circuit.hpp:62

+ Here is the caller graph for this function:

NetSharedPtrIterator torc::physical::Circuit::netsBegin ( void  )
inlineinherited

Returns the begin non-constant iterator for nets.

Definition at line 211 of file Circuit.hpp.

211 { return mNets.begin(); }
NetSharedPtrVector mNets
Vector of Net shared pointers for the circuit.
Definition: Circuit.hpp:62
NetSharedPtrConstIterator torc::physical::Circuit::netsEnd ( void  ) const
inlineinherited

Returns the end constant iterator for nets.

Definition at line 209 of file Circuit.hpp.

209 { return mNets.end(); }
NetSharedPtrVector mNets
Vector of Net shared pointers for the circuit.
Definition: Circuit.hpp:62

+ Here is the caller graph for this function:

NetSharedPtrIterator torc::physical::Circuit::netsEnd ( void  )
inlineinherited

Returns the end non-constant iterator for nets.

Definition at line 213 of file Circuit.hpp.

213 { return mNets.end(); }
NetSharedPtrVector mNets
Vector of Net shared pointers for the circuit.
Definition: Circuit.hpp:62
bool torc::physical::Named::operator== ( const Named rhs) const
inlineinherited

Equality operator.

Definition at line 54 of file Named.hpp.

54 { return mName == rhs.mName; }
string mName
The name of the object.
Definition: Named.hpp:43
void torc::common::Annotated::removeAnnotation ( uint32  inKey)
inlineinherited

Remove an annotation.

Definition at line 49 of file Annotated.hpp.

49 { mAnnotations.erase(inKey); }
boost::unordered_map< boost::uint32_t, boost::any > mAnnotations
Map containing any annotations.
Definition: Annotated.hpp:34

+ Here is the caller graph for this function:

bool torc::physical::ConfigMap::removeConfig ( const string inSetting)
inlineinherited

Removes the named configuration.

Parameters
inSettingThe configuration to remove.
Returns
true if the configuration was removed, or false if the configuration did not exist.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 145 of file ConfigMap.hpp.

145  {
146  /// \todo Acquire mutex.
147  iterator e = end();
148  iterator result = super::find(inSetting);
149  if(result == e) return false;
150  erase(result);
151  /// \todo Release mutex.
152  return true;
153  }
bool torc::physical::Circuit::removeInstance ( InstanceSharedPtr inInstancePtr)
inlineinherited

Remove an instance from the circuit.

Parameters
inInstancePtrThe instance to remove.
Returns
true if the instance was removed, or false if the instance did not exist.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 109 of file Circuit.hpp.

109  {
110  /// \todo Acquire mutex.
111  const std::string& name = inInstancePtr->getName();
112  NameToIndexMap::iterator result = mInstanceMap.find(name);
113  NameToIndexMap::iterator e = mInstanceMap.end();
114  if(result == e) return false;
115  inInstancePtr->resetParentWeakPtr();
116  // fix up the map indexes
117  NameToIndexMap::mapped_type target = result->second;
118  NameToIndexMap::iterator mp = mInstanceMap.begin();
119  NameToIndexMap::iterator me = mInstanceMap.end();
120  while(mp != me) {
121  NameToIndexMap::mapped_type& index = mp->second;
122  if(index > target) index--;
123  mp++;
124  }
125  mInstances.erase(mInstances.begin() + target);
126  mInstanceMap.erase(result);
127  /// \todo Release mutex.
128  return true;
129  }
NameToIndexMap mInstanceMap
Instance name to index mapping for this circuit.
Definition: Circuit.hpp:60
std::string string
InstanceSharedPtrVector mInstances
Vector of Instance shared pointers for the circuit.
Definition: Circuit.hpp:58
bool torc::physical::Design::removeModule ( ModuleSharedPtr inModulePtr)
inline

Remove a module from the design.

Parameters
inModulePtrThe module to remove.
Returns
true if the module was removed, or false if the module did not exist.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 94 of file physical/Design.hpp.

94  {
95  /// \todo Acquire mutex.
96  ModuleSharedPtrVector::iterator e = mModules.end();
97  ModuleSharedPtrVector::iterator result = std::find(mModules.begin(), e, inModulePtr);
98  if(result == e) return false;
99  mModules.erase(result);
100  /// \todo Release mutex.
101  return true;
102  }
ModuleSharedPtrVector mModules
Vector of module shared pointers.
bool torc::physical::Circuit::removeNet ( NetSharedPtr inNetPtr)
inlineinherited

Remove a net from the circuit.

Parameters
inNetPtrThe net to remove.
Returns
true if the net was removed, or false if the net did not exist.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 166 of file Circuit.hpp.

166  {
167  /// \todo Acquire mutex.
168  const std::string& name = inNetPtr->getName();
169  NameToIndexMap::iterator result = mNetMap.find(name);
170  NameToIndexMap::iterator e = mNetMap.end();
171  if(result == e) return false;
172  inNetPtr->resetParentWeakPtr();
173  // fix up the map indexes
174  NameToIndexMap::mapped_type target = result->second;
175  NameToIndexMap::iterator mp = mNetMap.begin();
176  NameToIndexMap::iterator me = mNetMap.end();
177  while(mp != me) {
178  NameToIndexMap::mapped_type& index = mp->second;
179  if(index > target) index--;
180  mp++;
181  }
182  mNets.erase(mNets.begin() + target);
183  mNetMap.erase(result);
184  /// \todo Release mutex.
185  return true;
186  }
NetSharedPtrVector mNets
Vector of Net shared pointers for the circuit.
Definition: Circuit.hpp:62
std::string string
NameToIndexMap mNetMap
Net name to index mapping for this circuit.
Definition: Circuit.hpp:64
void torc::physical::Progeny< class Circuit >::resetParentWeakPtr ( void  )
inlineinherited

Method to reset and orphan this object.

Definition at line 51 of file Progeny.hpp.

51 { mParentWeakPtr.reset(); }
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38
void torc::common::Annotated::setAnnotation ( uint32  inKey,
boost::any  inValue 
)
inlineinherited

Set an annotation.

Definition at line 47 of file Annotated.hpp.

47 { mAnnotations[inKey] = inValue; }
boost::unordered_map< boost::uint32_t, boost::any > mAnnotations
Map containing any annotations.
Definition: Annotated.hpp:34

+ Here is the caller graph for this function:

void torc::physical::ConfigMap::setConfig ( const string inSetting,
const Config inConfig 
)
inlineinherited

Sets the configuration for the given setting.

If this is a regular setting, then any existing configuration for the setting will be replaced, but if this is a special setting for which multiple configurations are allowed, it will be added to the map alongside the existing configurations.

Parameters
inSettingThe setting of interest.
inConfigThe configuration to set.

Definition at line 119 of file ConfigMap.hpp.

119  {
120  setConfig(inSetting, inConfig.getName(), inConfig.getValue());
121  }
void setConfig(const string &inSetting, const Config &inConfig)
Sets the configuration for the given setting.
Definition: ConfigMap.hpp:119

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::physical::ConfigMap::setConfig ( const string inSetting,
const string inName,
const string inValue 
)
inlineinherited

Sets the configuration for the given setting.

If this is a regular setting, then any existing configuration for the setting will be replaced, but if this is a special setting for which multiple configurations are allowed, it will be added to the map alongside the existing configurations.

Parameters
inSettingThe setting of interest.
inNameThe configuration name to set.
inValueThe configuration value to set.
Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 130 of file ConfigMap.hpp.

130  {
131  /// \todo Acquire mutex.
132  // if duplicates are disallowed for this setting, erase any matching entries
133  if(!allowConfigDuplicates(inSetting)) {
134  std::pair<iterator, iterator> range = equal_range(inSetting);
135  if(range.first != range.second) erase(range.first, range.second);
136  }
137  // insert the config entry
138  insert(make_pair(inSetting, Config(inName, inValue, mNextSequenceIndex++)));
139  /// \todo Release mutex.
140  }
static bool allowConfigDuplicates(const string &inSetting)
Returns true if multiple configurations are allowed for the given setting.
Definition: ConfigMap.hpp:177
SequenceIndex mNextSequenceIndex
Sequence index to use for the next configuration added to this map.
Definition: ConfigMap.hpp:48

+ Here is the call graph for this function:

void torc::physical::Design::setDevice ( const string inDevice)
inline

Sets the target device for this design.

Definition at line 113 of file physical/Design.hpp.

113 { mDevice = inDevice; }
string mDevice
The target device specified for this design.
void torc::physical::Design::setPackage ( const string inPackage)
inline

Sets the device package for this design.

Definition at line 115 of file physical/Design.hpp.

115 { mPackage = inPackage; }
string mPackage
The device package specified for this design.
void torc::physical::Progeny< class Circuit >::setParentWeakPtr ( WeakPtrType  inParentPtr)
inlineinherited

Sets the weak pointer to the parent.

Definition at line 49 of file Progeny.hpp.

49 { mParentWeakPtr = inParentPtr; }
WeakPtrType mParentWeakPtr
Weak pointer to the parent.
Definition: Progeny.hpp:38

+ Here is the caller graph for this function:

void torc::physical::Progenitor< class Circuit >::setSelfWeakPtr ( WeakPtrType  inSelfPtr)
inlineprotectedinherited

Sets the weak pointer to this object.

Definition at line 59 of file Progenitor.hpp.

59 { mSelfWeakPtr = inSelfPtr; }
WeakPtrType mSelfWeakPtr
Weak pointer this object.
Definition: Progenitor.hpp:57
void torc::physical::Design::setSpeedGrade ( const string inSpeedGrade)
inline

Sets the device speed grade for this design.

Definition at line 117 of file physical/Design.hpp.

117 { mSpeedGrade = inSpeedGrade; }
string mSpeedGrade
The device speed grade specified for this design.
void torc::physical::Design::setXdlVersion ( const string inXdlVersion)
inline

Sets the XDL version for this design.

Definition at line 119 of file physical/Design.hpp.

119 { mXdlVersion = inXdlVersion; }
string mXdlVersion
The XDL version specified for this design.
void torc::physical::Circuit::unplace ( void  )
inlineinherited

Unplace the circuit by discarding placement information for each instance.

Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 131 of file Circuit.hpp.

131  {
132  /// \todo Acquire mutex.
135  while(p < e) (*p++)->unplace();
136  /// \todo Release mutex.
137  }
void unplace(void)
Unplace the circuit by discarding placement information for each instance.
Definition: Circuit.hpp:131
InstanceSharedPtrConstIterator instancesBegin(void) const
Returns the begin constant iterator for instances.
Definition: Circuit.hpp:197
InstanceSharedPtrVector::iterator InstanceSharedPtrIterator
Non-constant iterator to Instance shared pointers.
Definition: Circuit.hpp:74
InstanceSharedPtrConstIterator instancesEnd(void) const
Returns the end constant iterator for instances.
Definition: Circuit.hpp:199

+ Here is the call graph for this function:

void torc::physical::Circuit::unroute ( void  )
inlineinherited

Unroute the circuit by discarding routing information for each net.

Todo:
Acquire mutex.
Todo:
Release mutex.

Definition at line 188 of file Circuit.hpp.

188  {
189  /// \todo Acquire mutex.
192  while(p < e) (*p++)->unroute();
193  /// \todo Release mutex.
194  }
NetSharedPtrConstIterator netsEnd(void) const
Returns the end constant iterator for nets.
Definition: Circuit.hpp:209
NetSharedPtrVector::iterator NetSharedPtrIterator
Non-constant iterator to Net shared pointers.
Definition: Circuit.hpp:78
void unroute(void)
Unroute the circuit by discarding routing information for each net.
Definition: Circuit.hpp:188
NetSharedPtrConstIterator netsBegin(void) const
Returns the begin constant iterator for nets.
Definition: Circuit.hpp:207

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend class Factory
friend

The Factory class has direct access to our internals.

Definition at line 36 of file physical/Design.hpp.

Field Documentation

boost::unordered_map<boost::uint32_t, boost::any> torc::common::Annotated::mAnnotations
protectedinherited

Map containing any annotations.

Definition at line 34 of file Annotated.hpp.

string torc::physical::Design::mDevice
protected

The target device specified for this design.

Definition at line 45 of file physical/Design.hpp.

NameToIndexMap torc::physical::Circuit::mInstanceMap
protectedinherited

Instance name to index mapping for this circuit.

Definition at line 60 of file Circuit.hpp.

InstanceSharedPtrVector torc::physical::Circuit::mInstances
protectedinherited

Vector of Instance shared pointers for the circuit.

Definition at line 58 of file Circuit.hpp.

ModuleSharedPtrVector torc::physical::Design::mModules
protected

Vector of module shared pointers.

Definition at line 43 of file physical/Design.hpp.

string torc::physical::Named::mName
protectedinherited

The name of the object.

Definition at line 43 of file Named.hpp.

NameToIndexMap torc::physical::Circuit::mNetMap
protectedinherited

Net name to index mapping for this circuit.

Definition at line 64 of file Circuit.hpp.

NetSharedPtrVector torc::physical::Circuit::mNets
protectedinherited

Vector of Net shared pointers for the circuit.

Definition at line 62 of file Circuit.hpp.

SequenceIndex torc::physical::ConfigMap::mNextSequenceIndex
protectedinherited

Sequence index to use for the next configuration added to this map.

Definition at line 48 of file ConfigMap.hpp.

string torc::physical::Design::mPackage
protected

The device package specified for this design.

Definition at line 47 of file physical/Design.hpp.

WeakPtrType torc::physical::Progeny< class Circuit >::mParentWeakPtr
protectedinherited

Weak pointer to the parent.

Definition at line 38 of file Progeny.hpp.

WeakPtrType torc::physical::Progenitor< class Circuit >::mSelfWeakPtr
protectedinherited

Weak pointer this object.

This weak pointer is kept here to be passed along to our children, allowing them to point back to us without the strong dependency of a shared pointer.

Definition at line 57 of file Progenitor.hpp.

string torc::physical::Design::mSpeedGrade
protected

The device speed grade specified for this design.

Definition at line 49 of file physical/Design.hpp.

string torc::physical::Design::mXdlVersion
protected

The XDL version specified for this design.

Definition at line 51 of file physical/Design.hpp.


The documentation for this class was generated from the following file: