torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic Namespace Reference

Namespace for the Torc generic netlist, including EDIF and BLIF importers and exporters. More...

Namespaces

 _impl
 
 generic
 

Data Structures

class  Apply
 This class is used within simulate to describe input stimuli and expected responces over a certain time interval. More...
 
class  Bundle
 Represents a "bundle" in the EDIF sense. More...
 
class  BundleFlattener
 Flatten a bundle to bits. More...
 
class  Cell
 Represents an EDIF cell. More...
 
class  Cloneable
 Represents all EOM classes that can be cloned(copied). More...
 
class  Commentable
 Represents all classes that can hold user comments. More...
 
class  Composite
 Interface for objects that can be composed within each other. More...
 
class  Connectable
 An object that is connectable to a Net. More...
 
class  ConnectionHandler
 
class  Design
 
class  Decompiler
 
class  Driver
 
class  EdifContext
 
class  EdifParser
 The Top level parser for parsing EDIF files. More...
 
class  Linker
 Represents a repository of unresolved usage references. More...
 
class  location
 Abstract a location. More...
 
class  ObjectVisitor
 
class  Parser
 A Bison parser. More...
 
struct  NameData
 
struct  ArrayData
 
struct  ViewRefData
 
struct  CellRefData
 
struct  LogicRefData
 
struct  InstanceRefData
 
struct  PortRefData
 
struct  NetRefData
 
struct  PortInstData
 
struct  PortListData
 
struct  VersionData
 
struct  ValueData
 
struct  PairData
 
struct  PairStrData
 
struct  ParamAssignInfo
 
struct  InstanceInfo
 
struct  LogicListData
 
class  ParserOptions
 
class  position
 Abstract a position. More...
 
class  Scanner
 
class  stack
 
class  slice
 Present a slice of the top of a stack. More...
 
struct  EdifVersion
 
class  Error
 The Error object thrown by different methods of EdifOM. More...
 
class  Event
 Event is used to describe an event on a port or a net using logic state transitions. Events can also be described for unordered groups of ports or nets using portGroup or netGroup. An ordered list of ports may also be used using a portList. More...
 
class  Extern
 Used to implement external object referencing. More...
 
class  FactoryType
 A placeholder for a factory method. More...
 
class  ForbiddenEvent
 ForbiddenEvent class lists events which are forbidden during a period of times which is specified by time interval. Time interval is used to describe an interval between two times. Times can be described by events or offset events. More...
 
class  Instance
 Represents an instantiation of a cell view in the view of another cell. More...
 
class  InstanceArray
 Represents an array of instances. More...
 
class  InstanceArrayMember
 Represents a member of an instance array. More...
 
class  InterfaceAttributes
 Represents attributes of a view interface. More...
 
class  InterfaceJoinedInfo
 Represents the Interface joining information. More...
 
struct  IndexFinder
 
class  Library
 An EDIF cell library. More...
 
class  LogicalResponse
 This class is used to model logicInput/logicOutput construct. This class holds information of logical response to be expected from a ports during simulation. More...
 
class  LogicElement
 Represents different logic elements which holds array of logic values. More...
 
class  LogicValue
 This class is used within simulationInfo construct to define a logic value to use for modeling in the logicModel view. More...
 
class  LogicValueAttributes
 This class is used within simulationInfo construct to define a logic value to use for modeling. More...
 
class  Message
 
class  MessageTable
 
class  Nameable
 An object that has a name. More...
 
class  Net
 Represents an EDIF Net. More...
 
class  NetAttributes
 Represents attributes of a Net object. More...
 
class  NetBundle
 Represents a bundle of nets. More...
 
class  NetDelay
 Represents the netDelay attribute of Net. More...
 
class  ObjectFactory
 
class  VisitNet
 
class  Parameter
 Represents a parameter object in EDIF. More...
 
class  ParameterArray
 Represents a parameter array. More...
 
class  ParameterArrayElement
 
class  ParameterMap
 
class  ParentedObject
 An object that has a parent. More...
 
class  PathDelay
 This class associates a delay with a specified chain of events. Delay contains the time from first event to final event. More...
 
class  Permutable
 Permutable is used to describe a relationship in which ports are interchangeable. More...
 
class  Port
 Interface for an EDIF port object. More...
 
class  PortAttributes
 Represents attributes of a Port or PortReference object. More...
 
class  PortBundle
 Represents a bundle of ports. More...
 
class  PortBundleReference
 Represents a reference to a bundle of ports. More...
 
class  PortDelay
 Represents the portDelay attribute on Port or PortReference. More...
 
class  PortElement
 Represents port element like port or port reference. More...
 
class  PortList
 Represents an ordered list of port references. More...
 
class  PortListAlias
 Represents an ordered list of port references with a name aliased. More...
 
class  PortRefCreator
 Create port reference. More...
 
class  PortReference
 Represents the usable instance of a port of a cell in another cell. More...
 
class  Property
 
class  PropertyContainer
 Represents objects that have properties. More...
 
class  Renamable
 Represents objects that can be renamed. More...
 
class  Root
 Root of the EDIF Object Model. More...
 
class  Scalar
 A single object with no child objects. More...
 
class  ScalarNet
 Represents a standalone net. More...
 
class  ScalarPort
 Represents a standalone port. More...
 
class  ScalarPortReference
 Represents areference to a standalone port. More...
 
class  ScaleFactor
 
class  SelfReferencing
 
class  Simulate
 This class is to model simulate construct which is a named collection of simulation stimulus and responses statements and is used in the interface and contents of views. More...
 
class  SimulationInfo
 This class is used to hold all information about the logic values used within a library. More...
 
class  SingleInstance
 Represents a single instance of the view of a cell. More...
 
class  SingleParameter
 
class  Status
 Represents EDIF status construct. More...
 
class  StatusContainer
 Represents objects that have status. More...
 
class  SymTab
 A symbol table. More...
 
class  TimeStamp
 Represents the time in Universal Time Coordinate (year, month, day, hour, minute, second) More...
 
class  Timing
 This class is used to provide a set of path delays or timing constrains (forbidden events) More...
 
class  UserDataContainer
 Represents class that can hold userData. More...
 
class  Value
 
class  Vector
 An array of objects. More...
 
class  VectorBit
 Represents a single element of a vector composition. More...
 
class  VectorNet
 Represents a net array. More...
 
class  VectorNetBit
 Represents a bit of a net array. More...
 
class  VectorPort
 Represents a port array. More...
 
class  VectorPortBit
 Represents a bit of a port. More...
 
class  VectorPortBitReference
 Represents a reference to a bit of a port. More...
 
class  VectorPortReference
 Represents a reference to a port array. More...
 
class  TemporaryAssignment
 Template class that stores the current value of a variable and restores that value when this object goes out of scope. More...
 
class  VerilogExporter
 Exporter from a generic netlist into structural verilog. More...
 
class  VerilogExporterVisitor
 Generic netlist object visitor for output as structural Verilog. More...
 
class  VerilogImporter
 Importer from structural verilog format into a generic design. More...
 
class  VerilogImporterVisitor
 AST visitor to convert structural Verilog into a generic design. More...
 
class  VerilogNames
 Encapsulation of library names used for Verilog importing and exporting. More...
 
class  View
 Represents and EDIF View. More...
 
class  Visitable
 An object that receives an inoutVisitor. More...
 
class  VisitorApplier
 
class  BaseVisitor
 A base class for Visitor. More...
 
class  VisitorType
 An acyclic inoutVisitor implementation. More...
 
class  WaveValue
 This class is used within simulate to describe input stimuli and expected responces over a certain time interval. More...
 
class  Written
 Represents an information container relating to the writer of the EDIF file. More...
 
class  EdifImporter
 
class  EdifExporter
 

Typedefs

typedef boost::shared_ptr
< EdifContext
EdifContextSharedPtr
 
typedef boost::weak_ptr
< EdifContext
EdifContextWeakPtr
 
typedef boost::shared_ptr< LinkerLinkerSharedPtr
 
typedef boost::weak_ptr< LinkerLinkerWeakPtr
 
typedef boost::function
< std::string(const
std::string
&inParentInstanceName, const
NetSharedPtr &inNet, const
std::vector< size_t >
&inIndicesVector)> 
NetNamingFunction
 Function to create net names during flattening. More...
 
typedef boost::function
< std::string(const
std::string
&inParentInstanceName, const
InstanceSharedPtr &inInstance,
const std::vector< size_t >
&inIndicesVector)> 
InstanceNamingFunction
 Function to create instance names during flattening. More...
 
typedef boost::function
< std::string(const
InstanceSharedPtr
&inParentInstance, const
NetSharedPtr &inNet, const
std::vector< size_t >
&inIndicesVector)> 
NetRenamingFunction
 Function to create names of nets that are set in rename constructs. More...
 
typedef boost::function
< std::string(const
InstanceSharedPtr
&inParentInstance, const
InstanceSharedPtr &inInstance,
const std::vector< size_t >
&inIndicesVector)> 
InstanceRenamingFunction
 Function to create names of nets that are set in rename constructs. More...
 
typedef size_t ParameterContext
 
typedef boost::shared_ptr< ApplyApplySharedPtr
 
typedef boost::weak_ptr< ApplyApplyWeakPtr
 
typedef boost::shared_ptr< CellCellSharedPtr
 
typedef boost::weak_ptr< CellCellWeakPtr
 
typedef boost::shared_ptr< DesignDesignSharedPtr
 
typedef boost::weak_ptr< DesignDesignWeakPtr
 
typedef boost::shared_ptr< ErrorErrorSharedPtr
 
typedef boost::weak_ptr< ErrorErrorWeakPtr
 
typedef boost::shared_ptr< EventEventSharedPtr
 
typedef boost::weak_ptr< EventEventWeakPtr
 
typedef boost::shared_ptr
< ForbiddenEvent
ForbiddenEventSharedPtr
 
typedef boost::weak_ptr
< ForbiddenEvent
ForbiddenEventWeakPtr
 
typedef boost::shared_ptr< ViewViewSharedPtr
 
typedef boost::weak_ptr< ViewViewWeakPtr
 
typedef boost::shared_ptr< RootRootSharedPtr
 
typedef boost::weak_ptr< RootRootWeakPtr
 
typedef boost::shared_ptr
< Library
LibrarySharedPtr
 
typedef boost::weak_ptr< LibraryLibraryWeakPtr
 
typedef boost::shared_ptr
< LogicValueAttributes
LogicValueAttributesSharedPtr
 
typedef boost::weak_ptr
< LogicValueAttributes
LogicValueAttributesWeakPtr
 
typedef boost::shared_ptr
< LogicValue
LogicValueSharedPtr
 
typedef boost::weak_ptr
< LogicValue
LogicValueWeakPtr
 
typedef boost::shared_ptr
< LogicElement
LogicElementSharedPtr
 
typedef boost::weak_ptr
< LogicElement
LogicElementWeakPtr
 
typedef boost::shared_ptr
< LogicalResponse
LogicalResponseSharedPtr
 
typedef boost::weak_ptr
< LogicalResponse
LogicalResponseWeakPtr
 
typedef boost::shared_ptr
< Instance
InstanceSharedPtr
 
typedef boost::weak_ptr< InstanceInstanceWeakPtr
 
typedef boost::shared_ptr
< SingleInstance
SingleInstanceSharedPtr
 
typedef boost::weak_ptr
< SingleInstance
SingleInstanceWeakPtr
 
typedef boost::shared_ptr
< InstanceArray
InstanceArraySharedPtr
 
typedef boost::weak_ptr
< InstanceArray
InstanceArrayWeakPtr
 
typedef boost::shared_ptr
< InstanceArrayMember
InstanceArrayMemberSharedPtr
 
typedef boost::weak_ptr
< InstanceArrayMember
InstanceArrayMemberWeakPtr
 
typedef boost::shared_ptr
< InterfaceAttributes
InterfaceAttributesSharedPtr
 
typedef boost::weak_ptr
< InterfaceAttributes
InterfaceAttributesWeakPtr
 
typedef boost::shared_ptr< NetNetSharedPtr
 
typedef boost::weak_ptr< NetNetWeakPtr
 
typedef boost::shared_ptr
< NetAttributes
NetAttributesSharedPtr
 
typedef boost::weak_ptr
< NetAttributes
NetAttributesWeakPtr
 
typedef boost::shared_ptr
< NetReference > 
NetReferenceSharedPtr
 
typedef boost::weak_ptr
< NetReference > 
NetReferenceWeakPtr
 
typedef boost::shared_ptr
< ScalarNet
ScalarNetSharedPtr
 
typedef boost::weak_ptr
< ScalarNet
ScalarNetWeakPtr
 
typedef boost::shared_ptr
< VectorNet
VectorNetSharedPtr
 
typedef boost::weak_ptr
< VectorNet
VectorNetWeakPtr
 
typedef boost::shared_ptr
< VectorNetBit
VectorNetBitSharedPtr
 
typedef boost::weak_ptr
< VectorNetBit
VectorNetBitWeakPtr
 
typedef boost::shared_ptr
< NetBundle
NetBundleSharedPtr
 
typedef boost::weak_ptr
< NetBundle
NetBundleWeakPtr
 
typedef boost::shared_ptr
< ObjectFactory
ObjectFactorySharedPtr
 
typedef boost::weak_ptr
< ObjectFactory
ObjectFactoryWeakPtr
 
typedef boost::shared_ptr
< PathDelay
PathDelaySharedPtr
 
typedef boost::weak_ptr
< PathDelay
PathDelayWeakPtr
 
typedef boost::shared_ptr
< Permutable
PermutableSharedPtr
 
typedef boost::weak_ptr
< Permutable
PermutableWeakPtr
 
typedef boost::shared_ptr< PortPortSharedPtr
 
typedef boost::weak_ptr< PortPortWeakPtr
 
typedef boost::shared_ptr
< PortElement
PortElementSharedPtr
 
typedef boost::weak_ptr
< PortElement
PortElementWeakPtr
 
typedef boost::shared_ptr
< PortList
PortListSharedPtr
 
typedef boost::weak_ptr< PortListPortListWeakPtr
 
typedef boost::shared_ptr
< PortListAlias
PortListAliasSharedPtr
 
typedef boost::weak_ptr
< PortListAlias
PortListAliasWeakPtr
 
typedef boost::shared_ptr
< PortAttributes
PortAttributesSharedPtr
 
typedef boost::weak_ptr
< PortAttributes
PortAttributesWeakPtr
 
typedef boost::shared_ptr
< PortBundle
PortBundleSharedPtr
 
typedef boost::weak_ptr
< PortBundle
PortBundleWeakPtr
 
typedef boost::shared_ptr
< PortBundleReference
PortBundleReferenceSharedPtr
 
typedef boost::weak_ptr
< PortBundleReference
PortBundleReferenceWeakPtr
 
typedef boost::shared_ptr
< PortReference
PortReferenceSharedPtr
 
typedef boost::weak_ptr
< PortReference
PortReferenceWeakPtr
 
typedef boost::shared_ptr
< Parameter
ParameterSharedPtr
 
typedef boost::weak_ptr
< Parameter
ParameterWeakPtr
 
typedef boost::shared_ptr
< SingleParameter
SingleParameterSharedPtr
 
typedef boost::weak_ptr
< SingleParameter
SingleParameterWeakPtr
 
typedef boost::shared_ptr
< SimulationInfo
SimulationInfoSharedPtr
 
typedef boost::weak_ptr
< SimulationInfo
SimulationInfoWeakPtr
 
typedef boost::shared_ptr
< Simulate
SimulateSharedPtr
 
typedef boost::weak_ptr< SimulateSimulateWeakPtr
 
typedef boost::shared_ptr
< ParameterArray
ParameterArraySharedPtr
 
typedef boost::weak_ptr
< ParameterArray
ParameterArrayWeakPtr
 
typedef boost::shared_ptr
< ParameterArrayElement
ParameterArrayElementSharedPtr
 
typedef boost::weak_ptr
< ParameterArrayElement
ParameterArrayElementWeakPtr
 
typedef boost::shared_ptr
< ParameterMap
ParameterMapSharedPtr
 
typedef boost::weak_ptr
< ParameterMap
ParameterMapWeakPtr
 
typedef boost::shared_ptr
< Property
PropertySharedPtr
 
typedef boost::weak_ptr< PropertyPropertyWeakPtr
 
typedef boost::shared_ptr
< PropertyContainer
PropertyContainerSharedPtr
 
typedef boost::weak_ptr
< PropertyContainer
PropertyContainerWeakPtr
 
typedef boost::shared_ptr
< ScalarPort
ScalarPortSharedPtr
 
typedef boost::weak_ptr
< ScalarPort
ScalarPortWeakPtr
 
typedef boost::shared_ptr
< ScalarPortReference
ScalarPortReferenceSharedPtr
 
typedef boost::weak_ptr
< ScalarPortReference
ScalarPortReferenceWeakPtr
 
typedef boost::shared_ptr< TimingTimingSharedPtr
 
typedef boost::weak_ptr< TimingTimingWeakPtr
 
typedef boost::shared_ptr
< VectorPort
VectorPortSharedPtr
 
typedef boost::weak_ptr
< VectorPort
VectorPortWeakPtr
 
typedef boost::shared_ptr
< VectorPortReference
VectorPortReferenceSharedPtr
 
typedef boost::weak_ptr
< VectorPortReference
VectorPortReferenceWeakPtr
 
typedef boost::shared_ptr
< VectorPortBit
VectorPortBitSharedPtr
 
typedef boost::shared_ptr
< VectorPortBit
VectorPortBitWeakPtr
 
typedef boost::shared_ptr
< VectorPortBitReference
VectorPortBitReferenceSharedPtr
 
typedef boost::shared_ptr
< VectorPortBitReference
VectorPortBitReferenceWeakPtr
 
typedef boost::shared_ptr
< UserDataContainer
UserDataContainerSharedPtr
 
typedef boost::weak_ptr
< UserDataContainer
UserDataContainerWeakPtr
 
typedef boost::shared_ptr< StatusStatusSharedPtr
 
typedef boost::weak_ptr< StatusStatusWeakPtr
 
typedef boost::shared_ptr
< StatusContainer
StatusContainerSharedPtr
 
typedef boost::weak_ptr
< StatusContainer
StatusContainerWeakPtr
 
typedef boost::shared_ptr
< WaveValue
WaveValueSharedPtr
 
typedef boost::weak_ptr
< WaveValue
WaveValueWeakPtr
 
typedef boost::shared_ptr
< Written
WrittenSharedPtr
 
typedef boost::weak_ptr< WrittenWrittenWeakPtr
 
typedef boost::shared_ptr
< InterfaceJoinedInfo
InterfaceJoinedInfoSharedPtr
 
typedef boost::weak_ptr
< InterfaceJoinedInfo
InterfaceJoinedInfoWeakPtr
 
typedef EPortDirection PortDirection
 
typedef std::map
< CellSharedPtr, int > 
CellUsageMap
 A map from cell shared pointer to usage count. More...
 

Enumerations

enum  CompositionType { eCompositionTypeScalar, eCompositionTypeVector, eCompositionTypeVectorBit, eCompositionTypeBundle }
 Defines possible Composition types. More...
 
enum  Derivation { eDerivationUndefined, eDerivationCalculated, eDerivationMeasured, eDerivationRequired }
 
enum  EdifLevel { eEdifLevel0 = 0, eEdifLevel1, eEdifLevel2 }
 
enum  MessageId {
  eMessageIdErrorArrayIndexSizeMismatch, eMessageIdErrorArrayIndexOutOfBounds, eMessageIdErrorEmptyArray, eMessageIdErrorNullChildfactory,
  eMessageIdErrorEmptyItemName, eMessageIdErrorItemAlreadyExists, eMessageIdErrorItemNotFound, eMessageIdErrorPointerToItemDoesNotExist,
  eMessageIdErrorItemSizeMismatch, eMessageIdErrorConnectionInvalid, eMessageIdErrorTypeCast, eMessageIdErrorValueNotSet,
  eMessageIdErrorCompositionTypeMismatch, eMessageIdParserError, eMessageIdParserWarning, eMessageIdErrorNullPointer,
  eMessageIdErrorUnsupoortedOperation
}
 
enum  MessageSeverity { eMessageSeveritySuppressed, eMessageSeverityInfo, eMessageSeverityWarning, eMessageSeverityError }
 
enum  EPortDirection { ePortDirectionIn = 0, ePortDirectionOut, ePortDirectionInOut, ePortDirectionUndefined }
 
enum  Unit {
  eUnitUndefined, eUnitAngle, eUnitCapacitance, eUnitConductance,
  eUnitCharge, eUnitCurrent, eUnitDistance, eUnitEnergy,
  eUnitFlux, eUnitFrequency, eUnitInductance, eUnitMass,
  eUnitPower, eUnitResistance, eUnitTemperature, eUnitTime,
  eUnitVoltage
}
 

Functions

void copyParams (const Instance &inOriginal, const InstanceSharedPtr &outCloned, const ObjectFactorySharedPtr &inFactory)
 
template<typename _Tp >
boost::shared_ptr< _Tp > clone (const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory) throw (Error)
 
template<typename _Tp >
boost::shared_ptr< _Tp > cloneJoinedInfo (const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory, const ViewSharedPtr &inView) throw (Error)
 
template<typename _Tp >
boost::shared_ptr< _Tp > clonePermutable (const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory, const ViewSharedPtr &inView) throw (Error)
 
const location operator+ (const location &begin, const location &end)
 Join two location objects to create a location. More...
 
const location operator+ (const location &begin, unsigned int width)
 Add two location objects. More...
 
locationoperator+= (location &res, unsigned int width)
 Add and assign a location. More...
 
bool operator== (const location &loc1, const location &loc2)
 Compare two location objects. More...
 
bool operator!= (const location &loc1, const location &loc2)
 Compare two location objects. More...
 
std::ostream & operator<< (std::ostream &ostr, const location &loc)
 Intercept output stream redirection. More...
 
const positionoperator+= (position &res, const int width)
 Add and assign a position. More...
 
const position operator+ (const position &begin, const int width)
 Add two position objects. More...
 
const positionoperator-= (position &res, const int width)
 Add and assign a position. More...
 
const position operator- (const position &begin, const int width)
 Add two position objects. More...
 
bool operator== (const position &pos1, const position &pos2)
 Compare two position objects. More...
 
bool operator!= (const position &pos1, const position &pos2)
 Compare two position objects. More...
 
std::ostream & operator<< (std::ostream &ostr, const position &pos)
 Intercept output stream redirection. More...
 
template<typename _Pointer >
std::string getModifiedName (const std::string &inInstName, const _Pointer &inNameable, const std::vector< size_t > &inIndicesVector=std::vector< size_t >())
 
template<typename _Pointer >
std::string getRenamedName (const InstanceSharedPtr &inParentInstance, const _Pointer &inRenamable, const std::vector< size_t > &inIndicesVector=std::vector< size_t >())
 
void flatten (const InstanceSharedPtr &inInstance, const ObjectFactorySharedPtr &inFactory, bool inRecursive, const std::string &inSeparator, const InstanceRenamingFunction &inInstanceRenameFunc, const NetRenamingFunction &inNetRenameFunc, const InstanceNamingFunction &inInstanceNameFunc, const NetNamingFunction &inNetNameFunc) throw (Error)
 
void flatten (const ViewSharedPtr &inView, const ObjectFactorySharedPtr &inFactory, bool inRecursive, const std::string &inSeparator, const InstanceRenamingFunction &inInstanceRenameFunc, const NetRenamingFunction &inNetRenameFunc, const InstanceNamingFunction &inInstanceNameFunc, const NetNamingFunction &inNetNameFunc) throw (Error)
 
void flatten (const DesignSharedPtr &inDesign, const ObjectFactorySharedPtr &inFactory, bool inRecursive, const std::string &inSeparator, const InstanceRenamingFunction &inInstanceRenameFunc, const NetRenamingFunction &inNetRenameFunc, const InstanceNamingFunction &inInstanceNameFunc, const NetNamingFunction &inNetNameFunc) throw (Error)
 
template std::string getModifiedName (const std::string &inInstName, const NetSharedPtr &inNameable, const std::vector< size_t > &inIndicesVector)
 
template std::string getModifiedName (const std::string &inInstName, const InstanceSharedPtr &inNameable, const std::vector< size_t > &inIndicesVector)
 
template std::string getRenamedName (const InstanceSharedPtr &inParentInstance, const NetSharedPtr &inRenamable, const std::vector< size_t > &inIndicesVector)
 
template std::string getRenamedName (const InstanceSharedPtr &inParentInstance, const InstanceSharedPtr &inRenamable, const std::vector< size_t > &inIndicesVector)
 
template<typename _Connectable >
void findLeafConnectable (std::vector< std::string > &nestedNames, boost::shared_ptr< _Connectable > &conn) throw (Error)
 
template<typename _Connectable >
void connectNetToElement (const std::vector< size_t > &inIndices, const boost::shared_ptr< _Connectable > &inConn, const NetSharedPtr &inNet) throw (Error)
 
void openLogFile (const std::string &logFileName)
 
void log (const char *fmt,...)
 
 BOOST_AUTO_TEST_CASE (Om1UnitTest)
 Unit test for the generic object model. More...
 
void collectCells (ViewSharedPtr &inViewPtr, CellUsageMap &inoutCellUsageMap)
 Recursively collect and count all cells used in the given view. The CellUsageMap must already be initialized with all expected cell counts set to zero. More...
 
void prune (RootSharedPtr &inRootPtr)
 Prune all unused cells and libraries from the given root. More...
 
 BOOST_AUTO_TEST_CASE (ValueUnitTest)
 Unit test for the Value class. More...
 
 BOOST_AUTO_TEST_CASE (VerilogExporterUnitTest)
 Unit test for the VerilogExporter class. More...
 
 BOOST_AUTO_TEST_CASE (VerilogImporterUnitTest)
 Unit test for the VerilogImporter class. More...
 
template<class T >
std::string compositionTypeString (const T &inPtr)
 
template<typename _Tp >
void runVisitor (_Tp &inoutVisited, BaseVisitor &inoutVisitor) throw (Error)
 

Detailed Description

Namespace for the Torc generic netlist, including EDIF and BLIF importers and exporters.

Typedef Documentation

typedef boost::shared_ptr<Apply> torc::generic::ApplySharedPtr

Definition at line 26 of file PointerTypes.hpp.

typedef boost::weak_ptr<Apply> torc::generic::ApplyWeakPtr

Definition at line 28 of file PointerTypes.hpp.

typedef boost::shared_ptr<Cell> torc::generic::CellSharedPtr

Definition at line 30 of file PointerTypes.hpp.

A map from cell shared pointer to usage count.

Definition at line 28 of file Pruning.hpp.

typedef boost::weak_ptr<Cell> torc::generic::CellWeakPtr

Definition at line 32 of file PointerTypes.hpp.

typedef boost::shared_ptr<Design> torc::generic::DesignSharedPtr

Definition at line 34 of file PointerTypes.hpp.

typedef boost::weak_ptr<Design> torc::generic::DesignWeakPtr

Definition at line 36 of file PointerTypes.hpp.

Definition at line 26 of file ParserPointerTypes.hpp.

Definition at line 28 of file ParserPointerTypes.hpp.

typedef boost::shared_ptr<Error> torc::generic::ErrorSharedPtr

Definition at line 38 of file PointerTypes.hpp.

typedef boost::weak_ptr<Error> torc::generic::ErrorWeakPtr

Definition at line 40 of file PointerTypes.hpp.

typedef boost::shared_ptr<Event> torc::generic::EventSharedPtr

Definition at line 42 of file PointerTypes.hpp.

typedef boost::weak_ptr<Event> torc::generic::EventWeakPtr

Definition at line 44 of file PointerTypes.hpp.

Definition at line 46 of file PointerTypes.hpp.

Definition at line 48 of file PointerTypes.hpp.

Definition at line 90 of file PointerTypes.hpp.

Definition at line 92 of file PointerTypes.hpp.

Definition at line 86 of file PointerTypes.hpp.

Definition at line 88 of file PointerTypes.hpp.

Function to create instance names during flattening.

Definition at line 47 of file Flattening.hpp.

Function to create names of nets that are set in rename constructs.

Definition at line 62 of file Flattening.hpp.

typedef boost::shared_ptr<Instance> torc::generic::InstanceSharedPtr

Definition at line 78 of file PointerTypes.hpp.

typedef boost::weak_ptr<Instance> torc::generic::InstanceWeakPtr

Definition at line 80 of file PointerTypes.hpp.

Definition at line 94 of file PointerTypes.hpp.

Definition at line 96 of file PointerTypes.hpp.

Definition at line 278 of file PointerTypes.hpp.

Definition at line 280 of file PointerTypes.hpp.

typedef boost::shared_ptr<Library> torc::generic::LibrarySharedPtr

Definition at line 58 of file PointerTypes.hpp.

typedef boost::weak_ptr<Library> torc::generic::LibraryWeakPtr

Definition at line 60 of file PointerTypes.hpp.

typedef boost::shared_ptr<Linker> torc::generic::LinkerSharedPtr

Definition at line 30 of file ParserPointerTypes.hpp.

typedef boost::weak_ptr<Linker> torc::generic::LinkerWeakPtr

Definition at line 32 of file ParserPointerTypes.hpp.

Definition at line 74 of file PointerTypes.hpp.

Definition at line 76 of file PointerTypes.hpp.

Definition at line 70 of file PointerTypes.hpp.

Definition at line 72 of file PointerTypes.hpp.

Definition at line 62 of file PointerTypes.hpp.

Definition at line 64 of file PointerTypes.hpp.

typedef boost::shared_ptr<LogicValue> torc::generic::LogicValueSharedPtr

Definition at line 66 of file PointerTypes.hpp.

typedef boost::weak_ptr<LogicValue> torc::generic::LogicValueWeakPtr

Definition at line 68 of file PointerTypes.hpp.

Definition at line 102 of file PointerTypes.hpp.

Definition at line 104 of file PointerTypes.hpp.

typedef boost::shared_ptr<NetBundle> torc::generic::NetBundleSharedPtr

Definition at line 122 of file PointerTypes.hpp.

typedef boost::weak_ptr<NetBundle> torc::generic::NetBundleWeakPtr

Definition at line 124 of file PointerTypes.hpp.

Function to create net names during flattening.

Definition at line 39 of file Flattening.hpp.

typedef boost::shared_ptr<NetReference> torc::generic::NetReferenceSharedPtr

Definition at line 106 of file PointerTypes.hpp.

typedef boost::weak_ptr<NetReference> torc::generic::NetReferenceWeakPtr

Definition at line 108 of file PointerTypes.hpp.

Function to create names of nets that are set in rename constructs.

Definition at line 54 of file Flattening.hpp.

typedef boost::shared_ptr<Net> torc::generic::NetSharedPtr

Definition at line 98 of file PointerTypes.hpp.

typedef boost::weak_ptr<Net> torc::generic::NetWeakPtr

Definition at line 100 of file PointerTypes.hpp.

Definition at line 126 of file PointerTypes.hpp.

Definition at line 128 of file PointerTypes.hpp.

Definition at line 190 of file PointerTypes.hpp.

Definition at line 192 of file PointerTypes.hpp.

Definition at line 186 of file PointerTypes.hpp.

Definition at line 188 of file PointerTypes.hpp.

Definition at line 24 of file ParameterContext.hpp.

Definition at line 194 of file PointerTypes.hpp.

Definition at line 196 of file PointerTypes.hpp.

typedef boost::shared_ptr<Parameter> torc::generic::ParameterSharedPtr

Definition at line 170 of file PointerTypes.hpp.

typedef boost::weak_ptr<Parameter> torc::generic::ParameterWeakPtr

Definition at line 172 of file PointerTypes.hpp.

typedef boost::shared_ptr<PathDelay> torc::generic::PathDelaySharedPtr

Definition at line 130 of file PointerTypes.hpp.

typedef boost::weak_ptr<PathDelay> torc::generic::PathDelayWeakPtr

Definition at line 132 of file PointerTypes.hpp.

typedef boost::shared_ptr<Permutable> torc::generic::PermutableSharedPtr

Definition at line 134 of file PointerTypes.hpp.

typedef boost::weak_ptr<Permutable> torc::generic::PermutableWeakPtr

Definition at line 136 of file PointerTypes.hpp.

Definition at line 154 of file PointerTypes.hpp.

Definition at line 156 of file PointerTypes.hpp.

Definition at line 162 of file PointerTypes.hpp.

Definition at line 164 of file PointerTypes.hpp.

typedef boost::shared_ptr<PortBundle> torc::generic::PortBundleSharedPtr

Definition at line 158 of file PointerTypes.hpp.

typedef boost::weak_ptr<PortBundle> torc::generic::PortBundleWeakPtr

Definition at line 160 of file PointerTypes.hpp.

Definition at line 142 of file PointerTypes.hpp.

Definition at line 144 of file PointerTypes.hpp.

Definition at line 150 of file PointerTypes.hpp.

Definition at line 152 of file PointerTypes.hpp.

typedef boost::shared_ptr<PortList> torc::generic::PortListSharedPtr

Definition at line 146 of file PointerTypes.hpp.

typedef boost::weak_ptr<PortList> torc::generic::PortListWeakPtr

Definition at line 148 of file PointerTypes.hpp.

Definition at line 166 of file PointerTypes.hpp.

Definition at line 168 of file PointerTypes.hpp.

typedef boost::shared_ptr<Port> torc::generic::PortSharedPtr

Definition at line 138 of file PointerTypes.hpp.

typedef boost::weak_ptr<Port> torc::generic::PortWeakPtr

Definition at line 140 of file PointerTypes.hpp.

Definition at line 202 of file PointerTypes.hpp.

Definition at line 204 of file PointerTypes.hpp.

typedef boost::shared_ptr<Property> torc::generic::PropertySharedPtr

Definition at line 198 of file PointerTypes.hpp.

typedef boost::weak_ptr<Property> torc::generic::PropertyWeakPtr

Definition at line 200 of file PointerTypes.hpp.

typedef boost::shared_ptr<Root> torc::generic::RootSharedPtr

Definition at line 54 of file PointerTypes.hpp.

typedef boost::weak_ptr<Root> torc::generic::RootWeakPtr

Definition at line 56 of file PointerTypes.hpp.

typedef boost::shared_ptr< ScalarNet > torc::generic::ScalarNetSharedPtr

Definition at line 110 of file PointerTypes.hpp.

typedef boost::weak_ptr< ScalarNet > torc::generic::ScalarNetWeakPtr

Definition at line 112 of file PointerTypes.hpp.

Definition at line 214 of file PointerTypes.hpp.

Definition at line 216 of file PointerTypes.hpp.

typedef boost::shared_ptr<ScalarPort> torc::generic::ScalarPortSharedPtr

Definition at line 210 of file PointerTypes.hpp.

typedef boost::weak_ptr<ScalarPort> torc::generic::ScalarPortWeakPtr

Definition at line 212 of file PointerTypes.hpp.

typedef boost::shared_ptr<Simulate> torc::generic::SimulateSharedPtr

Definition at line 182 of file PointerTypes.hpp.

typedef boost::weak_ptr<Simulate> torc::generic::SimulateWeakPtr

Definition at line 184 of file PointerTypes.hpp.

Definition at line 178 of file PointerTypes.hpp.

Definition at line 180 of file PointerTypes.hpp.

Definition at line 82 of file PointerTypes.hpp.

Definition at line 84 of file PointerTypes.hpp.

Definition at line 174 of file PointerTypes.hpp.

Definition at line 176 of file PointerTypes.hpp.

Definition at line 266 of file PointerTypes.hpp.

Definition at line 268 of file PointerTypes.hpp.

typedef boost::shared_ptr<Status> torc::generic::StatusSharedPtr

Definition at line 262 of file PointerTypes.hpp.

typedef boost::weak_ptr<Status> torc::generic::StatusWeakPtr

Definition at line 264 of file PointerTypes.hpp.

typedef boost::shared_ptr<Timing> torc::generic::TimingSharedPtr

Definition at line 226 of file PointerTypes.hpp.

typedef boost::weak_ptr<Timing> torc::generic::TimingWeakPtr

Definition at line 228 of file PointerTypes.hpp.

Definition at line 258 of file PointerTypes.hpp.

Definition at line 260 of file PointerTypes.hpp.

Definition at line 118 of file PointerTypes.hpp.

Definition at line 120 of file PointerTypes.hpp.

typedef boost::shared_ptr< VectorNet > torc::generic::VectorNetSharedPtr

Definition at line 114 of file PointerTypes.hpp.

typedef boost::weak_ptr< VectorNet > torc::generic::VectorNetWeakPtr

Definition at line 116 of file PointerTypes.hpp.

Definition at line 254 of file PointerTypes.hpp.

Definition at line 256 of file PointerTypes.hpp.

Definition at line 250 of file PointerTypes.hpp.

Definition at line 252 of file PointerTypes.hpp.

Definition at line 238 of file PointerTypes.hpp.

Definition at line 240 of file PointerTypes.hpp.

typedef boost::shared_ptr<VectorPort> torc::generic::VectorPortSharedPtr

Definition at line 234 of file PointerTypes.hpp.

typedef boost::weak_ptr<VectorPort> torc::generic::VectorPortWeakPtr

Definition at line 236 of file PointerTypes.hpp.

typedef boost::shared_ptr<View> torc::generic::ViewSharedPtr

Definition at line 50 of file PointerTypes.hpp.

typedef boost::weak_ptr<View> torc::generic::ViewWeakPtr

Definition at line 52 of file PointerTypes.hpp.

typedef boost::shared_ptr<WaveValue> torc::generic::WaveValueSharedPtr

Definition at line 270 of file PointerTypes.hpp.

typedef boost::weak_ptr<WaveValue> torc::generic::WaveValueWeakPtr

Definition at line 272 of file PointerTypes.hpp.

typedef boost::shared_ptr<Written> torc::generic::WrittenSharedPtr

Definition at line 274 of file PointerTypes.hpp.

typedef boost::weak_ptr<Written> torc::generic::WrittenWeakPtr

Definition at line 276 of file PointerTypes.hpp.

Enumeration Type Documentation

Defines possible Composition types.

Used in composite objects, this type indicates whether an object is a Scalar, a Vector, a bit of a vector (VectorBit) or a Bundle

Enumerator
eCompositionTypeScalar 
eCompositionTypeVector 
eCompositionTypeVectorBit 
eCompositionTypeBundle 

Definition at line 35 of file CompositionType.hpp.

Type. Types of possible derivation. It identify the classification of timing information being provided.

Enumerator
eDerivationUndefined 
eDerivationCalculated 
eDerivationMeasured 
eDerivationRequired 

Definition at line 27 of file Derivation.hpp.

enums corresponding to EDIF levels 0,1 and 2.

Enumerator
eEdifLevel0 
eEdifLevel1 
eEdifLevel2 

Definition at line 26 of file EdifLevel.hpp.

Direction of the ports

Enumerator
ePortDirectionIn 
ePortDirectionOut 
ePortDirectionInOut 
ePortDirectionUndefined 

Definition at line 26 of file PortDirection.hpp.

Each element of this enumeration denote a message in the system.

Enumerator
eMessageIdErrorArrayIndexSizeMismatch 
eMessageIdErrorArrayIndexOutOfBounds 
eMessageIdErrorEmptyArray 
eMessageIdErrorNullChildfactory 
eMessageIdErrorEmptyItemName 
eMessageIdErrorItemAlreadyExists 
eMessageIdErrorItemNotFound 
eMessageIdErrorPointerToItemDoesNotExist 
eMessageIdErrorItemSizeMismatch 
eMessageIdErrorConnectionInvalid 
eMessageIdErrorTypeCast 
eMessageIdErrorValueNotSet 
eMessageIdErrorCompositionTypeMismatch 
eMessageIdParserError 
eMessageIdParserWarning 
eMessageIdErrorNullPointer 
eMessageIdErrorUnsupoortedOperation 

Definition at line 27 of file MessageId.hpp.

27  {
35 };

This type defines the severity of the message, i.e., whether it's an error, warning or an info message or it is suppressed.

Enumerator
eMessageSeveritySuppressed 
eMessageSeverityInfo 
eMessageSeverityWarning 
eMessageSeverityError 

Definition at line 27 of file MessageSeverity.hpp.

Represents the different units defined in EDIF.

Enumerator
eUnitUndefined 
eUnitAngle 
eUnitCapacitance 
eUnitConductance 
eUnitCharge 
eUnitCurrent 
eUnitDistance 
eUnitEnergy 
eUnitFlux 
eUnitFrequency 
eUnitInductance 
eUnitMass 
eUnitPower 
eUnitResistance 
eUnitTemperature 
eUnitTime 
eUnitVoltage 

Definition at line 27 of file Unit.hpp.

Function Documentation

torc::generic::BOOST_AUTO_TEST_CASE ( ValueUnitTest  )

Unit test for the Value class.

Definition at line 28 of file ValueUnitTest.cpp.

28  {
29  // functions not tested:
30  // Value::MiNoMax::MiNoMax();
31  // Value::MiNoMax::MiNoMax(Value::Number inMin, Value::Number inNominal, Value::Number inMax);
32  // Value::MiNoMax::~MiNoMax();
33  // Value::MiNoMax::MiNoMax(const Value::MiNoMax& inSource);
34  // Value::MiNoMax& Value::MiNoMax::operator=(const Value::MiNoMax& inSource);
35  // bool Value::MiNoMax::operator <(const Value::MiNoMax& inRhs) const;
36  // bool Value::MiNoMax::operator ==(const Value::MiNoMax& inRhs) const;
37  // bool Value::MiNoMax::operator >(const Value::MiNoMax& inRhs) const;
38  // bool Value::MiNoMax::operator >=(const Value::MiNoMax& inRhs) const;
39  // bool Value::MiNoMax::operator <=(const Value::MiNoMax& inRhs) const;
40  // bool Value::MiNoMax::operator !=(const Value::MiNoMax& inRhs) const;
41  // void Value::MiNoMax::setMax(const Value::Number& inSource);
42  // void Value::MiNoMax::setMin(const Value::Number& inSource);
43  // void Value::MiNoMax::setNominal(const Value::Number& inSource);
44  // Value::Number::Number();
45  // Value::Number::Number(int32_t inMantissa, int32_t inExponent);
46  // Value::Number::~Number();
47  // Value::Number::Number(const Value::Number& inSource);
48  // Value::Number& Value::Number::operator=(const Value::Number& inSource);
49  // bool Value::Number::operator <(const Value::Number& inRhs) const;
50  // bool Value::Number::operator ==(const Value::Number& inRhs) const;
51  // bool Value::Number::operator >(const Value::Number& inRhs) const;
52  // bool Value::Number::operator >=(const Value::Number& inRhs) const;
53  // bool Value::Number::operator <=(const Value::Number& inRhs) const;
54  // bool Value::Number::operator !=(const Value::Number& inRhs) const;
55  // void Value::Number::setMantissa(const int32_t& inSource);
56  // void Value::Number::setExponent(const int32_t& inSource);
57  // Value::Point::Point();
58  // Value::Point::Point(int32_t inX, int32_t inY);
59  // Value::Point::~Point();
60  // Value::Point::Point(const Value::Point& inSource);
61  // Value::Point& Value::Point::operator=(const Value::Point& inSource);
62  // bool Value::Point::operator <(const Value::Point& inRhs) const;
63  // bool Value::Point::operator ==(const Value::Point& inRhs) const;
64  // bool Value::Point::operator >(const Value::Point& inRhs) const;
65  // bool Value::Point::operator >=(const Value::Point& inRhs) const;
66  // bool Value::Point::operator <=(const Value::Point& inRhs) const;
67  // bool Value::Point::operator !=(const Value::Point& inRhs) const;
68  // void Value::Point::setX(const int32_t& inSource);
69  // void Value::Point::setY(const int32_t& inSource);
70  // Value::Value();
71  // Value::Value(Value::Type type);
72  // Value::~Value();
73  // Value::Value(const Value& inSource);
74  // Value& Value::operator=(const Value& inSource);
75  // void Value::setType(const Value::Type& inSource);
76  // void Value::setIsSet(const bool& inSource);
77  // template <class Archive> void Value::serialize(Archive& ar, unsigned int);
78  // template void Value::serialize<boost::archive::binary_iarchive>(
79  // boost::archive::binary_iarchive& ar, const unsigned int);
80  // template void Value::serialize<boost::archive::binary_oarchive>(
81  // boost::archive::binary_oarchive& ar, const unsigned int);
82 
83  // functions tested:
84  // Value::Number::Number(int32_t inMantissa, int32_t inExponent);
85  // double Value::Number::eval() const;
86  Value::Number number(2, 2);
87  BOOST_CHECK_EQUAL(number.eval(), 200); // for SourceForge bug 3587203.
88 }

+ Here is the call graph for this function:

torc::generic::BOOST_AUTO_TEST_CASE ( VerilogExporterUnitTest  )

Unit test for the VerilogExporter class.

Definition at line 30 of file VerilogExporterUnitTest.cpp.

30  {
31 
32 }
torc::generic::BOOST_AUTO_TEST_CASE ( VerilogImporterUnitTest  )

Unit test for the VerilogImporter class.

Definition at line 30 of file VerilogImporterUnitTest.cpp.

30  {
31 
32 }
torc::generic::BOOST_AUTO_TEST_CASE ( Om1UnitTest  )

Unit test for the generic object model.

Definition at line 88 of file Om1UnitTest.cpp.

88  {
89 
90  // create string streams for both the generated and parsed EDIF
91  std::stringstream generated;
92  std::stringstream parsed;
93 
94  std::cout << "Generating " << "and.edf" << " ... ";
95  try {
96  // create the object factory
97  boost::shared_ptr<ObjectFactory> objectFactoryPtr(new ObjectFactory());
98 
99  // create the design root
100  RootSharedPtr rootPtr = objectFactoryPtr->newRootPtr("and");
101  rootPtr->setOriginalName("AND");
102 
103  // create the VIRTEX and work libraries
104  LibrarySharedPtr virtexLibraryPtr = objectFactoryPtr->newLibraryPtr("VIRTEX", rootPtr);
105  LibrarySharedPtr workLibraryPtr = objectFactoryPtr->newLibraryPtr("work", rootPtr);
106 
107  // create the LUT2 cell and its PRIM view
108  CellSharedPtr lut2CellPtr = objectFactoryPtr->newCellPtr("LUT2", virtexLibraryPtr);
109  ViewSharedPtr lut2ViewPtr = objectFactoryPtr->newViewPtr("PRIM", lut2CellPtr);
110  ScalarPortSharedPtr lut2I0PortPtr = objectFactoryPtr->newScalarPortPtr("I0",
111  ePortDirectionIn, lut2ViewPtr);
112  ScalarPortSharedPtr lut2I1PortPtr = objectFactoryPtr->newScalarPortPtr("I1",
113  ePortDirectionIn, lut2ViewPtr);
114  ScalarPortSharedPtr lut2OPortPtr = objectFactoryPtr->newScalarPortPtr("O",
115  ePortDirectionOut, lut2ViewPtr);
116 
117  // create the and cell and its PRIM view
118  CellSharedPtr andCellPtr = objectFactoryPtr->newCellPtr("and", workLibraryPtr,
119  Cell::eTypeGeneric, "AND");
120  ViewSharedPtr andViewPtr = objectFactoryPtr->newViewPtr("verilog", andCellPtr);
121  ScalarPortSharedPtr andI0PortPtr = objectFactoryPtr->newScalarPortPtr("I0",
122  ePortDirectionIn, andViewPtr);
123  ScalarPortSharedPtr andI1PortPtr = objectFactoryPtr->newScalarPortPtr("I1",
124  ePortDirectionIn, andViewPtr);
125  ScalarPortSharedPtr andOPortPtr = objectFactoryPtr->newScalarPortPtr("O",
126  ePortDirectionOut, andViewPtr);
127 
128  // create the oZ0 instance of type VIRTEX:LUT2:PRIM
129  SingleInstanceSharedPtr oZ0InstancePtr = objectFactoryPtr->newSingleInstancePtr("oZ0",
130  andViewPtr, lut2ViewPtr, "o");
131  ScalarPortReferenceSharedPtr oZ0I0PortReferencePtr
132  = objectFactoryPtr->newScalarPortReferencePtr(oZ0InstancePtr, lut2I0PortPtr);
133  ScalarPortReferenceSharedPtr oZ0I1PortReferencePtr
134  = objectFactoryPtr->newScalarPortReferencePtr(oZ0InstancePtr, lut2I1PortPtr);
135  ScalarPortReferenceSharedPtr oZ0OPortReferencePtr
136  = objectFactoryPtr->newScalarPortReferencePtr(oZ0InstancePtr, lut2OPortPtr);
137 
138  // create the i0 net
139  ScalarNetSharedPtr i0NetPtr = objectFactoryPtr->newScalarNetPtr("i0", andViewPtr);
140  andI0PortPtr->connect(i0NetPtr);
141  oZ0I0PortReferencePtr->connect(i0NetPtr);
142  ScalarNetSharedPtr i1NetPtr = objectFactoryPtr->newScalarNetPtr("i1", andViewPtr);
143  andI1PortPtr->connect(i1NetPtr);
144  oZ0I1PortReferencePtr->connect(i1NetPtr);
145  ScalarNetSharedPtr oNetPtr = objectFactoryPtr->newScalarNetPtr("o", andViewPtr);
146  andOPortPtr->connect(oNetPtr);
147  oZ0OPortReferencePtr->connect(oNetPtr);
148 
149  // attach the INIT 8 property to the oZ0 instance
150  PropertySharedPtr initPropertyPtr = objectFactoryPtr->newPropertyPtr("INIT", oZ0InstancePtr,
151  Value(Value::eValueTypeString, std::string("8")));
152 (void) initPropertyPtr;
153 
154  // instantiate the design
155  DesignSharedPtr designPtr = objectFactoryPtr->newDesignPtr("and", rootPtr, "and", "work",
156  "AND");
157 
158  // attach the PART xc5vlx30ff324-1 property to the and design instance
159  PropertySharedPtr partPropertyPtr = objectFactoryPtr->newPropertyPtr("PART", designPtr,
160  Value(Value::eValueTypeString, std::string("xc5vlx30ff324-1")));
161  partPropertyPtr->setOwner("Xilinx");
162 
163  std::cout << "done." << std::endl;
164 // PrintInfo info(generated);
165 // rootPtr->accept(info);
166 
167  Decompiler decompiler(rootPtr);
168  decompiler();
169 
170  // now insert inverter pairs on each net
171 // VisitNet visitNet;
172 // andViewPtr->applyOnAllNets(visitNet);
173 
174  } catch(Error& e) {
175  std::cerr << MessageTable::instance()->getMessage(e.getErrorMessageId()) << std::endl;
176  const std::vector<Error::StackFrameInfo>& stack = e.getStackTrace();
177  for(std::vector<Error::StackFrameInfo>::const_iterator it = stack.begin();
178  it != stack.end(); it++) {
179  std::cerr << " " << (*it).getFunction() << "() [" << (*it).getFile() << ":"
180  << (*it).getLine() << "]" << std::endl;
181  }
182  }
183 /*
184  try {
185  std::cout << "Parsing " << "and.edf" << " ... ";
186  boost::shared_ptr<ObjectFactory> factoryPtr(new ObjectFactory());
187  boost::shared_ptr<Root> rootPtr;
188  factoryPtr->create(rootPtr);
189  boost::shared_ptr<Linker> linkerPtr(new Linker(rootPtr));
190  ParserOptions options;
191  EdifParser parser;
192  parser.parse("and.edf", rootPtr, linkerPtr, factoryPtr, options);
193  std::cout << "done." << std::endl;
194  //PrintInfo info(parsed);
195  //rootPtr->accept(info);
196 // Decompiler decompiler(rootPtr);
197 // decompiler();
198  } catch(Error& e) {
199  std::cerr << MessageTable::instance()->getMessage(e.getErrorMessageId()) << std::endl;
200  const std::vector<Error::StackFrameInfo>& stack = e.getStackTrace();
201  for(std::vector<Error::StackFrameInfo>::const_iterator it = stack.begin();
202  it != stack.end(); it++) {
203  std::cerr << " " << (*it).getFunction() << "() [" << (*it).getFile() << ":"
204  << (*it).getLine() << "]" << std::endl;
205  }
206  }
207 */
208  // verify that the generated and parsed outputs are identical
209  BOOST_CHECK_EQUAL(generated.str(), parsed.str());
210 
211 }
boost::shared_ptr< ScalarPort > ScalarPortSharedPtr
boost::shared_ptr< ScalarNet > ScalarNetSharedPtr
boost::shared_ptr< ScalarPortReference > ScalarPortReferenceSharedPtr
std::string string
boost::shared_ptr< Design > DesignSharedPtr
boost::shared_ptr< Library > LibrarySharedPtr
boost::shared_ptr< View > ViewSharedPtr
boost::shared_ptr< Cell > CellSharedPtr
boost::shared_ptr< Property > PropertySharedPtr
boost::shared_ptr< SingleInstance > SingleInstanceSharedPtr
boost::shared_ptr< Root > RootSharedPtr

+ Here is the call graph for this function:

template<typename _Tp >
boost::shared_ptr<_Tp> torc::generic::clone ( const boost::shared_ptr< _Tp > &  inPointer,
const ObjectFactorySharedPtr &  inFactory 
)
throw (Error
)

Definition at line 63 of file Cloning.hpp.

64  {
65  try {
66  return _impl::Copier<_Tp>()(inPointer, inFactory);
67  } catch(Error& e) {
68  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
69  throw;
70  }
71 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename _Tp >
boost::shared_ptr<_Tp> torc::generic::cloneJoinedInfo ( const boost::shared_ptr< _Tp > &  inPointer,
const ObjectFactorySharedPtr &  inFactory,
const ViewSharedPtr &  inView 
)
throw (Error
)

Definition at line 73 of file Cloning.hpp.

75  {
76  try {
77  return _impl::Copier<_Tp>()(inPointer, inFactory, inView);
78  } catch(Error& e) {
79  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
80  throw;
81  }
82 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename _Tp >
boost::shared_ptr<_Tp> torc::generic::clonePermutable ( const boost::shared_ptr< _Tp > &  inPointer,
const ObjectFactorySharedPtr &  inFactory,
const ViewSharedPtr &  inView 
)
throw (Error
)

Definition at line 84 of file Cloning.hpp.

86  {
87  try {
88  return _impl::Copier<_Tp>()(inPointer, inFactory, inView);
89  } catch(Error& e) {
90  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
91  throw;
92  }
93 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::generic::collectCells ( ViewSharedPtr inViewPtr,
CellUsageMap inoutCellUsageMap 
)

Recursively collect and count all cells used in the given view. The CellUsageMap must already be initialized with all expected cell counts set to zero.

Parameters
inViewPtrThe view to begin recursing from.
inoutCellUsageMapA map from cell to usage count.

Definition at line 36 of file Pruning.cpp.

36  {
37 
38  // iterate over all of the instances
39  typedef std::vector<InstanceSharedPtr> InstanceSharedPtrVector;
40  InstanceSharedPtrVector instances;
41  inViewPtr->getInstances(instances);
42  InstanceSharedPtrVector::iterator ip = instances.begin();
43  InstanceSharedPtrVector::iterator ie = instances.end();
44  while(ip < ie) {
45  // look up the instance
46  InstanceSharedPtr instancePtr = *ip++;
47  // look up the master view and its parent cell
48  ViewSharedPtr masterViewPtr = instancePtr->getMaster();
49  CellSharedPtr masterCellPtr = masterViewPtr->getParent();
50  // look up the master cell, and increment its usage count
51  inoutCellUsageMap[masterCellPtr]++;
52  // recurse
53  collectCells(masterViewPtr, inoutCellUsageMap);
54  }
55 
56 }
boost::shared_ptr< Instance > InstanceSharedPtr
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Vector of Instance shared pointers.
void collectCells(ViewSharedPtr &inViewPtr, CellUsageMap &inoutCellUsageMap)
Recursively collect and count all cells used in the given view. The CellUsageMap must already be ini...
Definition: Pruning.cpp:36
boost::shared_ptr< View > ViewSharedPtr
boost::shared_ptr< Cell > CellSharedPtr

+ Here is the caller graph for this function:

template<class T >
std::string torc::generic::compositionTypeString ( const T &  inPtr)

Definition at line 33 of file VerilogImporterVisitor.cpp.

33  {
34  if(!inPtr) return "null";
35  switch(inPtr->getCompositionType()) {
36  case eCompositionTypeScalar: return "scalar";
37  case eCompositionTypeVector: return "vector";
38  case eCompositionTypeVectorBit: return "vector bit";
39  case eCompositionTypeBundle: return "bundle";
40  default: return "unknown";
41  }
42  }
template<typename _Connectable >
void torc::generic::connectNetToElement ( const std::vector< size_t > &  inIndices,
const boost::shared_ptr< _Connectable > &  inConn,
const NetSharedPtr &  inNet 
)
throw (Error
)

Definition at line 57 of file InternalUtilityFunctions.hpp.

58  {
59  try {
60  if(inIndices.empty()) {
61  //TBD::CHECK WIDTH
62  inConn->connect(inNet);
63  } else {
64  boost::shared_ptr<_Connectable> bit = inConn->get(inIndices);
65  bit->connect(inNet);
66  }
67  } catch(Error& e) {
68  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
69  throw;
70  }
71 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::generic::copyParams ( const Instance &  inOriginal,
const InstanceSharedPtr &  outCloned,
const ObjectFactorySharedPtr &  inFactory 
)

Definition at line 21 of file Cloning.cpp.

22  {
23 
24  ParameterMapSharedPtr params = inOriginal.getParameters();
25  ParameterMapSharedPtr clonedParams = outCloned->getParameters();
26  ParameterContext origContext = inOriginal.getParameterContext();
27  ParameterContext clonedContext = outCloned->getParameterContext();
28  std::map<std::string, ParameterSharedPtr> overriddenParams;
29  params->getOverriddenParameters(origContext, overriddenParams);
30  for(std::map<std::string, ParameterSharedPtr>::iterator it = overriddenParams.begin();
31  it != overriddenParams.end(); ++it) {
32  ParameterSharedPtr clonedParam = clone((*it).second, inFactory);
33  clonedParams->set(clonedContext, (*it).first, clonedParam);
34  }
35 }
boost::shared_ptr< Parameter > ParameterSharedPtr
boost::shared_ptr< _Tp > clone(const boost::shared_ptr< _Tp > &inPointer, const ObjectFactorySharedPtr &inFactory)
Definition: Cloning.hpp:63
boost::shared_ptr< ParameterMap > ParameterMapSharedPtr

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename _Connectable >
void torc::generic::findLeafConnectable ( std::vector< std::string > &  nestedNames,
boost::shared_ptr< _Connectable > &  conn 
)
throw (Error
)

Definition at line 22 of file InternalUtilityFunctions.hpp.

23  {
24  std::vector<std::string>::reverse_iterator name = nestedNames.rbegin();
25  std::vector<std::string>::reverse_iterator end = nestedNames.rend();
26  ++name;
27  if(!conn) {
28  Error e(eMessageIdErrorNullPointer, __FUNCTION__, __FILE__, __LINE__);
29  throw e;
30  }
31  for(; name != end; ++name) {
32  if(eCompositionTypeBundle != conn->getCompositionType()) {
33  Error e(eMessageIdErrorUnsupoortedOperation, __FUNCTION__, __FILE__, __LINE__);
34  e.saveContextData("Name", *name);
35  e.saveContextData("Operation", std::string("Find child"));
36  throw e;
37  }
38  std::vector < boost::shared_ptr<_Connectable> > children;
39  conn->getChildren(children);
40  bool found = false;
41  for(typename std::vector<boost::shared_ptr<_Connectable> >::iterator it = children.begin();
42  it != children.end(); ++it) {
43  if((*it)->getName() == *name) {
44  conn = (*it);
45  found = true;
46  break;
47  }
48  }
49  if(!found) {
50  Error e(eMessageIdErrorItemNotFound, __FUNCTION__, __FILE__, __LINE__);
51  e.saveContextData("Name", (*name));
52  throw;
53  }
54  }
55 }
std::string string

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::generic::flatten ( const InstanceSharedPtr inInstance,
const ObjectFactorySharedPtr inFactory,
bool  inRecursive = false,
const std::string &  inSeparator = "/",
const InstanceRenamingFunction inInstanceRenameFunc = InstanceRenamingFunction(getRenamedName< InstanceSharedPtr >),
const NetRenamingFunction inNetRenameFunc = NetRenamingFunction(getRenamedName< NetSharedPtr >),
const InstanceNamingFunction inInstanceNameFunc = InstanceNamingFunction(getModifiedName< InstanceSharedPtr >),
const NetNamingFunction inNetNameFunc = NetNamingFunction(getModifiedName< NetSharedPtr >) 
)
throw (Error
)

Flatten a given instance. Instance flattening is an operation where a given instance is replaced the internals of it's master in a given view. Instance flattening can be achieved on Single or Array Instances. However, it is not supported on the elements of an instance array.

Parameters
[in]inInstanceThe instance that need to be flattened. This will be removed after the operation.
[in]inFactoryThe object factory used for cloning components in the instance.
[in]inRecursiveIf true, Flatten instance hierarchy.
[in]inSeparatorUse this separator to separate hierarchy elements
[in]inInstanceRenameFuncFunction used to generate original name of new instances
[in]inNetRenamingFuncFunction used to generate original name of new rename
[in]inInstanceNameFuncFunction used to generate name of new instances
[in]inNetNamingFuncFunction used to generate name of new nets
Note
When connections are made to individual elements of a vector net using for example, say, the portList construct, the bits of the vectors are appropriately broken up into individual scalar nets, and connections removed from the vector nets.

Definition at line 739 of file Flattening.cpp.

743  {
744  FlatteningHelpers *pHelper = FlatteningHelpers::instance();
745  pHelper->setSeparator(inSeparator);
746  pHelper->setInstanceRenamingFunction(inInstanceRenameFunc);
747  pHelper->setNetRenamingFunction(inNetRenameFunc);
748  pHelper->setInstanceNamingFunction(inInstanceNameFunc);
749  pHelper->setNetNamingFunction(inNetNameFunc);
750  if(inRecursive) {
751  std::list<InstanceSharedPtr> newInstances;
752  if(!flatten_impl(inInstance, inFactory, newInstances)) {
753  return;
754  }
755  while(!newInstances.empty()) {
756  std::list<InstanceSharedPtr>::iterator top = newInstances.begin();
757  InstanceSharedPtr inst = *top;
758  newInstances.erase(top);
759  flatten_impl(inst, inFactory, newInstances);
760  }
761  } else {
762  std::list < InstanceSharedPtr > dummy;
763  flatten_impl(inInstance, inFactory, dummy);
764  }
765  pHelper->reset();
766  return;
767 }
boost::shared_ptr< Instance > InstanceSharedPtr

+ Here is the caller graph for this function:

void torc::generic::flatten ( const ViewSharedPtr inView,
const ObjectFactorySharedPtr inFactory,
bool  inRecursive = false,
const std::string &  inSeparator = "/",
const InstanceRenamingFunction inInstanceRenameFunc = InstanceRenamingFunction(getRenamedName< InstanceSharedPtr >),
const NetRenamingFunction inNetRenameFunc = NetRenamingFunction(getRenamedName< NetSharedPtr >),
const InstanceNamingFunction inInstanceNameFunc = InstanceNamingFunction(getModifiedName< InstanceSharedPtr >),
const NetNamingFunction inNetNameFunc = NetNamingFunction(getModifiedName< NetSharedPtr >) 
)
throw (Error
)

Flatten all instances in a given view. Instance flattening is an operation where a given instance is replaced the internals of it's master in a given view. Instance flattening can be achieved on Single or Array Instances. However, it is not supported on the elements of an instance array. Difference with the normal flatten() function is that this will keep flattening all instances in the gien view until a set of leaf instances is received. A Leaf Instance is an instance where the view has only interface delcarations and no instantiations of other cells within it.

Parameters
[in]inViewAll instances in the given view will be flatten.
[in]inFactoryThe object factory used for cloning components in the instance.
[in]inRecursiveIf true, Flatten instance hierarchy.
[in]inSeparatorUse this separator to separate hierarchy elements
[in]inInstanceRenameFuncFunction used to generate original name of new instances
[in]inNetRenamingFuncFunction used to generate original name of new rename
[in]inInstanceNameFuncFunction used to generate name of new instances
[in]inNetNamingFuncFunction used to generate name of new nets
Note
When connections are made to individual elements of a vector net using for example, say, the portList construct, the bits of the vectors are appropriately broken up into individual scalar nets, and conections removed from the vector nets.

Definition at line 769 of file Flattening.cpp.

772  {
773  if(!inView || !inFactory) {
774  return;
775  }
776  std::vector<InstanceSharedPtr> outInstances;
777  inView->getInstances(outInstances);
778  std::vector<InstanceSharedPtr>::iterator instIt = outInstances.begin();
779  for(; instIt != outInstances.end(); instIt++) {
780  InstanceSharedPtr inst = *instIt;
781  if(inst) {
782  flatten(inst, inFactory, inRecursive, inSeparator, inInstanceRenameFunc,
783  inNetRenameFunc, inInstanceNameFunc, inNetNameFunc);
784  }
785  }
786  return;
787 }
boost::shared_ptr< Instance > InstanceSharedPtr
void flatten(const DesignSharedPtr &inDesign, const ObjectFactorySharedPtr &inFactory, bool inRecursive, const std::string &inSeparator, const InstanceRenamingFunction &inInstanceRenameFunc, const NetRenamingFunction &inNetRenameFunc, const InstanceNamingFunction &inInstanceNameFunc, const NetNamingFunction &inNetNameFunc)
Definition: Flattening.cpp:789

+ Here is the call graph for this function:

void torc::generic::flatten ( const DesignSharedPtr inDesign,
const ObjectFactorySharedPtr inFactory,
bool  inRecursive = false,
const std::string &  inSeparator = "/",
const InstanceRenamingFunction inInstanceRenameFunc = InstanceRenamingFunction(getRenamedName< InstanceSharedPtr >),
const NetRenamingFunction inNetRenameFunc = NetRenamingFunction(getRenamedName< NetSharedPtr >),
const InstanceNamingFunction inInstanceNameFunc = InstanceNamingFunction(getModifiedName< InstanceSharedPtr >),
const NetNamingFunction inNetNameFunc = NetNamingFunction(getModifiedName< NetSharedPtr >) 
)
throw (Error
)

Flatten a given design, all NETLIST views owned by the design cell will be flattened. Instance flattening is an operation where a given instance is replaced the internals of it's master in a given view. Instance flattening can be achieved on Single or Array Instances. However, it is not supported on the elements of an instance array. Difference with the normal flatten() function is that this will keep flattening all instances in the given design until a set of leaf instances is received. A Leaf Instance is an instance where the view has only interface delcarations and no instantiations of other cells within it.

Parameters
[in]inDesignThe design that need to be flattened.
[in]inFactoryThe object factory used for cloning components in the instance.
[in]inRecursiveIf true, Flatten instance hierarchy.
[in]inSeparatorUse this separator to separate hierarchy elements
[in]inInstanceRenameFuncFunction used to generate original name of new instances
[in]inNetRenamingFuncFunction used to generate original name of new rename
[in]inInstanceNameFuncFunction used to generate name of new instances
[in]inNetNamingFuncFunction used to generate name of new nets
Note
When connections are made to individual elements of a vector net using for example, say, the portList construct, the bits of the vectors are appropriately broken up into individual scalar nets, and conections removed from the vector nets.

Definition at line 789 of file Flattening.cpp.

793  {
794  if(!inDesign || !inFactory) {
795  return;
796  }
797  std::string cellName = inDesign->getCellRefName();
798  std::string libName = inDesign->getLibraryRefName();
799  RootSharedPtr root = inDesign->getParent();
800  if(!root) {
801  Error e(eMessageIdErrorPointerToItemDoesNotExist, __FUNCTION__, __FILE__, __LINE__);
802  e.saveContextData("Pointer to Root", root);
803  throw e;
804  }
805  LibrarySharedPtr library = root->findLibrary(libName);
806  if(!library) {
807  Error e(eMessageIdErrorPointerToItemDoesNotExist, __FUNCTION__, __FILE__, __LINE__);
808  e.saveContextData("Pointer to Library", library);
809  throw e;
810  }
811  CellSharedPtr cell = library->findCell(cellName);
812  if(!cell) {
813  Error e(eMessageIdErrorPointerToItemDoesNotExist, __FUNCTION__, __FILE__, __LINE__);
814  e.saveContextData("Pointer to Cell", cell);
815  throw e;
816  }
817 
818  std::vector<ViewSharedPtr> outViews;
819  cell->getViews(outViews);
820  std::vector<ViewSharedPtr>::iterator viewIt = outViews.begin();
821  for(; viewIt != outViews.end(); viewIt++) {
822  ViewSharedPtr view = *viewIt;
823  if(View::eTypeNetlist != view->getType()) {
824  continue;
825  }
826  flatten(view, inFactory, inRecursive, inSeparator, inInstanceRenameFunc, inNetRenameFunc,
827  inInstanceNameFunc, inNetNameFunc);
828  }
829 }
void flatten(const DesignSharedPtr &inDesign, const ObjectFactorySharedPtr &inFactory, bool inRecursive, const std::string &inSeparator, const InstanceRenamingFunction &inInstanceRenameFunc, const NetRenamingFunction &inNetRenameFunc, const InstanceNamingFunction &inInstanceNameFunc, const NetNamingFunction &inNetNameFunc)
Definition: Flattening.cpp:789
std::string string
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
boost::shared_ptr< Library > LibrarySharedPtr
boost::shared_ptr< View > ViewSharedPtr
boost::shared_ptr< Cell > CellSharedPtr
boost::shared_ptr< Root > RootSharedPtr

+ Here is the call graph for this function:

template<typename _Pointer >
std::string torc::generic::getModifiedName ( const std::string &  inInstName,
const _Pointer &  inNameable,
const std::vector< size_t > &  inIndicesVector = std::vector< size_t >() 
)

Generate name for a newly generated object during flattening This function generates names for objects during flattening. The default generated name is of the form of parent_child_index. However if the name exceeds 255 characters this will be changed to N00000001, N00000002 etc. The naming N00000001 etc restart for each object type. Therefore, there may be both and instance and a net having the name N00000001. This is allowed in EDIF 2 0 0.

Definition at line 707 of file Flattening.cpp.

709  {
710  return (*NameModifier<_Pointer>::instance())(inInstName, inNameable, inIndicesVector);
711 }
template std::string torc::generic::getModifiedName ( const std::string &  inInstName,
const NetSharedPtr inNameable,
const std::vector< size_t > &  inIndicesVector 
)
template std::string torc::generic::getModifiedName ( const std::string &  inInstName,
const InstanceSharedPtr inNameable,
const std::vector< size_t > &  inIndicesVector 
)
template<typename _Pointer >
std::string torc::generic::getRenamedName ( const InstanceSharedPtr inParentInstance,
const _Pointer &  inRenamable,
const std::vector< size_t > &  inIndicesVector = std::vector< size_t >() 
)

Generate original name for a newly generated object during flattening This function generates original names for objects during flattening. Unlike names these string do not have a restriction of 255 characters and are stored in the rename construct attached to a net or instance. The generated name is of the form Parent[index]/Child However the '/' can be replaced by a custom separator that can be specified as a parameter to the flatten() function.

Definition at line 713 of file Flattening.cpp.

715  {
716  std::string sep = FlatteningHelpers::instance()->getSeparator();
717  Renamable::Name originalName = inRenamable->getOriginalName();
718  if(originalName.empty()) {
719  originalName = inRenamable->getName();
720  }
721  std::string parentInstanceName = inParentInstance->getOriginalName();
722  if(parentInstanceName.empty()) {
723  parentInstanceName = inParentInstance->getName();
724  }
725  if(!inIndicesVector.empty()) {
726  parentInstanceName += "[ ";
727  std::ostringstream sout;
728  copy(inIndicesVector.begin(), inIndicesVector.end(),
729  std::ostream_iterator < size_t > (sout, " "));
730  parentInstanceName += sout.str();
731  parentInstanceName += "]";
732  }
733  std::ostringstream sout;
734  sout << ((parentInstanceName.find_first_of(sep)) ? sep : "") << parentInstanceName << sep
735  << originalName;
736  return sout.str();
737 }
std::string string
template std::string torc::generic::getRenamedName ( const InstanceSharedPtr inParentInstance,
const NetSharedPtr inRenamable,
const std::vector< size_t > &  inIndicesVector 
)
template std::string torc::generic::getRenamedName ( const InstanceSharedPtr inParentInstance,
const InstanceSharedPtr inRenamable,
const std::vector< size_t > &  inIndicesVector 
)
void torc::generic::log ( const char *  fmt,
  ... 
)

Definition at line 89 of file Log.cpp.

89  {
90 #ifdef LOGGING
91  va_list args;
92  va_start(args, fmt);
93  Logger::instance()->write(fmt, args);
94  va_end(args);
95 #endif
96  return;
97 }

+ Here is the caller graph for this function:

void torc::generic::openLogFile ( const std::string &  logFileName)

Definition at line 82 of file Log.cpp.

82  {
83 #ifdef LOGGING
84  Logger::instance()->openLogFile(logFileName);
85 #endif
86  return;
87 }
bool torc::generic::operator!= ( const location &  loc1,
const location &  loc2 
)
inline

Compare two location objects.

Definition at line 135 of file generic/edif/location.hh.

136  {
137  return !(loc1 == loc2);
138  }
bool torc::generic::operator!= ( const position &  pos1,
const position &  pos2 
)
inline

Compare two position objects.

Definition at line 141 of file generic/edif/position.hh.

142  {
143  return !(pos1 == pos2);
144  }
const location torc::generic::operator+ ( const location &  begin,
const location &  end 
)
inline

Join two location objects to create a location.

Definition at line 104 of file generic/edif/location.hh.

105  {
106  location res = begin;
107  res.end = end.end;
108  return res;
109  }
const position torc::generic::operator+ ( const position &  begin,
const int  width 
)
inline

Add two position objects.

Definition at line 109 of file generic/edif/position.hh.

110  {
111  position res = begin;
112  return res += width;
113  }
const location torc::generic::operator+ ( const location &  begin,
unsigned int  width 
)
inline

Add two location objects.

Definition at line 112 of file generic/edif/location.hh.

113  {
114  location res = begin;
115  res.columns (width);
116  return res;
117  }

+ Here is the call graph for this function:

const position& torc::generic::operator+= ( position &  res,
const int  width 
)
inline

Add and assign a position.

Definition at line 101 of file generic/edif/position.hh.

102  {
103  res.columns (width);
104  return res;
105  }

+ Here is the call graph for this function:

location& torc::generic::operator+= ( location &  res,
unsigned int  width 
)
inline

Add and assign a location.

Definition at line 120 of file generic/edif/location.hh.

121  {
122  res.columns (width);
123  return res;
124  }

+ Here is the call graph for this function:

const position torc::generic::operator- ( const position &  begin,
const int  width 
)
inline

Add two position objects.

Definition at line 124 of file generic/edif/position.hh.

125  {
126  return begin + -width;
127  }
const position& torc::generic::operator-= ( position &  res,
const int  width 
)
inline

Add and assign a position.

Definition at line 117 of file generic/edif/position.hh.

118  {
119  return res += -width;
120  }
std::ostream& torc::generic::operator<< ( std::ostream &  ostr,
const location &  loc 
)
inline

Intercept output stream redirection.

Parameters
ostrthe destination output stream
loca reference to the location to redirect

Avoid duplicate information.

Definition at line 146 of file generic/edif/location.hh.

147  {
148  position last = loc.end - 1;
149  ostr << loc.begin;
150  if (last.filename
151  && (!loc.begin.filename
152  || *loc.begin.filename != *last.filename))
153  ostr << '-' << last;
154  else if (loc.begin.line != last.line)
155  ostr << '-' << last.line << '.' << last.column;
156  else if (loc.begin.column != last.column)
157  ostr << '-' << last.column;
158  return ostr;
159  }
std::ostream& torc::generic::operator<< ( std::ostream &  ostr,
const position &  pos 
)
inline

Intercept output stream redirection.

Parameters
ostrthe destination output stream
posa reference to the position to redirect

Definition at line 151 of file generic/edif/position.hh.

152  {
153  if (pos.filename)
154  ostr << *pos.filename << ':';
155  return ostr << pos.line << '.' << pos.column;
156  }
bool torc::generic::operator== ( const location &  loc1,
const location &  loc2 
)
inline

Compare two location objects.

Definition at line 128 of file generic/edif/location.hh.

129  {
130  return loc1.begin == loc2.begin && loc1.end == loc2.end;
131  }

+ Here is the caller graph for this function:

bool torc::generic::operator== ( const position &  pos1,
const position &  pos2 
)
inline

Compare two position objects.

Definition at line 131 of file generic/edif/position.hh.

132  {
133  return
134  (pos1.filename == pos2.filename
135  || (pos1.filename && pos2.filename && *pos1.filename == *pos2.filename))
136  && pos1.line == pos2.line && pos1.column == pos2.column;
137  }
void torc::generic::prune ( RootSharedPtr inRootPtr)

Prune all unused cells and libraries from the given root.

Parameters
inRootPtrThe root to prune.

Definition at line 58 of file Pruning.cpp.

58  {
59 
60  // declare a map of all cells actually used by this root
61  CellUsageMap cellUsageMap;
62 
63  // iterate over all of the libraries and collect all cells
64  typedef std::vector<LibrarySharedPtr> LibrarySharedPtrVector;
65  LibrarySharedPtrVector libraries;
66  inRootPtr->getLibraries(libraries);
67  LibrarySharedPtrVector::iterator lp = libraries.begin();
68  LibrarySharedPtrVector::iterator le = libraries.end();
69  while(lp < le) {
70  // look up the library name and specifics
71  LibrarySharedPtr libraryPtr = *lp++;
72  // iterate over all library cells
73  typedef std::vector<CellSharedPtr> CellSharedPtrVector;
74  CellSharedPtrVector cells;
75  libraryPtr->getCells(cells);
76  CellSharedPtrVector::iterator cp = cells.begin();
77  CellSharedPtrVector::iterator ce = cells.end();
78  while(cp < ce) {
79  // look up the cell
80  CellSharedPtr cellPtr = *cp++;
81  cellUsageMap[cellPtr] = 0;
82  }
83  }
84 
85  // iterate over all of the designs and collect cell usage counts
86  typedef std::vector<DesignSharedPtr> DesignSharedPtrVector;
87  DesignSharedPtrVector designs;
88  inRootPtr->getDesigns(designs);
89  DesignSharedPtrVector::iterator dp = designs.begin();
90  DesignSharedPtrVector::iterator de = designs.end();
91  while(dp < de) {
92  // look up the design name and specifics
93  DesignSharedPtr designPtr = *dp++;
94  std::string designName = designPtr->getName();
95  std::string cellName = designPtr->getCellRefName();
96  std::string libraryName = designPtr->getLibraryRefName();
97  // look up the design cell
98  LibrarySharedPtr libraryPtr = inRootPtr->findLibrary(libraryName);
99  CellSharedPtr cellPtr = libraryPtr->findCell(cellName);
100  log("Examining library %s, cell %s, design %s.\n", libraryName.c_str(), cellName.c_str(),
101  designName.c_str());
102  // ensure that this design cell is properly counted
103  cellUsageMap[cellPtr]++;
104  // iterate over all cell views
105  typedef std::vector<ViewSharedPtr> ViewSharedPtrVector;
106  ViewSharedPtrVector views;
107  cellPtr->getViews(views);
108  ViewSharedPtrVector::iterator vp = views.begin();
109  ViewSharedPtrVector::iterator ve = views.end();
110  while(vp < ve) {
111  // look up the view
112  ViewSharedPtr viewPtr = *vp++;
113  // collect all cells
114  collectCells(viewPtr, cellUsageMap);
115  }
116  }
117 
118  // display all cells that are in use
119  CellUsageMap::iterator cp = cellUsageMap.begin();
120  CellUsageMap::iterator ce = cellUsageMap.end();
121  while(cp != ce) {
122  // look up the cell information
123  CellUsageMap::value_type cellUsage = *cp++;
124  CellSharedPtr cellPtr = cellUsage.first;
125  LibrarySharedPtr libraryPtr = cellUsage.first->getParent();
126  std::string cellName = cellPtr->getName();
127  std::string libraryName = libraryPtr->getName();
128  log(" library %s, cell %s: %d\n", libraryName.c_str(), cellName.c_str(),
129  cellUsage.second);
130  if(cellUsage.second == 0) {
131  log(" removing unused cell %s from library %s: %s.\n", cellName.c_str(),
132  libraryName.c_str(), libraryPtr->findCell(cellName) ? "found" : "not found");
133  libraryPtr->removeCell(cellName);
134  }
135  }
136 
137  // iterate over all of the libraries and remove empty ones
138  for(LibrarySharedPtrVector::size_type i = 0; i < libraries.size(); i++) {
139  // look up the library name and specifics
140  LibrarySharedPtr libraryPtr = libraries[i];
141  std::string libraryName = libraryPtr->getName();
142  // if the library has no cells, remove it
143  typedef std::vector<CellSharedPtr> CellSharedPtrVector;
144  CellSharedPtrVector cells;
145  libraryPtr->getCells(cells);
146  if(cells.size() == 0) {
147  log(" removing unused library %s.\n", libraryName.c_str());
148  inRootPtr->removeLibrary(libraryName);
149  }
150  }
151 
152 }
void log(const char *fmt,...)
Definition: Log.cpp:89
std::vector< DesignSharedPtr > DesignSharedPtrVector
Vector of Design shared pointers.
std::string string
boost::shared_ptr< Design > DesignSharedPtr
boost::shared_ptr< Library > LibrarySharedPtr
void collectCells(ViewSharedPtr &inViewPtr, CellUsageMap &inoutCellUsageMap)
Recursively collect and count all cells used in the given view. The CellUsageMap must already be ini...
Definition: Pruning.cpp:36
boost::shared_ptr< View > ViewSharedPtr
boost::shared_ptr< Cell > CellSharedPtr
std::map< CellSharedPtr, int > CellUsageMap
A map from cell shared pointer to usage count.
Definition: Pruning.hpp:28

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename _Tp >
void torc::generic::runVisitor ( _Tp &  inoutVisited,
BaseVisitor &  inoutVisitor 
)
throw (Error
)

Definition at line 78 of file VisitorType.hpp.

79  {
80  typedef VisitorType<_Tp> ConcreteVisitor;
81 
82  if(ConcreteVisitor *p = dynamic_cast<ConcreteVisitor *>(&inoutVisitor)) {
83  try {
84  p->visit(inoutVisited);
85  } catch(Error& e) {
86  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
87  throw;
88  }
89  return;
90  }
91  //TBD::Error?Fallback?
92  return;
93 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function: