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

Namespace for the Torc physical netlist, including the XDL importer, exporter, placer, router, unpacker, and packer. More...

Namespaces

 physical
 

Data Structures

class  CombinationalPath
 Routing net. More...
 
class  Component
 Hierarchical componenet. More...
 
class  Connection
 Hierarchical componenet. More...
 
class  ConnectionPin
 Physical design connection-pin pair, suitable for specifying a net endpoint. More...
 
class  Element
 Element composed of connections and pins. More...
 
class  ParsePrimitive
 Pare Primitives. More...
 
class  Primitive
 primitive. More...
 
class  PrimitivePin
 Physical design primitive-pin. More...
 
class  PrimitiveSet
 PrimitiveSet. More...
 
class  RcFactory
 RcFactory class for physical netlist elements. More...
 
class  RoutingNet
 Routing net. More...
 
class  WritePrimitive
 Pare Primitives. More...
 
class  XdlUnpack
 
class  Circuit
 Circuit composed of instances and nets. More...
 
class  RenamableInstance
 
class  Config
 Configuration. A {name:value} pair. More...
 
class  ConfigMap
 Configuration setting map. More...
 
class  Design
 Physical netlist design. More...
 
class  Factory
 Factory class for physical netlist elements. More...
 
class  Instance
 Physical design instance. More...
 
class  InstancePinBase
 Physical design instance-pin pair, suitable for specifying a net endpoint. More...
 
class  InstancePin
 Physical design instance-pin pair, suitable for specifying a net endpoint. More...
 
class  InstanceReference
 Instantiation of a module instance. More...
 
class  Module
 Hierarchical module. More...
 
class  ModuleTransformer
 Utility class to modularize/flatten designs. More...
 
class  Named
 Concept for any object that can be named. More...
 
class  NameComparator
 Comparator class to serve as a predicate when searching for names. More...
 
class  Net
 Physical design net. More...
 
class  Pip
 Physical design programmable interconnect point. More...
 
class  Port
 Module input or output port. More...
 
class  PortTemp
 Temporary module port. More...
 
class  Progenitor
 Concept for any object that may have children. More...
 
class  Progeny
 Concept for any object that may have a parent. More...
 
class  Renamable
 Concept for any object that can be renamed. More...
 
class  Routethrough
 Pip routethrough. More...
 
class  TilewirePlaceholder
 Drop-in placeholder for a Tilewire with no torc::architecture dependencies. More...
 
class  XdlExporter
 Physical design exporter for XDL. More...
 
class  XdlImporter
 Importer from XDL format into a physical design. More...
 
class  WireName
 Encapsulation of a wire name. More...
 
class  TileName
 Encapsulation of a tile name. More...
 
class  TileTypeName
 Encapsulation of a tile type name. More...
 
class  InstanceName
 Encapsulation of an instance name. More...
 
class  SiteName
 Encapsulation of a site name. More...
 
class  SiteTypeName
 Encapsulation of a site type name. More...
 
class  PinName
 Encapsulation of a site pin name. More...
 

Typedefs

typedef boost::shared_ptr
< CombinationalPath
CombinationalPathSharedPtr
 Shared pointer encapsulation of a CombinationalPath. More...
 
typedef std::vector
< CombinationalPathSharedPtr
CombinationalPathSharedPtrVector
 Vector of CombinationalPath shared pointers. More...
 
typedef boost::shared_ptr
< Component
ComponentSharedPtr
 Shared pointer encapsulation of a componenet. More...
 
typedef boost::weak_ptr
< Component
ComponentWeakPtr
 Weak pointer encapsulation of a componenet. More...
 
typedef std::vector
< ComponentSharedPtr
ComponentSharedPtrVector
 Vector of componenet shared pointers. More...
 
typedef boost::shared_ptr
< Connection
ConnectionSharedPtr
 Shared pointer encapsulation of a componenet. More...
 
typedef boost::weak_ptr
< Connection
ConnectionWeakPtr
 Weak pointer encapsulation of a componenet. More...
 
typedef std::vector
< ConnectionSharedPtr
ConnectionSharedPtrVector
 Vector of componenet shared pointers. More...
 
typedef std::vector
< ConnectionPin
ConnectionPinVector
 Vector of connection pins. More...
 
typedef vector< string > ConfigVector
 
typedef boost::shared_ptr
< Element
ElementSharedPtr
 Shared pointer encapsulation of a element. More...
 
typedef boost::weak_ptr< ElementElementWeakPtr
 Weak pointer encapsulation of a element. More...
 
typedef std::vector
< ElementSharedPtr
ElementSharedPtrVector
 Vector of element shared pointers. More...
 
typedef boost::shared_ptr
< Primitive
PrimitiveSharedPtr
 Shared pointer encapsulation of a Primitive. More...
 
typedef std::vector
< PrimitiveSharedPtr
PrimitiveSharedPtrVector
 Vector of Primitive shared pointers. More...
 
typedef std::vector< PrimitivePinPrimitivePinVector
 Vector of primitive pins. More...
 
typedef boost::shared_ptr
< PrimitivePin
PrimitivePinSharedPtr
 Shared pointer encapsulation of a componenet. More...
 
typedef boost::weak_ptr
< PrimitivePin
PrimitivePinWeakPtr
 Weak pointer encapsulation of a componenet. More...
 
typedef std::vector
< PrimitivePinSharedPtr
PrimitivePinSharedPtrVector
 Vector of componenet shared pointers. More...
 
typedef boost::shared_ptr
< PrimitiveSet
PrimitiveSetSharedPtr
 Shared pointer encapsulation of a PrimitiveSet. More...
 
typedef boost::weak_ptr
< PrimitiveSet
PrimitiveSetWeakPtr
 Shared pointer encapsulation of a PrimitiveSet. More...
 
typedef std::vector
< PrimitiveSetSharedPtr
PrimitiveSetSharedPtrVector
 Vector of PrimitiveSet shared pointers. More...
 
typedef boost::shared_ptr
< RoutingNet
RoutingNetSharedPtr
 Shared pointer encapsulation of a RoutingNet. More...
 
typedef std::vector
< RoutingNetSharedPtr
RoutingNetSharedPtrVector
 Vector of RoutingNet shared pointers. More...
 
typedef boost::shared_ptr
< Circuit
CircuitSharedPtr
 Shared pointer encapsulation of a Circuit. More...
 
typedef boost::weak_ptr< CircuitCircuitWeakPtr
 Weak pointer encapsulation of a Circuit. More...
 
typedef std::vector
< CircuitSharedPtr
CircuitSharedPtrVector
 Vector of Circuit shared pointers. More...
 
typedef boost::shared_ptr
< class RenamableInstance
RenamableInstanceSharedPtr
 
typedef boost::shared_ptr< DesignDesignSharedPtr
 Shared pointer encapsulation of a Design. More...
 
typedef std::vector
< DesignSharedPtr
DesignSharedPtrVector
 Vector of Design shared pointers. More...
 
typedef boost::shared_ptr
< class InstancePin
InstancePinSharedPtr
 Shared pointer encapsulation of an InstancePin. More...
 
typedef boost::weak_ptr< class
InstancePin
InstancePinWeakPtr
 Weak pointer encapsulation of an InstancePin. More...
 
typedef std::vector
< InstancePinSharedPtr
InstancePinSharedPtrVector
 Vector of InstancePin shared pointers. More...
 
typedef boost::shared_ptr
< Instance
InstanceSharedPtr
 Shared pointer encapsulation of an Instance. More...
 
typedef boost::weak_ptr< InstanceInstanceWeakPtr
 Weak pointer encapsulation of an Instance. More...
 
typedef std::vector
< InstanceSharedPtr
InstanceSharedPtrVector
 Vector of Instance shared pointers. More...
 
typedef boost::shared_ptr
< InstanceReference
InstanceReferenceSharedPtr
 Shared pointer encapsulation of an InstanceReference. More...
 
typedef boost::weak_ptr
< InstanceReference
InstanceReferenceWeakPtr
 Weak pointer encapsulation of an InstanceReference. More...
 
typedef boost::shared_ptr< ModuleModuleSharedPtr
 Shared pointer encapsulation of a Module. More...
 
typedef boost::weak_ptr< ModuleModuleWeakPtr
 Weak pointer encapsulation of a Module. More...
 
typedef std::vector
< ModuleSharedPtr
ModuleSharedPtrVector
 Vector of Module shared pointers. More...
 
typedef boost::shared_ptr< NamedNamedSharedPtr
 Shared pointer encapsulation of a Named object. More...
 
typedef boost::shared_ptr< NetNetSharedPtr
 Shared pointer encapsulation of a Net. More...
 
typedef boost::weak_ptr< NetNetWeakPtr
 Weak pointer encapsulation of a Net. More...
 
typedef std::vector< NetSharedPtrNetSharedPtrVector
 Vector of Net shared pointers. More...
 
typedef std::vector< PipPipVector
 Vector of pips. More...
 
typedef boost::shared_ptr< PipPipSharedPtr
 Shared pointer encapsulation of a Pip. More...
 
typedef boost::weak_ptr< PipPipWeakPtr
 Weak pointer encapsulation of a Pip. More...
 
typedef std::vector< PipSharedPtrPipSharedPtrVector
 Vector of Pip shared pointers. More...
 
typedef boost::shared_ptr< PortPortSharedPtr
 Shared pointer encapsulation of a Port. More...
 
typedef boost::weak_ptr< PortPortWeakPtr
 Weak pointer encapsulation of a Port. More...
 
typedef std::vector
< PortSharedPtr
PortSharedPtrVector
 Vector of Port shared pointers. More...
 
typedef std::vector< PortTempPortTempVector
 Vector. More...
 
typedef boost::shared_ptr
< Routethrough
RoutethroughSharedPtr
 Shared pointer encapsulation of a Routethrough. More...
 
typedef boost::weak_ptr
< Routethrough
RoutethroughWeakPtr
 Weak pointer encapsulation of a Routethrough. More...
 
typedef boost::uint64_t SequenceIndex
 Typedef for generic sequences. More...
 

Enumerations

enum  PinType { Unknown, InputP, OutputP }
 
enum  EInstanceBonding { eInstanceBondingUnbonded = 0, eInstanceBondingBonded, eInstanceBondingUnknown, eInstanceBondingCount }
 Enumeration of pad bonding types. More...
 
enum  EPinDirection { ePinDirectionInpin = 0, ePinDirectionOutpin, ePinDirectionUnknown, ePinDirectionCount }
 Enumeration of instance pin directionality. More...
 
enum  EPipDirection {
  ePipBidirectionalUnbuffered = 0, ePipBidirectionalUnidirectionallyBuffered, ePipBidirectionalBidirectionallyBuffered, ePipUnidirectionalBuffered,
  ePipDirectionCount
}
 Enumeration of pip directionality. More...
 
enum  ENetType { eNetTypeNormal = 0, eNetTypePower, eNetTypeGround, eNetTypeCount }
 Enumeration of net power types. More...
 
enum  ESequenceIndex { eSequenceIndexNone = 0, eSequenceIndexFirst }
 Enumeration of sequence indexes. More...
 

Functions

 BOOST_AUTO_TEST_CASE (XdlUnpackUnitTest)
 Unit test for the XdlUnpack class. More...
 
 BOOST_AUTO_TEST_CASE (CircuitUnitTest)
 Unit test for the Circuit class. More...
 
 BOOST_AUTO_TEST_CASE (ConfigMapUnitTest)
 Unit test for the ConfigMap class. More...
 
 BOOST_AUTO_TEST_CASE (ConfigUnitTest)
 Unit test for the Config class. More...
 
 BOOST_AUTO_TEST_CASE (DesignRegressionTest)
 Basic regression test for the entire XDL infrastructure. More...
 
 BOOST_AUTO_TEST_CASE (DesignUnitTest)
 Unit test for the Design class. More...
 
 BOOST_AUTO_TEST_CASE (FactoryUnitTest)
 Unit test for the Factory class. More...
 
 BOOST_AUTO_TEST_CASE (InstancePinUnitTest)
 Unit test for the InstancePin class. More...
 
 BOOST_AUTO_TEST_CASE (InstanceReferenceUnitTest)
 Unit test for the InstanceReference class. More...
 
 BOOST_AUTO_TEST_CASE (InstanceUnitTest)
 Unit test for the Instance class. More...
 
DesignSharedPtr verifyDesignOpenedSuccessfully (const string &inDesignFileName)
 Verify that the design file opened successfully. More...
 
InstanceSharedPtrVector getInstancesToModularize (DesignSharedPtr inDesignPtr)
 Retrieve the instances to modularize from the design and return them in a vector. More...
 
void preModularizationVerifications (DesignSharedPtr inDesignPtr)
 Perform pre-modularization tests on a design. More...
 
void postModularizationVerifications (DesignSharedPtr inDesignPtr, InstanceSharedPtrVector inInstanceVector, bool inKeepPlacement, bool inKeepRouting)
 Perform post-modularization tests on a design. More...
 
void preFlatteningVerifications (DesignSharedPtr inDesignPtr)
 Perform pre-flattening tests on a design. More...
 
void postFlatteningVerifications (DesignSharedPtr inDesignPtr, bool inKeepPlacement, bool inKeepRouting)
 Perform post-flattening tests on a design. More...
 
 BOOST_AUTO_TEST_CASE (ModularizeWithIntraNetUnitTest)
 Unit test for modularizing two instances with intra net. More...
 
 BOOST_AUTO_TEST_CASE (ModularizeWithInputInterNetUnitTest)
 Unit test for modularizing two instances with input inter net. More...
 
 BOOST_AUTO_TEST_CASE (ModularizeWithInputFanoutInterNetUnitTest)
 Unit test for modularizing two instances with input fanout input net. More...
 
 BOOST_AUTO_TEST_CASE (ModularizeWithOutputInterNetUnitTest)
 Unit test for modularizing two instances with output inter net. More...
 
 BOOST_AUTO_TEST_CASE (ModularizeWithOutputFanoutInterNetUnitTest)
 Unit test for modularizing two instances with output fanout inter net. More...
 
 BOOST_AUTO_TEST_CASE (ModularizeWithIntraAndInterNetUnitTest)
 Unit test for modularizing two instances with fanout intra and inter net. More...
 
 BOOST_AUTO_TEST_CASE (FlattenWithIntraNetUnitTest)
 Unit test for flattening a module with two instances and an intra net. More...
 
 BOOST_AUTO_TEST_CASE (FlattenWithInputInterNetUnitTest)
 Unit test for flattening two instances with input inter net. More...
 
 BOOST_AUTO_TEST_CASE (FlattenWithInputFanoutInterNetUnitTest)
 Unit test for flattening two instances with input fanout input net. More...
 
 BOOST_AUTO_TEST_CASE (FlattenWithOutputInterNetUnitTest)
 Unit test for flattening two instances with output inter net. More...
 
 BOOST_AUTO_TEST_CASE (FlattenWithOutputFanoutInterNetUnitTest)
 Unit test for flattening two instances with output fanout inter net. More...
 
 BOOST_AUTO_TEST_CASE (FlattenWithIntraAndInterNetUnitTest)
 Unit test for flattening two instances with fanout intra and inter net. More...
 
 BOOST_AUTO_TEST_CASE (ModuleUnitTest)
 Unit test for the Module class. More...
 
 BOOST_AUTO_TEST_CASE (NamedUnitTest)
 Unit test for the Named class. More...
 
 BOOST_AUTO_TEST_CASE (NetUnitTest)
 Unit test for the Net class. More...
 
std::ostream & operator<< (std::ostream &os, const Design &rhs)
 Design stream inserter. More...
 
std::ostream & operator<< (std::ostream &os, const Module &rhs)
 Module stream inserter. More...
 
std::ostream & operator<< (std::ostream &os, const Instance &rhs)
 Instance stream inserter. More...
 
std::ostream & operator<< (std::ostream &os, const Net &rhs)
 Net stream inserter. More...
 
std::ostream & operator<< (std::ostream &os, const InstancePin &rhs)
 InstancePin stream inserter. More...
 
std::ostream & operator<< (std::ostream &os, const Pip &rhs)
 Pip stream inserter. More...
 
std::ostream & operator<< (std::ostream &os, const Config &rhs)
 Config iterator stream inserter. More...
 
 BOOST_AUTO_TEST_CASE (OutputStreamHelpersUnitTest)
 Unit test for the output stream helpers. More...
 
 BOOST_AUTO_TEST_CASE (PipUnitTest)
 Unit test for the Pip class. More...
 
 BOOST_AUTO_TEST_CASE (PortUnitTest)
 Unit test for the Port class. More...
 
 BOOST_AUTO_TEST_CASE (ProgenitorUnitTest)
 Unit test for the Progenitor class. More...
 
 BOOST_AUTO_TEST_CASE (ProgenyUnitTest)
 Unit test for the Progeny class. More...
 
 BOOST_AUTO_TEST_CASE (RenamableUnitTest)
 Unit test for the Renamable class. More...
 
 BOOST_AUTO_TEST_CASE (RouteThroughUnitTest)
 Unit test for the Routethrough class. More...
 
 BOOST_AUTO_TEST_CASE (SampleCodeUnitTest)
 Unit test demonstrating some sample code. More...
 
 BOOST_AUTO_TEST_CASE (TilewirePlaceholderUnitTest)
 Unit test for the TilewirePlaceholder class. More...
 
 BOOST_AUTO_TEST_CASE (XdlExporterUnitTest)
 Unit test for the XdlExporter class. More...
 
 BOOST_AUTO_TEST_CASE (XdlImporterUnitTest)
 Unit test for the XdlImporter class. More...
 

Variables

static const char delimiters [] = " \n\t\f"
 
const string elementNames = "SRUSED REVUSED PRECYINIT DUSED CUSED COUTUSED CEUSED BUSED AUSED DCY0 CCY0 BCY0 ACY0 END"
 
const string extraMuxNames = "CY0G CY0F GYMUX DYMUX FXMUX DXMUX CYINIT DIG_MUX DIF_MUX XBMUX DOUTMUX COUTMUX BOUTMUX AOUTMUX DFFMUX CFFMUX BFFMUX AFFMUX ACY0 BCY0 CCY0 DCY0 PRECYINIT CDI1MUX BDI1MUX ADI1MUX WEMUX TMUX OMUX IDELMUX D2OBYP_SEL IFFDELMUX IFFMUX END"
 
const string extraInvNames = "CLKINV T1INV T2INV D1INV D2INV END"
 
static const string sInstanceOneName = "c1"
 
static const string sInstanceTwoName = "c2"
 
static const string sModuleDefinition = "aModule"
 
static const string sModuleInstanceName = "aModuleInstance"
 
static const string sHierarchySeparator = "/"
 

Detailed Description

Namespace for the Torc physical netlist, including the XDL importer, exporter, placer, router, unpacker, and packer.

Typedef Documentation

typedef boost::shared_ptr<Circuit> torc::physical::CircuitSharedPtr

Shared pointer encapsulation of a Circuit.

Definition at line 219 of file Circuit.hpp.

Vector of Circuit shared pointers.

Definition at line 225 of file Circuit.hpp.

typedef boost::weak_ptr<Circuit> torc::physical::CircuitWeakPtr

Weak pointer encapsulation of a Circuit.

Definition at line 222 of file Circuit.hpp.

Shared pointer encapsulation of a CombinationalPath.

Definition at line 303 of file CombinationalPath.hpp.

Vector of CombinationalPath shared pointers.

Definition at line 306 of file CombinationalPath.hpp.

typedef boost::shared_ptr<Component> torc::physical::ComponentSharedPtr

Shared pointer encapsulation of a componenet.

Definition at line 76 of file Component.hpp.

Vector of componenet shared pointers.

Definition at line 82 of file Component.hpp.

typedef boost::weak_ptr<Component> torc::physical::ComponentWeakPtr

Weak pointer encapsulation of a componenet.

Definition at line 79 of file Component.hpp.

typedef vector<string> torc::physical::ConfigVector

Definition at line 36 of file Element.hpp.

Vector of connection pins.

Definition at line 60 of file ConnectionPin.hpp.

typedef boost::shared_ptr<Connection> torc::physical::ConnectionSharedPtr

Shared pointer encapsulation of a componenet.

Definition at line 82 of file Connection.hpp.

Vector of componenet shared pointers.

Definition at line 88 of file Connection.hpp.

Weak pointer encapsulation of a componenet.

Definition at line 85 of file Connection.hpp.

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

Shared pointer encapsulation of a Design.

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

Vector of Design shared pointers.

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

typedef boost::shared_ptr<Element> torc::physical::ElementSharedPtr

Shared pointer encapsulation of a element.

Definition at line 119 of file Element.hpp.

Vector of element shared pointers.

Definition at line 125 of file Element.hpp.

typedef boost::weak_ptr<Element> torc::physical::ElementWeakPtr

Weak pointer encapsulation of a element.

Definition at line 122 of file Element.hpp.

typedef boost::shared_ptr< InstancePin > torc::physical::InstancePinSharedPtr

Shared pointer encapsulation of an InstancePin.

Definition at line 39 of file physical/Instance.hpp.

Vector of InstancePin shared pointers.

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

typedef boost::weak_ptr< InstancePin > torc::physical::InstancePinWeakPtr

Weak pointer encapsulation of an InstancePin.

Definition at line 42 of file physical/Instance.hpp.

Shared pointer encapsulation of an InstanceReference.

Definition at line 84 of file InstanceReference.hpp.

Weak pointer encapsulation of an InstanceReference.

Definition at line 87 of file InstanceReference.hpp.

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

Shared pointer encapsulation of an Instance.

Definition at line 188 of file physical/Instance.hpp.

Vector of Instance shared pointers.

Definition at line 194 of file physical/Instance.hpp.

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

Weak pointer encapsulation of an Instance.

Definition at line 191 of file physical/Instance.hpp.

typedef boost::shared_ptr<Module> torc::physical::ModuleSharedPtr

Shared pointer encapsulation of a Module.

Definition at line 114 of file Module.hpp.

Vector of Module shared pointers.

Definition at line 120 of file Module.hpp.

typedef boost::weak_ptr<Module> torc::physical::ModuleWeakPtr

Weak pointer encapsulation of a Module.

Definition at line 117 of file Module.hpp.

typedef boost::shared_ptr<Named> torc::physical::NamedSharedPtr

Shared pointer encapsulation of a Named object.

Definition at line 58 of file Named.hpp.

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

Shared pointer encapsulation of a Net.

Definition at line 229 of file physical/Net.hpp.

Vector of Net shared pointers.

Definition at line 235 of file physical/Net.hpp.

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

Weak pointer encapsulation of a Net.

Definition at line 232 of file physical/Net.hpp.

typedef boost::shared_ptr<Pip> torc::physical::PipSharedPtr

Shared pointer encapsulation of a Pip.

Definition at line 98 of file Pip.hpp.

Vector of Pip shared pointers.

Definition at line 104 of file Pip.hpp.

typedef std::vector<Pip> torc::physical::PipVector

Vector of pips.

Definition at line 95 of file Pip.hpp.

typedef boost::weak_ptr<Pip> torc::physical::PipWeakPtr

Weak pointer encapsulation of a Pip.

Definition at line 101 of file Pip.hpp.

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

Shared pointer encapsulation of a Port.

Definition at line 71 of file physical/Port.hpp.

Vector of Port shared pointers.

Definition at line 77 of file physical/Port.hpp.

Vector.

Definition at line 112 of file physical/Port.hpp.

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

Weak pointer encapsulation of a Port.

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

Shared pointer encapsulation of a componenet.

Definition at line 73 of file packer/PrimitivePin.hpp.

Vector of componenet shared pointers.

Definition at line 79 of file packer/PrimitivePin.hpp.

Vector of primitive pins.

Definition at line 70 of file packer/PrimitivePin.hpp.

Weak pointer encapsulation of a componenet.

Definition at line 76 of file packer/PrimitivePin.hpp.

Shared pointer encapsulation of a PrimitiveSet.

Definition at line 105 of file PrimitiveSet.hpp.

Vector of PrimitiveSet shared pointers.

Definition at line 111 of file PrimitiveSet.hpp.

Shared pointer encapsulation of a PrimitiveSet.

Definition at line 108 of file PrimitiveSet.hpp.

typedef boost::shared_ptr<Primitive> torc::physical::PrimitiveSharedPtr

Shared pointer encapsulation of a Primitive.

Definition at line 171 of file Primitive.hpp.

Vector of Primitive shared pointers.

Definition at line 174 of file Primitive.hpp.

Definition at line 28 of file CircuitUnitTest.cpp.

Shared pointer encapsulation of a Routethrough.

Definition at line 72 of file Routethrough.hpp.

Weak pointer encapsulation of a Routethrough.

Definition at line 75 of file Routethrough.hpp.

typedef boost::shared_ptr<RoutingNet> torc::physical::RoutingNetSharedPtr

Shared pointer encapsulation of a RoutingNet.

Definition at line 131 of file RoutingNet.hpp.

Vector of RoutingNet shared pointers.

Definition at line 134 of file RoutingNet.hpp.

typedef boost::uint64_t torc::physical::SequenceIndex

Typedef for generic sequences.

Definition at line 144 of file XilinxPhysicalTypes.hpp.

Enumeration Type Documentation

Enumeration of pad bonding types.

Enumerator
eInstanceBondingUnbonded 
eInstanceBondingBonded 
eInstanceBondingUnknown 
eInstanceBondingCount 

Definition at line 69 of file XilinxPhysicalTypes.hpp.

Enumeration of net power types.

Enumerator
eNetTypeNormal 
eNetTypePower 
eNetTypeGround 
eNetTypeCount 

Definition at line 132 of file XilinxPhysicalTypes.hpp.

Enumeration of instance pin directionality.

Enumerator
ePinDirectionInpin 
ePinDirectionOutpin 
ePinDirectionUnknown 
ePinDirectionCount 

Definition at line 107 of file XilinxPhysicalTypes.hpp.

Enumeration of sequence indexes.

A sequence index is just a number, so we only need to capture the number to use when there is no sequence defined, and the number with which to begin actual sequences. Note that this should probably be pulled into a higher-level part of the code, since it may be used in multiple cases.

Enumerator
eSequenceIndexNone 
eSequenceIndexFirst 

Definition at line 150 of file XilinxPhysicalTypes.hpp.

Function Documentation

torc::physical::BOOST_AUTO_TEST_CASE ( ConfigUnitTest  )

Unit test for the Config class.

Definition at line 28 of file ConfigUnitTest.cpp.

28  {
29  // functions tested:
30  // Config(const string& inName, const string& inValue);
31  // Config(const string& inName, const string& inValue, SequenceIndex inOrder);
32  // Config(void);
33  // create a config
34  std::string name1 = "name1";
35  std::string name2 = "name2";
36  std::string name3 = "name3";
37  std::string value1 = "value1";
38  std::string value2 = "value2";
39  std::string value3 = "value3";
40  SequenceIndex order1(0);
41  SequenceIndex order2(9);
42  SequenceIndex order3(10);
43  Config config1(name1, value1);
44  Config config2("name3", "value3", order2);
45  Config config3;
46 
47  // functions tested:
48  // const string& Named::getName(void) const;
49  // const string& getValue(void) const;
50  // SequenceIndex getOrder(void) const;
51  // void setOrder(SequenceIndex inOrder);
52  BOOST_CHECK_EQUAL(config1.getName(), name1);
53  BOOST_CHECK_EQUAL(config1.getValue(), value1);
54  config3.setOrder(order3);
55  BOOST_CHECK(config1.getOrder() == order1);
56  BOOST_CHECK(config2.getOrder() == order2);
57  BOOST_CHECK(config3.getOrder() == order3);
58 
59  // functions tested:
60  // void setValue(const string& inValue);
61  // void setName(const string& inName);
62  // const string& Named::getName(void) const;
63  // const string& getValue(void) const;
64  config1.setName(name2);
65  config1.setValue(value2);
66  BOOST_CHECK_EQUAL(config1.getName(), name2);
67  BOOST_CHECK_EQUAL(config1.getValue(), value2);
68 
69  // functions tested:
70  // bool operator ==(const Config& rhs) const;
71  BOOST_CHECK((config1 == config2) == false);
72 }
boost::uint64_t SequenceIndex
Typedef for generic sequences.
std::string string

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( RenamableUnitTest  )

Unit test for the Renamable class.

Definition at line 28 of file RenamableUnitTest.cpp.

28  {
29 }
torc::physical::BOOST_AUTO_TEST_CASE ( FactoryUnitTest  )

Unit test for the Factory class.

Definition at line 28 of file physical/FactoryUnitTest.cpp.

28  {
29  // functions tested:
30  // static DesignSharedPtr newDesignPtr(const string& inName, const string& inDevice,
31  // const string& inPackage, const string& inSpeedGrade, const string& inXdlVersion);
32  DesignSharedPtr designPtr = Factory::newDesignPtr("design", "device", "package", "speed",
33  "version");
34  BOOST_REQUIRE(designPtr.get() != 0);
35 
36  // functions tested:
37  // static ModuleSharedPtr newModulePtr(const string& inName, const string& inAnchor);
38  ModuleSharedPtr modulePtr = Factory::newModulePtr("name", "anchor");
39  BOOST_REQUIRE(modulePtr.get() != 0);
40 
41  // functions tested:
42  // static InstanceSharedPtr newInstancePtr(const string& inName, const string& inType,
43  // const string& inTile, const string& inSite, EInstanceBonding inBonding,
44  // InstanceReferenceSharedPtr inInstanceReferencePtr);
45  InstanceSharedPtr instance1Ptr = Factory::newInstancePtr("name", "type", "tile", "site");
46  BOOST_REQUIRE(instance1Ptr.get() != 0);
47 
48  // functions tested:
49  // static PortSharedPtr newPortPtr(const string& inName, InstanceSharedPtr inInstancePtr,
50  // const string& inPinName);
51  PortSharedPtr portPtr = Factory::newPortPtr("name", instance1Ptr, "pin");
52  BOOST_REQUIRE(portPtr.get() != 0);
53 
54  // functions tested:
55  // static NetSharedPtr newNetPtr(const string& inName, ENetType inNetType = eNetTypeNormal);
56  NetSharedPtr net1Ptr = Factory::newNetPtr("name");
57  BOOST_REQUIRE(net1Ptr.get() != 0);
58 
59  // functions tested:
60  // static InstanceReferenceSharedPtr newInstanceReferencePtr(const string& inInstantiationName,
61  // ModuleSharedPtr inModulePtr, InstanceSharedPtr inInstancePtr);
62  InstanceReferenceSharedPtr instanceReferencePtr = Factory::newInstanceReferencePtr("name",
63  modulePtr, instance1Ptr);
64  BOOST_REQUIRE(instanceReferencePtr.get() != 0);
65 
66  // functions tested:
67  InstanceSharedPtr instance2Ptr = Factory::newInstancePtr("name", "type", "tile", "site",
68  eInstanceBondingUnknown, instanceReferencePtr);
69  BOOST_REQUIRE(instance2Ptr.get() != 0);
70 
71  // functions tested:
72  // static torc::physical::InstancePin newInstancePinPtr(InstanceSharedPtr inInstancePtr,
73  // const string& inPinName);
74  InstancePinSharedPtr instancePinPtr = Factory::newInstancePinPtr(instance2Ptr, "pin");
75  BOOST_REQUIRE(instancePinPtr->getInstancePtr().lock() == instance2Ptr);
76 
77  // functions tested:
78  // static RoutethroughSharedPtr newRoutethroughPtr(const string& inSetting,
79  // const string& inName, const string& inValue, const InstanceWeakPtr& inInstancePtr,
80  // const string& inSourceWireName, const string& inSinkWireName);
81  RoutethroughSharedPtr routethroughPtr = Factory::newRoutethroughPtr("setting", "name", "value",
82  instance2Ptr, "source", "sink");
83  BOOST_REQUIRE(routethroughPtr.get() != 0);
84 
85  // functions tested:
86  // static torc::physical::Pip newPip(const string& inTileName, const string& inSourceWireName,
87  // const string& inSinkWireName, EPipDirection inPipDirection,
88  // RoutethroughSharedPtr inRoutethroughPtr);
89  Pip pip = Factory::newPip("tile", "source", "sink", ePipUnidirectionalBuffered,
90  routethroughPtr);
91  BOOST_REQUIRE(pip.getRoutethroughPtr() == routethroughPtr);
92 }
boost::shared_ptr< Instance > InstanceSharedPtr
boost::shared_ptr< Design > DesignSharedPtr
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< Routethrough > RoutethroughSharedPtr
Shared pointer encapsulation of a Routethrough.
boost::shared_ptr< Port > PortSharedPtr
boost::shared_ptr< InstanceReference > InstanceReferenceSharedPtr
Shared pointer encapsulation of an InstanceReference.
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( NamedUnitTest  )

Unit test for the Named class.

Definition at line 28 of file NamedUnitTest.cpp.

28  {
29  // functions tested:
30  // Named(const string& inName);
31  // const string& getName(void) const;
32  // bool operator ==(const Named& rhs) const;
33  // create two Named objects
34  std::string name1 = "name1";
35  std::string name2 = "name2";
36  Named named1(name1);
37  Named named2(name2);
38  BOOST_CHECK(named1.getName() == name1);
39  BOOST_CHECK_EQUAL(named1 == named2, false);
40 
41  // functions tested:
42  // NameComparator(const string& inName);
43  // bool operator() (const Named& inNamed) const;
44  // bool operator() (const NamedSharedPtr& inNamedPtr) const;
45  // compare Named objects with a comparator
46  NameComparator comparator(name1);
47  NamedSharedPtr named1Ptr = NamedSharedPtr(new Named(name1));
48  BOOST_CHECK_EQUAL(comparator(named1Ptr), true);
49  BOOST_CHECK_EQUAL(comparator(named1), true);
50  BOOST_CHECK_EQUAL(comparator(named2), false);
51 }
std::string string
boost::shared_ptr< Named > NamedSharedPtr
Shared pointer encapsulation of a Named object.
Definition: Named.hpp:58

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( InstancePinUnitTest  )

Unit test for the InstancePin class.

Definition at line 29 of file physical/InstancePinUnitTest.cpp.

29  {
30  // create an accessory instance
31  InstanceSharedPtr instance1Ptr = Factory::newInstancePtr("name1", "type", "tile", "site");
32  InstanceSharedPtr instance2Ptr = Factory::newInstancePtr("name2", "type", "tile", "site");
33 
34  // functions tested:
35  // InstancePin(InstanceSharedPtr inInstancePtr, const string& inPinName);
36  // create an instance pin and verify that we can recover what we put into it
37  std::string pinName = "pin";
38  InstancePinSharedPtr instancePin1Ptr = Factory::newInstancePinPtr(instance1Ptr, "");
39  InstancePinSharedPtr instancePin2Ptr = Factory::newInstancePinPtr(instance2Ptr, pinName);
40 
41  // functions tested:
42  // const InstanceWeakPtr& getInstancePtr(void) const;
43  // const PinName& getPinName(void) const;
44  // void setInstancePtr(const InstanceWeakPtr& inInstancePtr);
45  // void setPinName(const string& inPinName);
46  BOOST_CHECK(*(instancePin1Ptr->getInstancePtr().lock()) == *instance1Ptr);
47  BOOST_CHECK(instancePin1Ptr->getPinName().empty());
48  instancePin1Ptr->setInstancePtr(instance2Ptr);
49  instancePin1Ptr->setPinName(pinName);
50  BOOST_CHECK(*(instancePin1Ptr->getInstancePtr().lock()) == *instance2Ptr);
51  BOOST_CHECK(instancePin1Ptr->getPinName() == pinName);
52 
53  // functions tested:
54  // bool operator ==(const InstancePin& rhs) const;
55  BOOST_CHECK(*instancePin1Ptr == *instancePin2Ptr);
56 }
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( InstanceReferenceUnitTest  )

Unit test for the InstanceReference class.

Definition at line 29 of file InstanceReferenceUnitTest.cpp.

29  {
30  // create the accessory instance and module
31  ModuleSharedPtr modulePtr = Factory::newModulePtr("name", "anchor");
32  InstanceSharedPtr instancePtr = Factory::newInstancePtr("name", "type", "tile", "site");
33 
34  // functions tested:
35  // InstanceReference(const string& inInstantiationName, ModuleSharedPtr inModulePtr,
36  // InstanceSharedPtr inInstancePtr);
37  // create an instance reference and verify that we can recover what we put into it
38  std::string name = "name";
39  InstanceReferenceSharedPtr instanceReference1Ptr = Factory::newInstanceReferencePtr(name,
40  modulePtr, instancePtr);
41  InstanceReferenceSharedPtr instanceReference2Ptr = Factory::newInstanceReferencePtr(name,
42  modulePtr, instancePtr);
43  BOOST_REQUIRE(instanceReference1Ptr != 0);
44  BOOST_REQUIRE(instanceReference2Ptr != 0);
45 
46  // functions tested:
47  // const ModuleWeakPtr& getModulePtr(void) const;
48  // const InstanceWeakPtr& getInstancePtr(void) const;
49  // const string& getInstantiationName(void) const;
50  BOOST_CHECK(*(instanceReference1Ptr->getInstancePtr().lock()) == *instancePtr);
51  BOOST_CHECK(*(instanceReference1Ptr->getModulePtr().lock()) == *modulePtr);
52  BOOST_CHECK(instanceReference1Ptr->getInstantiationName() == name);
53 
54  // functions tested:
55  // bool operator ==(const InstanceReference& rhs) const;
56  BOOST_CHECK(*instanceReference1Ptr == *instanceReference2Ptr);
57 }
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< InstanceReference > InstanceReferenceSharedPtr
Shared pointer encapsulation of an InstanceReference.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ConfigMapUnitTest  )

Unit test for the ConfigMap class.

Definition at line 29 of file ConfigMapUnitTest.cpp.

29  {
30  // create some configuration entries
31  Config config1("name1", "value1");
32  Config config2("name2", "value2");
33  Config config3("name3", "value3");
34  Config config4("name4", "value4");
35 
36  // functions tested:
37  // ConfigMap(void);
38  // void setConfig(const string& inSetting, const Config& inConfig);
39  // static bool allowConfigDuplicates(const string& inSetting);
40  // create a configuration map and add the configuration entries to it
41  ConfigMap configMap1;
42  configMap1.setConfig("config", config1);
43  configMap1.setConfig("config", config2);
44  configMap1.setConfig("_config", config3);
45  configMap1.setConfig("_config", config4);
46  ConfigMap configMap2;
47 
48  // functions tested:
49  // bool getConfig(const string& inSetting, string& outName, string& outValue);
50  // void setConfig(const string& inSetting, const string& inName, const string& inValue);
51  std::string name;
52  std::string value;
53  configMap1.getConfig("config", name, value);
54  configMap2.setConfig("ending", name, value);
55 
56  // functions tested:
57  // bool hasConfig(const string& inSetting) const;
58  // size_type getMultiConfigCount(const string& inSetting);
59  // size_t getConfigCount(void) const;
60  // bool configIsEmpty(void) const;
61  // verify that the configuration entries exist in the proper quantities
62  // (settings prefixed with an underscore can exist multiple times, while other settings cannot)
63  BOOST_CHECK(configMap1.hasConfig("config"));
64  BOOST_CHECK(configMap1.hasConfig("_config"));
65  BOOST_CHECK_EQUAL((size_t) 1, configMap1.getMultiConfigCount("config"));
66  BOOST_CHECK_EQUAL((size_t) 2, configMap1.getMultiConfigCount("_config"));
67  BOOST_CHECK(configMap1.getConfigCount() == 3);
68  BOOST_CHECK(configMap1.configIsEmpty() == false);
69 
70  // functions tested:
71  // bool getConfig(const string& inSetting, Config& outConfig);
72  // const_iterator configBegin(void) const;
73  // const_iterator configEnd(void) const;
74  // read out and check expected settings
75  Config config5;
76  configMap1.getConfig("config", config5);
77  BOOST_CHECK_EQUAL(config2, config5);
78  // verify the expected iterator behavior
79  ConfigMap::const_iterator p = configMap1.configBegin();
80  ConfigMap::const_iterator e = configMap1.configEnd();
81  BOOST_CHECK_EQUAL(config3, p->second); p++;
82  BOOST_CHECK_EQUAL(config4, p->second); p++;
83  BOOST_CHECK_EQUAL(config2, p->second); p++;
84 
85  // functions tested:
86  // std::pair<iterator, iterator> getMultiConfigValues(const string& inSetting);
87  std::pair<ConfigMap::const_iterator, ConfigMap::const_iterator> range
88  = configMap1.getMultiConfigValues("_config");
89  p = range.first;
90  e = range.second;
91  BOOST_CHECK_EQUAL(config3, p->second); p++;
92  BOOST_CHECK_EQUAL(config4, p->second); p++;
93  BOOST_CHECK(p == e);
94  // p = configMap1.configBegin();
95  // e = configMap1.configEnd();
96  // while(p != e) {
97  // std::cout << p->first << ":" << p->second.getName() << ":" << p->second.getValue() << std::endl;
98  // p++;
99  // }
100 
101  // functions tested:
102  // void clearConfig(void);
103  // void addConfigs(const ConfigMap& inConfigMap);
104  // size_t getConfigCount(void) const;
105  // bool configIsEmpty(void) const;
106  configMap2.addConfigs(configMap1);
107  configMap1.clearConfig();
108  BOOST_CHECK(configMap1.getConfigCount() == 0);
109  BOOST_CHECK(configMap1.configIsEmpty() == true);
110  BOOST_CHECK(configMap2.getConfigCount() == 4);
111  BOOST_CHECK(configMap2.configIsEmpty() == false);
112 }
std::string string

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( PipUnitTest  )

Unit test for the Pip class.

Definition at line 29 of file PipUnitTest.cpp.

29  {
30  // create an accessory instance and routethrough
31  InstanceSharedPtr instancePtr = Factory::newInstancePtr("name", "type", "tile", "site",
33  BOOST_REQUIRE(instancePtr.get() != 0);
34  RoutethroughSharedPtr routethroughPtr = Factory::newRoutethroughPtr("setting", "name", "value",
35  instancePtr, "source", "sink");
36  BOOST_REQUIRE(routethroughPtr.get() != 0);
37 
38  // functions tested:
39  // Pip(const string& inTileName, const string& inSourceWireName,
40  // const string& inSinkWireName, EPipDirection inPipDirection,
41  // RoutethroughSharedPtr inRoutethroughPtr);
42  std::string tile = "tile";
43  std::string source = "source";
44  std::string sink = "sink";
46  Pip pip1 = Factory::newPip(tile, source, sink, direction, routethroughPtr);
47  Pip pip2 = Factory::newPip(tile, source, sink, direction, routethroughPtr);
48 
49  // functions tested:
50  // const TileName& getTileName(void) const;
51  // const WireName& getSourceWireName(void) const;
52  // const WireName& getSinkWireName(void) const;
53  // EPipDirection getDirection(void) const;
54  // const char* getDirectionString(void) const;
55  // static const char* getDirectionString(EPipDirection inPipDirection);
56  BOOST_CHECK_EQUAL(pip1.getTileName(), tile);
57  BOOST_CHECK_EQUAL(pip1.getSourceWireName(), source);
58  BOOST_CHECK_EQUAL(pip1.getSinkWireName(), sink);
59  BOOST_CHECK(pip1.getDirection() == direction);
60  BOOST_CHECK(pip1.getDirectionString() == Pip::getDirectionString(direction));
61  BOOST_CHECK_EQUAL("==", Pip::getDirectionString(ePipBidirectionalUnbuffered));
62  BOOST_CHECK_EQUAL("=>", Pip::getDirectionString(ePipBidirectionalUnidirectionallyBuffered));
63  BOOST_CHECK_EQUAL("=-", Pip::getDirectionString(ePipBidirectionalBidirectionallyBuffered));
64  BOOST_CHECK_EQUAL("->", Pip::getDirectionString(ePipUnidirectionalBuffered));
65 
66  // functions tested:
67  // RoutethroughSharedPtr getRoutethroughPtr(void) const;
68  // bool isRoutethrough(void) const;
69  BOOST_CHECK(pip1.isRoutethrough());
70  BOOST_CHECK(pip1.getRoutethroughPtr() == routethroughPtr);
71 
72  // functions tested:
73  // bool operator ==(const Pip& rhs) const;
74  BOOST_CHECK(pip1 == pip1); // name based comparison
75 }
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string
boost::shared_ptr< Routethrough > RoutethroughSharedPtr
Shared pointer encapsulation of a Routethrough.
EPipDirection
Enumeration of pip directionality.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( PortUnitTest  )

Unit test for the Port class.

Definition at line 29 of file PortUnitTest.cpp.

29  {
30  // create an accessory instance
31  InstanceSharedPtr instancePtr = Factory::newInstancePtr("name", "type", "tile", "site",
33  BOOST_REQUIRE(instancePtr.get() != 0);
34 
35  // functions tested:
36  // Port(const string& inName, InstanceSharedPtr inInstancePtr, const string& inPinName);
37  std::string name = "name";
38  std::string pin = "pin";
39  PortSharedPtr port1Ptr = Factory::newPortPtr(name, instancePtr, pin);
40  PortSharedPtr port2Ptr = Factory::newPortPtr(name, instancePtr, pin);
41  BOOST_REQUIRE(port1Ptr.get() != 0);
42  BOOST_REQUIRE(port2Ptr.get() != 0);
43 
44  // functions tested:
45  // const InstanceWeakPtr& getInstancePtr(void) const;
46  // const PinName& getPinName(void) const;
47  BOOST_CHECK(port1Ptr->getInstancePtr().lock() == instancePtr);
48  BOOST_CHECK(port1Ptr->getPinName() == pin);
49 
50  // functions tested:
51  // bool operator ==(const Port& rhs) const;
52  BOOST_CHECK(*port1Ptr == *port2Ptr); // name based comparison
53 }
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string
boost::shared_ptr< Port > PortSharedPtr

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( InstanceUnitTest  )

Unit test for the Instance class.

Definition at line 29 of file InstanceUnitTest.cpp.

29  {
30  // create accessory instances and module
31  std::string name = "name";
32  std::string type = "type";
33  std::string tile = "tile";
34  std::string site = "site";
35  ModuleSharedPtr modulePtr = Factory::newModulePtr("name", "anchor");
36  InstanceSharedPtr instance2Ptr = Factory::newInstancePtr(name, "type", "tile", "site");
37  InstanceReferenceSharedPtr instanceReferencePtr = Factory::newInstanceReferencePtr("name",
38  modulePtr, instance2Ptr);
39 
40  // functions tested:
41  // Instance(const string& inName, const string& inType, const string& inTile,
42  // const string& inSite, EInstanceBonding inBonding,
43  // InstanceReferenceSharedPtr& inInstanceReferencePtr);
44  // create an instance
46  InstanceSharedPtr instance1Ptr = Factory::newInstancePtr(name, "", "", "");
47  BOOST_REQUIRE(instance1Ptr != 0);
48 
49  // functions tested:
50  // void setType(const string& inType);
51  // void setTile(const string& inTile);
52  // void setSite(const string& inSite);
53  // void setBonding(EInstanceBonding inBonding);
54  // void setInstanceReferencePtr(InstanceReferenceSharedPtr inInstanceReferenceSharedPtr);
55  // const string& getType(void) const;
56  // const string& getTile(void) const;
57  // const string& getSite(void) const;
58  // EInstanceBonding getBonding(void) const;
59  // InstanceReferenceSharedPtr getInstanceReferencePtr(void) const;
60  BOOST_CHECK(instance1Ptr->getType().empty());
61  BOOST_CHECK(instance1Ptr->getTile().empty());
62  BOOST_CHECK(instance1Ptr->getSite().empty());
63  BOOST_CHECK(instance1Ptr->getBonding() == eInstanceBondingUnknown);
64  instance1Ptr->setType(type);
65  instance1Ptr->setTile(tile);
66  instance1Ptr->setSite(site);
67  instance1Ptr->setBonding(bonding);
68  instance1Ptr->setInstanceReferencePtr(instanceReferencePtr);
69  BOOST_CHECK(instance1Ptr->getType() == type);
70  BOOST_CHECK(instance1Ptr->getTile() == tile);
71  BOOST_CHECK(instance1Ptr->getSite() == site);
72  BOOST_CHECK(instance1Ptr->getBonding() == bonding);
73  BOOST_CHECK(instance1Ptr->getInstanceReferencePtr() == instanceReferencePtr);
74 
75  // functions tested:
76  // bool operator ==(const Instance& rhs) const;
77  BOOST_CHECK(*instance1Ptr == *instance2Ptr); // comparison based on instance names only
78 
79  // functions tested:
80  // void unplace(void);
81  instance1Ptr->unplace();
82  BOOST_CHECK(instance1Ptr->getTile().empty());
83  BOOST_CHECK(instance1Ptr->getSite().empty());
84 
85  // functions tested:
86  // void addPin(const InstancePinWeakPtr& inInstancePinPtr);
87  // void removePin(const InstancePinWeakPtr& inInstancePinPtr);
88  // const InstancePinSharedPtrConstIterator findPin(const PinName& inPinName);
89  PinName pinName1("name1");
90  PinName pinName2("name2");
91  InstancePinSharedPtr instancePin1Ptr = Factory::newInstancePinPtr(instance1Ptr, pinName1);
92  InstancePinSharedPtr instancePin2Ptr = Factory::newInstancePinPtr(instance1Ptr, pinName1);
93  InstancePinSharedPtr instancePin3Ptr = Factory::newInstancePinPtr(instance1Ptr, pinName2);
94  NetSharedPtr netPtr = Factory::newNetPtr("name");
95  netPtr->addSource(instancePin1Ptr);
96  netPtr->addSource(instancePin2Ptr);
97  netPtr->addSink(instancePin3Ptr);
98  BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(), 3u);
99  BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(pinName1), 2u);
100  BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(pinName2), 1u);
101  Instance::InstancePinSharedPtrConstIterator ipp = instance1Ptr->findPin(pinName1);
102  Instance::InstancePinSharedPtrConstIterator ipe = instance1Ptr->pinsEnd();
103  BOOST_REQUIRE(ipp != ipe);
104  BOOST_CHECK(ipp->second == instancePin1Ptr);
105  BOOST_CHECK_EQUAL(ipp->second->getPinName(), pinName1);
106  BOOST_CHECK_EQUAL(ipp->second->getPinName(), ipp->first);
107  BOOST_CHECK(ipp->second->getParentWeakPtr().lock() == netPtr);
108  std::pair<Instance::InstancePinSharedPtrConstIterator,
109  Instance::InstancePinSharedPtrConstIterator> range = instance1Ptr->findPinRange(pinName1);
110  BOOST_REQUIRE(range.first != range.second);
111  BOOST_CHECK_EQUAL(range.first->second->getPinName(), pinName1); range.first++;
112  BOOST_CHECK_EQUAL(range.first->second->getPinName(), pinName1); range.first++;
113  BOOST_CHECK(range.first == range.second);
114  netPtr->removeSource(instancePin2Ptr);
115  netPtr->removeSink(instancePin3Ptr);
116  BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(), 1u);
117  BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(pinName1), 1u);
118  BOOST_CHECK_EQUAL(instance1Ptr->getPinCount(pinName2), 0u);
119  ipp = instance1Ptr->findPin(pinName1);
120  ipe = instance1Ptr->pinsEnd();
121  BOOST_REQUIRE(ipp != ipe);
122  BOOST_CHECK(ipp->second == instancePin1Ptr);
123  BOOST_CHECK_EQUAL(ipp->second->getPinName(), pinName1);
124  BOOST_CHECK_EQUAL(ipp->second->getPinName(), ipp->first);
125  BOOST_CHECK(ipp->second->getParentWeakPtr().lock() == netPtr);
126 }
boost::shared_ptr< Instance > InstanceSharedPtr
EInstanceBonding
Enumeration of pad bonding types.
std::string string
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< InstanceReference > InstanceReferenceSharedPtr
Shared pointer encapsulation of an InstanceReference.
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( RouteThroughUnitTest  )

Unit test for the Routethrough class.

Definition at line 29 of file RoutethroughUnitTest.cpp.

29  {
30  // create an accessory instance
31  InstanceSharedPtr instancePtr = Factory::newInstancePtr("name", "type", "tile", "site",
33  BOOST_REQUIRE(instancePtr.get() != 0);
34 
35  // functions tested:
36  // Routethrough(const string& inSetting, const string& inName, const string& inValue,
37  // const InstanceWeakPtr& inInstancePtr, const string& inSourceWireName,
38  // const string& inSinkWireName);
39  std::string setting = "_ROUTETHROUGH";
40  std::string name = "name";
41  std::string value = "value";
42  std::string source = "source";
43  std::string sink = "sink";
44  Routethrough routethrough(setting, name, value, instancePtr, source, sink);
45 
46  // functions tested:
47  // const string& getSetting(void) const;
48  // const InstanceWeakPtr& getInstancePtr(void) const;
49  // const WireName& getSourceWireName(void) const;
50  // const WireName& getSinkWireName(void) const;
51  BOOST_CHECK_EQUAL(routethrough.getSetting(), setting);
52  BOOST_CHECK_EQUAL(routethrough.getSourceWireName(), source);
53  BOOST_CHECK_EQUAL(routethrough.getSinkWireName(), sink);
54  BOOST_CHECK(routethrough.getInstancePtr().lock() == instancePtr);
55 }
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( TilewirePlaceholderUnitTest  )

Unit test for the TilewirePlaceholder class.

Definition at line 29 of file TilewirePlaceholderUnitTest.cpp.

29  {
30  // features tested:
31  // sizeof(TilewirePlaceholder)
32  BOOST_CHECK_EQUAL(sizeof(torc::architecture::Tilewire), sizeof(TilewirePlaceholder));
33 }
Encapsulation of a device tile and wire pair.
Definition: Tilewire.hpp:39
torc::physical::BOOST_AUTO_TEST_CASE ( ModuleUnitTest  )

Unit test for the Module class.

Definition at line 29 of file ModuleUnitTest.cpp.

29  {
30  std::string port = "name1";
31  // create accessory instance and ports
32  InstanceSharedPtr instancePtr = Factory::newInstancePtr("name", "type", "tile", "site");
33  PortSharedPtr port1Ptr = Factory::newPortPtr(port, instancePtr, "pin");
34  PortSharedPtr port2aPtr = Factory::newPortPtr("name2", instancePtr, "pin");
35  PortSharedPtr port2bPtr = Factory::newPortPtr("name2", instancePtr, "pin");
36  // functions tested:
37  // Module(const string& inName, const string& inAnchor);
38  // create two modules
39  std::string name = "name";
40  std::string anchor = "anchor";
41  ModuleSharedPtr module1Ptr = Factory::newModulePtr(name, "");
42  ModuleSharedPtr module2Ptr = Factory::newModulePtr(name, anchor);
43  BOOST_REQUIRE(module1Ptr != 0);
44  BOOST_REQUIRE(module2Ptr != 0);
45 
46  // functions tested:
47  // const string& getAnchor(void) const;
48  // void setAnchor(const string& inAnchor);
49  BOOST_CHECK(module1Ptr->getAnchor().empty());
50  module1Ptr->setAnchor(anchor);
51  BOOST_CHECK(module1Ptr->getAnchor() == anchor);
52 
53  // functions tested:
54  // PortSharedPtrIterator findPort(const string& inName);
55  // bool addPort(PortSharedPtr& inPortPtr);
56  // size_t getPortCount(void) const;
57  BOOST_CHECK_EQUAL(module1Ptr->addPort(port1Ptr), true);
58  BOOST_CHECK_EQUAL(module1Ptr->addPort(port2aPtr), true);
59  BOOST_CHECK_EQUAL(module1Ptr->addPort(port2bPtr), false); // port name already exists
60  BOOST_CHECK(module1Ptr->getPortCount() == 2);
61 
62  // functions tested:
63  // PortSharedPtrConstIterator portsBegin(void) const;
64  // PortSharedPtrConstIterator portsEnd(void) const;
65  // PortSharedPtrIterator portsBegin(void);
66  // PortSharedPtrIterator portsEnd(void);
67  Module::PortSharedPtrConstIterator p = module1Ptr->portsBegin();
68  Module::PortSharedPtrConstIterator e = module1Ptr->portsEnd();
69  BOOST_CHECK(*p++ == port1Ptr);
70  BOOST_CHECK(*p++ == port2aPtr);
71  BOOST_CHECK(p == e);
72  BOOST_CHECK(*(module1Ptr->findPort(port)) == port1Ptr);
73 
74  // functions tested:
75  // PortSharedPtrIterator findPort(const string& inName);
76  // bool removePort(PortSharedPtr& inPortPtr);
77  // size_t getPortCount(void) const;
78  BOOST_CHECK_EQUAL(module1Ptr->removePort(port1Ptr), true);
79  BOOST_CHECK_EQUAL(module1Ptr->removePort(port2aPtr), true);
80  BOOST_CHECK_EQUAL(module1Ptr->removePort(port2bPtr), false);
81  BOOST_CHECK(module1Ptr->getPortCount() == 0);
82 
83  // functions tested:
84  // bool operator ==(const Module& rhs) const;
85  BOOST_CHECK(*module1Ptr == *module2Ptr); // comparison based on module names only
86 }
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< Port > PortSharedPtr

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( NetUnitTest  )

Unit test for the Net class.

Definition at line 29 of file NetUnitTest.cpp.

29  {
30  // accessory instance and pins
31  std::string name = "name";
32  // create accessory instance, pins, and pips
33  InstanceSharedPtr instancePtr = Factory::newInstancePtr("name", "type", "tile", "site");
34  InstancePinSharedPtr pin1Ptr = Factory::newInstancePinPtr(instancePtr, "pin1");
35  InstancePinSharedPtr pin2Ptr = Factory::newInstancePinPtr(instancePtr, "pin2");
36  InstancePinSharedPtr pin3Ptr = Factory::newInstancePinPtr(instancePtr, "pin3");
37  InstancePinSharedPtr pin4Ptr = Factory::newInstancePinPtr(instancePtr, "pin4");
38  Pip pip1 = Factory::newPip("tile", "source1", "sink1", ePipUnidirectionalBuffered);
39  Pip pip2 = Factory::newPip("tile", "source2", "sink2", ePipUnidirectionalBuffered);
40  Pip pip3 = Factory::newPip("tile", "source3", "sink3", ePipUnidirectionalBuffered);
41 
42  // functions tested:
43  // Net(const string& inName, ENetType inNetType);
44  ENetType normal = eNetTypeNormal;
45  ENetType power = eNetTypePower;
46  ENetType ground = eNetTypeGround;
47  NetSharedPtr net1Ptr = Factory::newNetPtr(name);
48  NetSharedPtr net2Ptr = Factory::newNetPtr(name, power);
49  BOOST_REQUIRE(net1Ptr != 0);
50  BOOST_REQUIRE(net2Ptr != 0);
51 
52  // functions tested:
53  // ENetType getNetType(void) const;
54  // void setNetType(ENetType inNetType);
55  BOOST_CHECK(net1Ptr->getNetType() == normal);
56  BOOST_CHECK(net2Ptr->getNetType() == power);
57  net2Ptr->setNetType(ground);
58  BOOST_CHECK(net2Ptr->getNetType() == ground);
59 
60  // functions tested:
61  // void addSource(const InstancePin& inInstancePin);
62  // void addSink(const InstancePin& inInstancePin);
63  // bool containsSource(const InstancePin& inInstancePin) const;
64  // bool containsSink(const InstancePin& inInstancePin) const;
65  // bool hasAnySources(void) const;
66  // bool hasOneSource(void) const;
67  // bool hasMultipleSources(void) const;
68  // size_t getSourceCount(void) const;
69  // bool hasAnySinks(void) const;
70  // bool hasOneSink(void) const;
71  // bool hasMultipleSinks(void) const;
72  // size_t getSinkCount(void) const;
73  net1Ptr->addSource(pin1Ptr);
74  net1Ptr->addSink(pin2Ptr);
75  net1Ptr->addSink(pin3Ptr);
76  net1Ptr->addSink(pin4Ptr);
77  BOOST_CHECK_EQUAL(net1Ptr->containsSource(pin1Ptr), true);
78  BOOST_CHECK_EQUAL(net1Ptr->containsSink(pin1Ptr), false);
79  BOOST_CHECK_EQUAL(net1Ptr->containsSink(pin2Ptr), true);
80  BOOST_CHECK_EQUAL(net1Ptr->containsSink(pin3Ptr), true);
81  BOOST_CHECK_EQUAL(net1Ptr->containsSink(pin4Ptr), true);
82  BOOST_CHECK_EQUAL(net1Ptr->hasAnySources(), true);
83  BOOST_CHECK_EQUAL(net1Ptr->hasOneSource(), true);
84  BOOST_CHECK_EQUAL(net1Ptr->hasMultipleSources(), false);
85  BOOST_CHECK(net1Ptr->getSourceCount() == 1);
86  BOOST_CHECK_EQUAL(net1Ptr->hasAnySinks(), true);
87  BOOST_CHECK_EQUAL(net1Ptr->hasOneSink(), false);
88  BOOST_CHECK_EQUAL(net1Ptr->hasMultipleSinks(), true);
89  BOOST_CHECK(net1Ptr->getSinkCount() == 3);
90 
91  // functions tested:
92  // bool removeSource(const InstancePin& inInstancePin);
93  // bool removeSink(const InstancePin& inInstancePin);
94  // InstancePinConstIterator sourcesBegin(void) const;
95  // InstancePinConstIterator sourcesEnd(void) const;
96  // InstancePinConstIterator sinksBegin(void) const;
97  // InstancePinConstIterator sinksEnd(void) const;
98  Net::InstancePinSharedPtrConstIterator op = net1Ptr->sourcesBegin();
99  Net::InstancePinSharedPtrConstIterator oe = net1Ptr->sourcesEnd();
100  BOOST_CHECK(*op++ == pin1Ptr);
101  BOOST_CHECK(op == oe);
102  BOOST_CHECK_EQUAL(net1Ptr->removeSource(pin1Ptr), true);
103  BOOST_CHECK_EQUAL(net1Ptr->removeSource(pin2Ptr), false);
104  BOOST_CHECK(net1Ptr->getSourceCount() == 0);
105  Net::InstancePinSharedPtrConstIterator ip = net1Ptr->sinksBegin();
106  Net::InstancePinSharedPtrConstIterator ie = net1Ptr->sinksEnd();
107  BOOST_CHECK(*ip++ == pin2Ptr);
108  BOOST_CHECK(*ip++ == pin3Ptr);
109  BOOST_CHECK(*ip++ == pin4Ptr);
110  BOOST_CHECK(ip == ie);
111  BOOST_CHECK_EQUAL(net1Ptr->removeSink(pin1Ptr), false);
112  BOOST_CHECK_EQUAL(net1Ptr->removeSink(pin2Ptr), true);
113  BOOST_CHECK_EQUAL(net1Ptr->removeSink(pin3Ptr), true);
114  BOOST_CHECK_EQUAL(net1Ptr->removeSink(pin4Ptr), true);
115  BOOST_CHECK(net1Ptr->getSinkCount() == 0);
116 
117  // functions tested:
118  // void addPip(const Pip& inPip);
119  // bool containsPip(const Pip& inPip) const;
120  // bool hasAnyPips(void) const;
121  // size_t getPipCount(void) const;
122  // bool isRouted(void) const;
123  // bool isUnrouted(void) const;
124  net1Ptr->addPip(pip1);
125  net1Ptr->addPip(pip2);
126  net1Ptr->addPip(pip3);
127  BOOST_CHECK_EQUAL(net1Ptr->containsPip(pip1), true);
128  BOOST_CHECK_EQUAL(net1Ptr->containsPip(pip2), true);
129  BOOST_CHECK_EQUAL(net1Ptr->containsPip(pip3), true);
130  BOOST_CHECK_EQUAL(net1Ptr->hasAnyPips(), true);
131  BOOST_CHECK_EQUAL(net1Ptr->isRouted(), true);
132  BOOST_CHECK_EQUAL(net1Ptr->isUnrouted(), false);
133  BOOST_CHECK(net1Ptr->getPipCount() == 3);
134 
135  // functions tested:
136  // bool removePip(const Pip& inPip);
137  // void unroute(void);
138  // PipConstIterator pipsBegin(void) const;
139  // PipConstIterator pipsEnd(void) const;
140  // size_t getPipCount(void) const;
141  // bool isRouted(void) const;
142  // bool isUnrouted(void) const;
143  Net::PipConstIterator pp = net1Ptr->pipsBegin();
144  Net::PipConstIterator pe = net1Ptr->pipsEnd();
145  BOOST_CHECK(*pp++ == pip1);
146  BOOST_CHECK(*pp++ == pip2);
147  BOOST_CHECK(*pp++ == pip3);
148  BOOST_CHECK(pp == pe);
149  BOOST_CHECK_EQUAL(net1Ptr->removePip(pip1), true);
150  BOOST_CHECK_EQUAL(net1Ptr->removePip(pip1), false);
151  BOOST_CHECK_EQUAL(net1Ptr->isRouted(), true);
152  BOOST_CHECK_EQUAL(net1Ptr->isUnrouted(), false);
153  BOOST_CHECK(net1Ptr->getPipCount() == 2);
154  net1Ptr->unroute();
155  BOOST_CHECK_EQUAL(net1Ptr->isRouted(), false);
156  BOOST_CHECK_EQUAL(net1Ptr->isUnrouted(), true);
157  BOOST_CHECK(net1Ptr->getPipCount() == 0);
158 }
ENetType
Enumeration of net power types.
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( DesignUnitTest  )

Unit test for the Design class.

Todo:
Verify that all children can trace their lineage all the way up to the design.

Definition at line 30 of file DesignUnitTest.cpp.

30  {
31  // functions tested:
32  // Design(const string& inName, const string& inDevice, const string& inPackage,
33  // const string& inSpeedGrade, const string& inXdlVersion);
34  // create a design
35  std::string designName = "design";
36  std::string deviceName = "device";
37  std::string devicePackage = "package";
38  std::string deviceSpeedGrade = "speed_grade";
39  std::string xdlVersion = "xdl_version";
40  std::string moduleName = "module1";
41  DesignSharedPtr designPtr = Factory::newDesignPtr(designName, "", "", "", "");
42  BOOST_REQUIRE(designPtr.get() != 0);
43 
44  // functions tested:
45  // const string& getDevice(void) const;
46  // const string& getPackage(void) const;
47  // const string& getSpeedGrade(void) const;
48  // const string& getXdlVersion(void) const;
49  // void setDevice(const string& inDevice);
50  // void setPackage(const string& inPackage);
51  // void setSpeedGrade(const string& inSpeedGrade);
52  // void setXdlVersion(const string& inXdlVersion);
53  BOOST_CHECK(designPtr->getDevice().empty());
54  BOOST_CHECK(designPtr->getPackage().empty());
55  BOOST_CHECK(designPtr->getSpeedGrade().empty());
56  BOOST_CHECK(designPtr->getXdlVersion().empty());
57  designPtr->setDevice(deviceName);
58  designPtr->setPackage(devicePackage);
59  designPtr->setSpeedGrade(deviceSpeedGrade);
60  designPtr->setXdlVersion(xdlVersion);
61  BOOST_CHECK_EQUAL(designPtr->getName(), designName);
62  BOOST_CHECK_EQUAL(designPtr->getDevice(), deviceName);
63  BOOST_CHECK_EQUAL(designPtr->getPackage(), devicePackage);
64  BOOST_CHECK_EQUAL(designPtr->getSpeedGrade(), deviceSpeedGrade);
65  BOOST_CHECK_EQUAL(designPtr->getXdlVersion(), xdlVersion);
66 
67  // functions tested:
68  // ModuleSharedPtrIterator findModule(const string& inName);
69  // bool addModule(ModuleSharedPtr& inModulePtr);
70  // size_t getModuleCount(void) const;
71  // create and add some modules to the design
72  ModuleSharedPtr module1Ptr = Factory::newModulePtr(moduleName, "anchor1");
73  ModuleSharedPtr module2aPtr = Factory::newModulePtr("module2", "anchor2");
74  ModuleSharedPtr module2bPtr = Factory::newModulePtr("module2", "anchor2");
75  BOOST_CHECK_EQUAL(designPtr->addModule(module1Ptr), true);
76  BOOST_CHECK_EQUAL(designPtr->addModule(module2aPtr), true);
77  BOOST_CHECK_EQUAL(designPtr->addModule(module2bPtr), false);
78  BOOST_CHECK(designPtr->getModuleCount() == 2);
79 
80  // functions tested:
81  // ModuleSharedPtrIterator findModule(const string& inName);
82  // ModuleSharedPtrConstIterator modulesBegin(void) const;
83  // ModuleSharedPtrConstIterator modulesEnd(void) const;
84  // ModuleSharedPtrIterator modulesBegin(void);
85  // ModuleSharedPtrIterator modulesEnd(void);
86  Design::ModuleSharedPtrConstIterator p = designPtr->modulesBegin();
87  Design::ModuleSharedPtrConstIterator e = designPtr->modulesEnd();
88  BOOST_CHECK(*p++ == module1Ptr);
89  BOOST_CHECK(*p++ == module2aPtr);
90  BOOST_CHECK(p == e);
91  BOOST_CHECK(*(designPtr->findModule(moduleName)) == module1Ptr);
92 
93  // functions tested:
94  // ModuleSharedPtrIterator findModule(const string& inName);
95  // bool removeModule(ModuleSharedPtr& inModulePtr);
96  // size_t getModuleCount(void) const;
97  // remove the modules
98  BOOST_CHECK_EQUAL(designPtr->removeModule(module1Ptr), true);
99  BOOST_CHECK_EQUAL(designPtr->removeModule(module2aPtr), true);
100  BOOST_CHECK_EQUAL(designPtr->removeModule(module2bPtr), false);
101  BOOST_CHECK(designPtr->getModuleCount() == 0);
102 }
std::string string
boost::shared_ptr< Design > DesignSharedPtr
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( OutputStreamHelpersUnitTest  )

Unit test for the output stream helpers.

It's not pretty, and it's incomplete, but it'll have to do for now.

Definition at line 31 of file physical/OutputStreamHelpersUnitTest.cpp.

31  {
32  std::stringstream s;
33 
34  // functions tested:
35  // std::ostream& operator <<(std::ostream& os, const Design& rhs);
36  std::string designName = "blinker";
37  std::string deviceName = "xc5vlx30";
38  std::string devicePackage = "ff324";
39  std::string deviceSpeedGrade = "-1";
40  std::string xdlVersion = "v3.2";
41  DesignSharedPtr designPtr = Factory::newDesignPtr(designName, deviceName, devicePackage,
42  deviceSpeedGrade, xdlVersion);
43  s << *designPtr;
44  BOOST_CHECK_EQUAL(s.str(), "blinker [xc5vlx30ff324-1, v3.2]");
45  s.str(std::string());
46 
47  // functions tested:
48  // std::ostream& operator <<(std::ostream& os, const Module& rhs);
49  std::string moduleName = "osc7";
50  std::string moduleAnchor = "x0y0";
51  ModuleSharedPtr modulePtr = Factory::newModulePtr(moduleName, moduleAnchor);
52  s << *modulePtr;
53  BOOST_CHECK_EQUAL(s.str(), "osc7 [x0y0]");
54  s.str(std::string());
55 
56  // functions tested:
57  // std::ostream& operator <<(std::ostream& os, const Instance& rhs);
58  std::string instanceName = "blink";
59  std::string instanceType = "SLICEL";
60  std::string instanceTile = "CLBLL_X16Y59";
61  std::string instanceSite = "SLICE_X27Y59";
62  InstanceSharedPtr instancePtr = Factory::newInstancePtr(instanceName, instanceType,
63  instanceTile, instanceSite);
64  s << *instancePtr;
65  BOOST_CHECK_EQUAL(s.str(), "blink");
66  s.str(std::string());
67 
68  // functions tested:
69  // std::ostream& operator <<(std::ostream& os, const Net& rhs);
70  std::string netName = "blink";
71  ENetType netType = eNetTypeNormal;
72  NetSharedPtr netPtr = Factory::newNetPtr(netName, netType);
73  s << *netPtr;
74  BOOST_CHECK_EQUAL(s.str(), "blink");
75  s.str(std::string());
76 
77  // functions tested:
78  // std::ostream& operator <<(std::ostream& os, const InstancePin& rhs);
79  std::string pinName = "DQ";
80  InstancePinSharedPtr instancePinPtr = Factory::newInstancePinPtr(instancePtr, pinName);
81  s << *instancePinPtr;
82  BOOST_CHECK_EQUAL(s.str(), "blink.DQ");
83  s.str(std::string());
84 
85  // functions tested:
86  // std::ostream& operator <<(std::ostream& os, const Pip& rhs);
87  std::string pipTile = "CLBLL_X16Y59";
88  std::string pipSource = "L_DQ";
89  std::string pipSink = "SITE_LOGIC_OUTS3";
91  Pip pip = Factory::newPip(pipTile, pipSource, pipSink, pipDirection);
92  s << pip;
93  BOOST_CHECK_EQUAL(s.str(), "CLBLL_X16Y59 L_DQ -> SITE_LOGIC_OUTS3");
94  s.str(std::string());
95 
96  // functions tested:
97  // std::ostream& operator <<(std::ostream& os, const Config& rhs);
98  std::string configName = "blink";
99  std::string configValue = "#FF";
100  Config config(configName, configValue);
101  s << config;
102  BOOST_CHECK_EQUAL(s.str(), "blink:#FF");
103  s.str(std::string());
104 }
ENetType
Enumeration of net power types.
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string
boost::shared_ptr< Design > DesignSharedPtr
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< Net > NetSharedPtr
EPipDirection
Enumeration of pip directionality.
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( XdlImporterUnitTest  )

Unit test for the XdlImporter class.

Todo:
Finish testing XdlImporter functionality.

Definition at line 32 of file physical/XdlImporterUnitTest.cpp.

32  {
33  // members not tested:
34  // bool mTraceScanning;
35  // bool mTraceParsing;
36  // string mStreamName;
37  // functions not tested:
38  // virtual ~XdlImporter(void);
39  // class torc::XdlScanner* lexer;
40  // DEPRECATED bool import(istream& in, const string& name = "stream input")
41  // DEPRECATED bool import(const string& input, const string& name = "string stream")
42  // bool operator()(const string& input, const string& name = "string stream");
43  // DEPRECATED bool import(const boost::filesystem::path& filename);
44  // bool operator()(const boost::filesystem::path& filename);
45  // void error(const location& l, const string& m);
46  // void error(const string& m);
47  // void failure(void);
48  // functions not tested (because they are null virtual functions):
49  // virtual void initializeDatabase(void);
50  // virtual void bind(torc::physical::InstancePinSharedPtr&);
51  // virtual void bind(torc::physical::Pip&, EPipType);
52 
53  // create the appropriate file paths
55  / "torc" / "physical" / "DesignUnitTest.reference.xdl";
56 
57  // functions tested:
58  // XdlImporter(void);
59  // bool operator()(istream& in, const string& name = "stream input");
60  // import the XDL design
61  std::fstream fileStream(referencePath.string().c_str());
62  BOOST_REQUIRE(fileStream.good());
63  XdlImporter importer;
64  importer(fileStream, referencePath.string());
65  BOOST_CHECK_EQUAL(referencePath.string(), importer.mStreamName);
66 
67  // functions tested:
68  // DesignSharedPtr getDesignPtr(void);
69  DesignSharedPtr designPtr = importer.getDesignPtr();
70  BOOST_REQUIRE(designPtr.get() != 0);
71  BOOST_CHECK_EQUAL(designPtr->getName(), "blinker");
72  BOOST_CHECK_EQUAL(designPtr->getDevice(), "xc5vlx30");
73  BOOST_CHECK_EQUAL(designPtr->getPackage(), "ff324");
74  BOOST_CHECK_EQUAL(designPtr->getSpeedGrade(), "-1");
75  BOOST_CHECK_EQUAL(designPtr->getModuleCount(), 0u);
76  BOOST_CHECK_EQUAL(designPtr->getInstanceCount(), 8u);
77  BOOST_CHECK_EQUAL(designPtr->getNetCount(), 7u);
78 }
boost::shared_ptr< Design > DesignSharedPtr
boost::filesystem::path path
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ProgenitorUnitTest  )

Unit test for the Progenitor class.

Definition at line 33 of file ProgenitorUnitTest.cpp.

33  {
34  // functions tested:
35  // [null constructor]
36  // void setSelfWeakPtr(WeakPtrType inSelfPtr);
37  // const WeakPtrType& getSelfWeakPtr(void) const;
38  typedef Progenitor<A> progenitor_t;
39  progenitor_t::SharedPtrType progenitorPtr(new A());
40  BOOST_REQUIRE(progenitorPtr.get() != 0);
41  progenitorPtr->setSelfWeakPtr(progenitorPtr);
42  BOOST_CHECK(progenitorPtr->getSelfWeakPtr().lock() == progenitorPtr);
43 }
torc::physical::BOOST_AUTO_TEST_CASE ( SampleCodeUnitTest  )

Unit test demonstrating some sample code.

Definition at line 33 of file SampleCodeUnitTest.cpp.

33  {
34 
35  // create the appropriate file paths
37  / "torc" / "physical" / "DesignUnitTest.reference.xdl";
39  / "regression" / "DesignUnitTest.reference.xdl";
40 
41  // import the XDL design
42  std::fstream fileStream(referencePath.string().c_str());
43  BOOST_REQUIRE(fileStream.good());
44  XdlImporter importer;
45  importer(fileStream, referencePath.string());
46 
47  // look up the design (and do something with it ...)
48  DesignSharedPtr designPtr = importer.getDesignPtr();
49  BOOST_REQUIRE(designPtr.get() != 0);
50 
51  // export the XDL design
52  std::fstream xdlExport(generatedPath.string().c_str(), std::ios_base::out);
53  XdlExporter fileExporter(xdlExport);
54  fileExporter(designPtr);
55 
56 }
boost::shared_ptr< Design > DesignSharedPtr
boost::filesystem::path path
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ProgenyUnitTest  )

Unit test for the Progeny class.

Definition at line 34 of file ProgenyUnitTest.cpp.

34  {
35  // create an accessory progenitor
36  typedef Progenitor<A> progenitor_t;
37  progenitor_t::SharedPtrType progenitorPtr(new A());
38  BOOST_REQUIRE(progenitorPtr.get() != 0);
39  progenitorPtr->setSelfWeakPtr(progenitorPtr);
40 
41  // functions tested:
42  // Progeny(void);
43  // Progeny(const WeakPtrType& inParentPtr);
44  // void setParentWeakPtr(WeakPtrType inParentPtr);
45  // const WeakPtrType& getParentWeakPtr(void) const;
46  // void resetParentWeakPtr(void);
47  B progeny1;
48  B progeny2/*(progenitorPtr)*/;
49  BOOST_CHECK_EQUAL(progeny1.getParentWeakPtr().expired(), true);
50  BOOST_CHECK_EQUAL(progeny2.getParentWeakPtr().expired(), true);
51  progeny2.setParentWeakPtr(progenitorPtr);
52  BOOST_CHECK_EQUAL(progeny2.getParentWeakPtr().expired(), false);
53  BOOST_CHECK(progeny2.getParentWeakPtr().lock() == progenitorPtr);
54  progeny1.setParentWeakPtr(progeny2.getParentWeakPtr());
55  progeny2.resetParentWeakPtr();
56  BOOST_CHECK(progeny1.getParentWeakPtr().lock() == progenitorPtr);
57  BOOST_CHECK_EQUAL(progeny1.getParentWeakPtr().expired(), false);
58  BOOST_CHECK_EQUAL(progeny2.getParentWeakPtr().expired(), true);
59 
60  // functions broken:
61  // const SharedPtrType& getParentSharedPtr(void) const;
62  //const progenitor_t::SharedPtrType otherPtr(progeny1.getParentSharedPtr());
63 }
torc::physical::BOOST_AUTO_TEST_CASE ( DesignRegressionTest  )

Basic regression test for the entire XDL infrastructure.

Note: This is neither a pleasant nor recommended way to create a design.

Definition at line 35 of file DesignRegressionTest.cpp.

35  {
36 
37  // determine whether or not to output additional debugging information; this serves primarily
38  // to show the user how certain design items can be accessed
39  bool debug = false;
40 
41  // create a design
42  DesignSharedPtr designPtr = Factory::newDesignPtr("blinker", "xc5vlx30", "ff324", "-1", "v3.2");
43  designPtr->setConfig("_DESIGN_PROP", "P3_PLACE_OPTIONS", "EFFORT_LEVEL:high");
44  designPtr->setConfig("_DESIGN_PROP", "", "P3_PLACED:");
45  designPtr->setConfig("_DESIGN_PROP", "", "P3_PLACE_OPTIONS:");
46  designPtr->setConfig("_DESIGN_PROP", "", "PK_NGMTIMESTAMP:1278102371");
47  BOOST_CHECK_EQUAL(designPtr->getConfigCount(), 4u);
48  if(debug) {
49  ConfigMap::const_iterator p = designPtr->configBegin();
50  ConfigMap::const_iterator e = designPtr->configEnd();
51  while(p != e) {
52  const std::string& setting = p->first;
53  const Config& config = p->second;
54  std::clog << "\t" << setting << ":" << config.getName() << ":" << config.getValue()
55  << std::endl;
56  p++;
57  }
58  }
59 
60  // create the modules (this design has no modules)
61  // verify the expected module count
62  BOOST_CHECK_EQUAL(designPtr->getModuleCount(), 0u);
63  if(debug) {
64  Design::ModuleSharedPtrConstIterator p = designPtr->modulesBegin();
65  Design::ModuleSharedPtrConstIterator e = designPtr->modulesEnd();
66  while(p != e) {
67  const ModuleSharedPtr& modulePtr = *p++;
68  std::clog << "\tmodule " << modulePtr->getName() << std::endl;
69  }
70  }
71 
72  // create the instances
73  // instance clk
74  InstanceSharedPtr clkInstPtr
75  = Factory::newInstancePtr("clk", "IOB", "CIOB_X17Y61", "B6", eInstanceBondingBonded);
76  clkInstPtr->setConfig("IMUX", "", "I");
77  clkInstPtr->setConfig("INBUF", "clk_ibuf/IBUFG", "");
78  clkInstPtr->setConfig("PAD", "clk", "");
79  clkInstPtr->setConfig("ISTANDARD", "", "LVCMOS25");
80  designPtr->addInstance(clkInstPtr);
81  // instance reset
82  InstanceSharedPtr resetInstPtr
83  = Factory::newInstancePtr("reset", "IOB", "CIOB_X17Y59", "F11", eInstanceBondingBonded);
84  resetInstPtr->setConfig("IMUX", "", "I");
85  resetInstPtr->setConfig("INBUF", "reset_ibuf", "");
86  resetInstPtr->setConfig("PAD", "reset", "");
87  resetInstPtr->setConfig("ISTANDARD", "", "LVCMOS25");
88  designPtr->addInstance(resetInstPtr);
89  // instance out
90  InstanceSharedPtr outInstPtr
91  = Factory::newInstancePtr("out", "IOB", "CIOB_X17Y59", "G11", eInstanceBondingBonded);
92  outInstPtr->setConfig("OUSED", "", "0");
93  outInstPtr->setConfig("OUTBUF", "out_obuf", "");
94  outInstPtr->setConfig("PAD", "out", "");
95  outInstPtr->setConfig("DRIVE", "", "12");
96  outInstPtr->setConfig("OSTANDARD", "", "LVCMOS25");
97  outInstPtr->setConfig("SLEW", "", "SLOW");
98  designPtr->addInstance(outInstPtr);
99  // instance clk_ibuf/BUFG
100  InstanceSharedPtr clkIbufInstPtr
101  = Factory::newInstancePtr("clk_ibuf/BUFG", "BUFG", "CLK_BUFGMUX_X47Y44", "BUFGCTRL_X0Y30");
102  clkIbufInstPtr->setConfig("BUFG", "clk_ibuf/BUFG", "");
103  designPtr->addInstance(clkIbufInstPtr);
104  // instance blink
105  InstanceSharedPtr blinkInstPtr
106  = Factory::newInstancePtr("blink", "SLICEL", "CLBLL_X16Y59", "SLICE_X27Y59");
107  blinkInstPtr->setConfig("CLKINV", "", "CLK");
108  blinkInstPtr->setConfig("D6LUT", "blink_i", "#LUT:O6=~A6");
109  blinkInstPtr->setConfig("DFF", "blink", "#FF");
110  blinkInstPtr->setConfig("DFFINIT", "", "INIT0");
111  blinkInstPtr->setConfig("DFFMUX", "", "O6");
112  blinkInstPtr->setConfig("DFFSR", "", "SRLOW");
113  blinkInstPtr->setConfig("SRUSED", "", "0");
114  blinkInstPtr->setConfig("SYNC_ATTR", "", "SYNC");
115  designPtr->addInstance(blinkInstPtr);
116  // instance XDL_DUMMY_IOI_X17Y59_OLOGIC_X1Y118
117  InstanceSharedPtr OLOGIC_X1Y118InstPtr
118  = Factory::newInstancePtr("XDL_DUMMY_IOI_X17Y59_OLOGIC_X1Y118", "OLOGIC", "IOI_X17Y59",
119  "OLOGIC_X1Y118");
120  OLOGIC_X1Y118InstPtr->setConfig("_NO_USER_LOGIC", "", "");
121  OLOGIC_X1Y118InstPtr->setConfig("_ROUTETHROUGH", "D1", "OQ");
122  designPtr->addInstance(OLOGIC_X1Y118InstPtr);
123  // instance XDL_DUMMY_IOI_X17Y59_ILOGIC_X1Y119
124  InstanceSharedPtr ILOGIC_X1Y119InstPtr
125  = Factory::newInstancePtr("XDL_DUMMY_IOI_X17Y59_ILOGIC_X1Y119", "ILOGIC", "IOI_X17Y59",
126  "ILOGIC_X1Y119");
127  ILOGIC_X1Y119InstPtr->setConfig("_NO_USER_LOGIC", "", "");
128  ILOGIC_X1Y119InstPtr->setConfig("_ROUTETHROUGH", "D", "O");
129  designPtr->addInstance(ILOGIC_X1Y119InstPtr);
130  // instance XDL_DUMMY_IOI_X17Y61_ILOGIC_X1Y123
131  InstanceSharedPtr ILOGIC_X1Y123InstPtr
132  = Factory::newInstancePtr("XDL_DUMMY_IOI_X17Y61_ILOGIC_X1Y123", "ILOGIC", "IOI_X17Y61",
133  "ILOGIC_X1Y123");
134  ILOGIC_X1Y123InstPtr->setConfig("_NO_USER_LOGIC", "", "");
135  ILOGIC_X1Y123InstPtr->setConfig("_ROUTETHROUGH", "D", "O");
136  designPtr->addInstance(ILOGIC_X1Y123InstPtr);
137  // verify that expected instance count
138  BOOST_CHECK_EQUAL(designPtr->getInstanceCount(), 8u);
139  if(debug) {
140  Design::InstanceSharedPtrConstIterator p = designPtr->instancesBegin();
141  Design::InstanceSharedPtrConstIterator e = designPtr->instancesEnd();
142  while(p != e) {
143  const InstanceSharedPtr& instancePtr = *p++;
144  std::clog << "\tinstance " << instancePtr->getName() << std::endl;
145  }
146  }
147 
148  // create the nets
149  // net blink
150  NetSharedPtr blinkNetPtr = Factory::newNetPtr("blink");
151  InstancePinSharedPtr blinkNetPin1Ptr = Factory::newInstancePinPtr(blinkInstPtr, "DQ");
152  blinkNetPtr->addSource(blinkNetPin1Ptr);
153  InstancePinSharedPtr blinkNetPin2Ptr = Factory::newInstancePinPtr(blinkInstPtr, "D6");
154  blinkNetPtr->addSink(blinkNetPin2Ptr);
155  InstancePinSharedPtr blinkNetPin3Ptr = Factory::newInstancePinPtr(outInstPtr, "O");
156  blinkNetPtr->addSink(blinkNetPin3Ptr);
157  blinkNetPtr->addPip(Factory::newPip("CLBLL_X16Y59", "L_DQ", "SITE_LOGIC_OUTS3",
159  blinkNetPtr->addPip(Factory::newPip("CLBLL_X16Y59", "SITE_IMUX_B47", "L_D6",
161  blinkNetPtr->addPip(Factory::newPip("INT_X16Y59", "EL2BEG2", "IMUX_B47",
163  blinkNetPtr->addPip(Factory::newPip("INT_X16Y59", "LOGIC_OUTS3", "EL2BEG2",
165  blinkNetPtr->addPip(Factory::newPip("INT_X17Y59", "EL2MID2", "IMUX_B41",
167  blinkNetPtr->addPip(Factory::newPip("IOI_X17Y59", "IOI_IMUX_B41", "IOI_O11",
169  blinkNetPtr->addPip(Factory::newPip("IOI_X17Y59", "IOI_O11", "IOI_O_PINWIRE1",
170  ePipUnidirectionalBuffered, Factory::newRoutethroughPtr("_ROUTETHROUGH",
171  "D1", "OQ", OLOGIC_X1Y118InstPtr, "D1", "OQ")));
172  blinkNetPtr->addPip(Factory::newPip("IOI_X17Y59", "IOI_O_PINWIRE1", "IOI_O1",
174  designPtr->addNet(blinkNetPtr);
175  // net clk
176  NetSharedPtr clkNetPtr = Factory::newNetPtr("clk");
177  clkNetPtr->setConfig("_BELSIG", "PAD,PAD,clk", "clk");
178  designPtr->addNet(clkNetPtr);
179  // net clk_c
180  NetSharedPtr clkCNetPtr = Factory::newNetPtr("clk_c");
181  InstancePinSharedPtr clkCNetPin1Ptr = Factory::newInstancePinPtr(clkIbufInstPtr, "O");
182  clkCNetPtr->addSource(clkCNetPin1Ptr);
183  InstancePinSharedPtr clkCNetPin2Ptr = Factory::newInstancePinPtr(blinkInstPtr, "CLK");
184  clkCNetPtr->addSink(clkCNetPin2Ptr);
185  clkCNetPtr->addPip(Factory::newPip("CLBLL_X16Y59", "SITE_CLK_B0", "L_CLK",
187  clkCNetPtr->addPip(Factory::newPip("CLK_BUFGMUX_X47Y44", "CLK_BUFGMUX_POSTMUX_GCLKP30",
188  "CLK_BUFGMUX_GCLKP30", ePipUnidirectionalBuffered));
189  clkCNetPtr->addPip(Factory::newPip("CLK_HROW_X17Y49", "CLK_HROW_GCLK_BUF30",
190  "CLK_HROW_HCLKL_P5", ePipUnidirectionalBuffered));
191  clkCNetPtr->addPip(Factory::newPip("HCLK_X16Y49", "HCLK_G_HCLK_P5", "HCLK_LEAF_GCLK5",
193  clkCNetPtr->addPip(Factory::newPip("INT_X16Y59", "GCLK5", "CLK_B0",
195  designPtr->addNet(clkCNetPtr);
196  // net clk_ibuf/IBUFG
197  NetSharedPtr clkIibufIbufgNetPtr = Factory::newNetPtr("clk_ibuf/IBUFG");
198  InstancePinSharedPtr clkIibufIbufgNetPin1Ptr = Factory::newInstancePinPtr(clkInstPtr, "I");
199  clkIibufIbufgNetPtr->addSource(clkIibufIbufgNetPin1Ptr);
200  InstancePinSharedPtr clkIibufIbufgNetPin2Ptr = Factory::newInstancePinPtr(clkIbufInstPtr, "I0");
201  clkIibufIbufgNetPtr->addSink(clkIibufIbufgNetPin2Ptr);
202  clkIibufIbufgNetPtr->addPip(Factory::newPip("CLK_BUFGMUX_X47Y44",
203  "CLK_BUFGMUX_MUXED_IN_CLKT_P28", "CLK_BUFGMUX_PREMUX0_CLK30",
205  clkIibufIbufgNetPtr->addPip(Factory::newPip("CLK_BUFGMUX_X47Y44", "CLK_BUFGMUX_PREMUX0_CLK30",
206  "CLK_BUFGMUX_CLKP0_30", ePipUnidirectionalBuffered));
207  clkIibufIbufgNetPtr->addPip(Factory::newPip("CLK_IOB_T_X17Y60", "CLK_IOB_CLK_BUF1",
208  "CLK_IOB_MUXED_CLKOUT28", ePipUnidirectionalBuffered));
209  clkIibufIbufgNetPtr->addPip(Factory::newPip("CLK_IOB_T_X17Y60", "CLK_IOB_PAD_CLK1",
210  "CLK_IOB_CLK_BUF1", ePipUnidirectionalBuffered));
211  clkIibufIbufgNetPtr->addPip(Factory::newPip("IOI_X17Y61", "IOI_D0", "IOI_I0",
212  ePipUnidirectionalBuffered, Factory::newRoutethroughPtr("_ROUTETHROUGH",
213  "D", "O", ILOGIC_X1Y123InstPtr, "D", "O")));
214  clkIibufIbufgNetPtr->addPip(Factory::newPip("IOI_X17Y61", "IOI_I0", "IOI_I_2GCLK0",
216  clkIibufIbufgNetPtr->addPip(Factory::newPip("IOI_X17Y61", "IOI_IBUF0", "IOI_D0",
218  designPtr->addNet(clkIibufIbufgNetPtr);
219  // net out
220  NetSharedPtr outNetPtr = Factory::newNetPtr("out");
221  outNetPtr->setConfig("_BELSIG", "PAD,PAD,out", "out");
222  designPtr->addNet(outNetPtr);
223  // net reset
224  NetSharedPtr resetNetPtr = Factory::newNetPtr("reset");
225  resetNetPtr->setConfig("_BELSIG", "PAD,PAD,reset", "reset");
226  designPtr->addNet(resetNetPtr);
227  // net reset_c
228  NetSharedPtr resetCNetPtr = Factory::newNetPtr("reset_c");
229  InstancePinSharedPtr resetCNetPin1Ptr = Factory::newInstancePinPtr(resetInstPtr, "I");
230  resetCNetPtr->addSource(resetCNetPin1Ptr);
231  InstancePinSharedPtr resetCNetPin2Ptr = Factory::newInstancePinPtr(blinkInstPtr, "SR");
232  resetCNetPtr->addSink(resetCNetPin2Ptr);
233  resetCNetPtr->addPip(Factory::newPip("CLBLL_X16Y59", "SITE_CTRL_B2", "L_SR",
235  resetCNetPtr->addPip(Factory::newPip("INT_INTERFACE_X17Y59", "INT_INTERFACE_LOGIC_OUTS_B11",
236  "INT_INTERFACE_LOGIC_OUTS11", ePipUnidirectionalBuffered));
237  resetCNetPtr->addPip(Factory::newPip("INT_X16Y59", "CTRL2", "CTRL_B2",
239  resetCNetPtr->addPip(Factory::newPip("INT_X16Y59", "WS2MID2", "CTRL2",
241  resetCNetPtr->addPip(Factory::newPip("INT_X17Y59", "LOGIC_OUTS11", "WS2BEG2",
243  resetCNetPtr->addPip(Factory::newPip("IOI_X17Y59", "IOI_D0", "IOI_I0",
244  ePipUnidirectionalBuffered, Factory::newRoutethroughPtr("_ROUTETHROUGH",
245  "D", "O", ILOGIC_X1Y119InstPtr, "D", "O")));
246  resetCNetPtr->addPip(Factory::newPip("IOI_X17Y59", "IOI_I0", "IOI_LOGIC_OUTS11",
248  resetCNetPtr->addPip(Factory::newPip("IOI_X17Y59", "IOI_IBUF0", "IOI_D0",
250  designPtr->addNet(resetCNetPtr);
251  // verify the expected net count
252  BOOST_CHECK_EQUAL(designPtr->getNetCount(), 7u);
253  if(debug) {
254  Design::NetSharedPtrConstIterator p = designPtr->netsBegin();
255  Design::NetSharedPtrConstIterator e = designPtr->netsEnd();
256  while(p != e) {
257  const NetSharedPtr& netPtr = *p++;
258  std::clog << "\tnet " << netPtr->getName() << std::endl;
259  }
260  }
261 
262  // create the appropriate file paths
264  / "torc" / "physical" / "DesignUnitTest.reference.xdl";
266  / "regression" / "DesignUnitTest.generated.xdl";
267  // export the created design
268  std::fstream xdlExport(generatedPath.string().c_str(), std::ios_base::out);
269  XdlExporter fileExporter(xdlExport);
270  fileExporter(designPtr);
271 
272  // compare the reference and generated XDL
273  BOOST_CHECK(torc::common::fileContentsAreEqual(generatedPath, referencePath));
274 
275 }
boost::shared_ptr< Instance > InstanceSharedPtr
std::string string
boost::shared_ptr< Design > DesignSharedPtr
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< Net > NetSharedPtr
boost::filesystem::path path
bool fileContentsAreEqual(const boost::filesystem::path &inA, const boost::filesystem::path &inB)
Compare the raw contents of two files to determine whether they are identical.
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( XdlUnpackUnitTest  )

Unit test for the XdlUnpack class.

Definition at line 35 of file XdlUnpackUnitTest.cpp.

35  {
36  BOOST_MESSAGE("DEPRECATED: XdlUnpack is deprecated in favor of Unpacker.");
37  return;
38 
39  // create the appropriate file paths
40  boost::filesystem::path regressionPath
42  boost::filesystem::path generatedPath = regressionPath / "XdlUnpackUnitTest.xdl";
44  / "torc" / "physical" / "DesignUnitTest.reference.xdl";
45 
46  // import the XDL design
47  std::fstream fileStream(referencePath.string().c_str());
48  BOOST_REQUIRE(fileStream.good());
50  importer(fileStream, referencePath.string());
51 
52  // unpack the design
53  torc::physical::DesignSharedPtr designPtr = importer.getDesignPtr();
55  torc::physical::DesignSharedPtr unpackedDesignPtr = unpacker(designPtr);
56 
57  // export the created design
58  std::fstream xdlExport(generatedPath.string().c_str(), std::ios_base::out);
59  BOOST_REQUIRE(xdlExport.good());
60  XdlExporter fileExporter(xdlExport);
61  fileExporter(unpackedDesignPtr);
62 
63 }
DesignSharedPtr getDesignPtr(void)
Returns a shared pointer for the design.
boost::filesystem::path path
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
Importer from XDL format into a physical design.
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( XdlExporterUnitTest  )

Unit test for the XdlExporter class.

Definition at line 36 of file XdlExporterUnitTest.cpp.

36  {
37  // create the appropriate file paths
39  / "regression" / "XdlExporterUnitTest.generated.xdl";
41  / "torc" / "physical" / "ModuleTransformerUnitTest.Scenario.02.Flatten.xdl";
42 
43  // import the XDL design
44  std::fstream fileStream(referencePath.string().c_str());
45  BOOST_REQUIRE(fileStream.good());
46  XdlImporter importer;
47  importer(fileStream, referencePath.string());
48 
49  // look up the design
50  DesignSharedPtr designPtr = importer.getDesignPtr();
51  BOOST_REQUIRE(designPtr.get() != 0);
52 
53  // members tested:
54  // std::ostream& mStream;
55  // int mIndentCount;
56  // std::string mIndentString;
57  // functions tested:
58  // XdlExporter(std::ostream& inStream, const std::string& inIndentString = "\t");
59  // void operator() (const DesignSharedPtr& inDesignPtr);
60  // void indent(void) const;
61  // void write(const Circuit& circuit);
62  // void write(const Design& design);
63  // void write(const Module& module);
64  // void write(const Port& port);
65  // void write(const Instance& instance);
66  // void write(const Net& net);
67  // void write(const InstancePin& instancePin, EPinDirection pinDirection, bool comma);
68  // void write(const Pip& pip, bool comma);
69  // void write(const Routethrough& routethrough);
70  // void write(const ConfigMap& configMap);
71  // export the XDL design
72  std::fstream xdlExport(generatedPath.string().c_str(), std::ios_base::out);
73  XdlExporter fileExporter(xdlExport);
74  fileExporter(designPtr);
75  BOOST_CHECK(torc::common::fileContentsAreEqual(generatedPath, referencePath));
76 }
boost::shared_ptr< Design > DesignSharedPtr
boost::filesystem::path path
bool fileContentsAreEqual(const boost::filesystem::path &inA, const boost::filesystem::path &inB)
Compare the raw contents of two files to determine whether they are identical.
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( CircuitUnitTest  )

Unit test for the Circuit class.

Definition at line 38 of file CircuitUnitTest.cpp.

38  {
39  // functions tested:
40  // Circuit(const string& inName);
41  // size_t getInstanceCount(void) const;
42  // size_t getNetCount(void) const;
43  // InstanceSharedPtrIterator instancesBegin(void);
44  // InstanceSharedPtrIterator instancesEnd(void);
45  // InstanceSharedPtrIterator netsBegin(void);
46  // InstanceSharedPtrIterator netsEnd(void);
47  // create a module, since we cannot create a circuit directly
48  ModuleSharedPtr circuitPtr = Factory::newModulePtr("module", "anchor");
49  // verify that the circuit exists, and that it is empty
50  BOOST_REQUIRE(circuitPtr.get() != 0);
51  BOOST_CHECK(circuitPtr->getInstanceCount() == 0);
52  BOOST_CHECK(circuitPtr->getNetCount() == 0);
53  BOOST_CHECK(circuitPtr->instancesBegin() == circuitPtr->instancesEnd());
54  BOOST_CHECK(circuitPtr->netsBegin() == circuitPtr->netsEnd());
55 
56  // create a few instances and nets, and add them to the circuit
57  InstanceSharedPtr instance1aPtr = Factory::newInstancePtr("instance", "SLICEL", "CLBLL_X16Y59",
58  "SLICE_X27Y59");
59  InstanceSharedPtr instance1bPtr = Factory::newInstancePtr("instance", "dummy", "dummy",
60  "dummy"); // deliberate reuse of instance name
61  NetSharedPtr net1Ptr = Factory::newNetPtr("net1");
62  net1Ptr->addPip(Factory::newPip("CLBLL_X16Y59", "L_DQ", "SITE_LOGIC_OUTS3",
64  NetSharedPtr net2aPtr = Factory::newNetPtr("net2");
65  NetSharedPtr net2bPtr = Factory::newNetPtr("net2"); // deliberate reuse of net name
66  NetSharedPtr net3Ptr = Factory::newNetPtr("net3");
67  //RenamableInstance::recast(instance1aPtr)->setName("goodbye");
68 
69  // functions tested:
70  // bool addInstance(InstanceSharedPtr& inInstancePtr);
71  // bool addNet(NetSharedPtr& inNetPtr);
72  // InstanceSharedPtrIterator findInstance(const string& inName);
73  // NetSharedPtrIterator findNet(const string& inName);
74  // size_t getInstanceCount(void) const;
75  // size_t getNetCount(void) const;
76  BOOST_CHECK_EQUAL(circuitPtr->addInstance(instance1aPtr), true);
77  BOOST_CHECK_EQUAL(circuitPtr->addInstance(instance1bPtr), false); // name already exists
78  BOOST_CHECK_EQUAL(circuitPtr->addNet(net1Ptr), true);
79  BOOST_CHECK_EQUAL(circuitPtr->addNet(net2aPtr), true);
80  BOOST_CHECK_EQUAL(circuitPtr->addNet(net2bPtr), false); // name already exists
81  BOOST_CHECK_EQUAL(circuitPtr->addNet(net3Ptr), true);
82  BOOST_CHECK(circuitPtr->getInstanceCount() == 1);
83  BOOST_CHECK(circuitPtr->getNetCount() == 3);
84 
85  // functions tested:
86  // void unplace(void);
87  // void unroute(void);
88  // unplace and unroute the circuit
89  BOOST_CHECK(instance1aPtr->getTile().length() != 0);
90  BOOST_CHECK(instance1aPtr->getSite().length() != 0);
91  BOOST_CHECK(net1Ptr->getPipCount() != 0);
92  circuitPtr->unplace();
93  circuitPtr->unroute();
94  BOOST_CHECK(instance1aPtr->getTile().length() == 0);
95  BOOST_CHECK(instance1aPtr->getSite().length() == 0);
96  BOOST_CHECK(net1Ptr->getPipCount() == 0);
97 
98  // functions tested:
99  // bool removeInstance(InstanceSharedPtr& inInstancePtr);
100  // bool removeNet(NetSharedPtr& inNetPtr);
101  // size_t getInstanceCount(void) const;
102  // size_t getNetCount(void) const;
103  // find and remove instances and nets
104  BOOST_CHECK(circuitPtr->removeInstance(*circuitPtr->findInstance("instance")));
105  BOOST_CHECK(circuitPtr->removeNet(*circuitPtr->findNet("net1")));
106  BOOST_CHECK(circuitPtr->removeNet(*circuitPtr->findNet("net2")));
107  BOOST_CHECK(circuitPtr->removeNet(*circuitPtr->findNet("net3")));
108  BOOST_CHECK(circuitPtr->getInstanceCount() == 0);
109  BOOST_CHECK(circuitPtr->getNetCount() == 0);
110 }
boost::shared_ptr< Instance > InstanceSharedPtr
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< Net > NetSharedPtr

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ModularizeWithIntraNetUnitTest  )

Unit test for modularizing two instances with intra net.

Definition at line 422 of file ModuleTransformerUnitTest.cpp.

422  {
423  // Verify file opened successfully
424  DesignSharedPtr designPtr
425  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.01.Modularize.xdl");
426  // Get instances to modularize
427  InstanceSharedPtrVector instPtrVector = getInstancesToModularize(designPtr);
428  // Pre modularization verifications
430  // Create a ModuleTransformer object
431  ModuleTransformer moduleTransfomer(designPtr);
432  // Modularize instances in instPtrVector
433  moduleTransfomer.modularize(instPtrVector, sModuleDefinition, sModuleInstanceName);
434  // Post modularization verifications
435  postModularizationVerifications(designPtr, instPtrVector);
436 }
void postModularizationVerifications(DesignSharedPtr inDesignPtr, InstanceSharedPtrVector inInstanceVector, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-modularization tests on a design.
static const string sModuleDefinition
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Vector of Instance shared pointers.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preModularizationVerifications(DesignSharedPtr inDesignPtr)
Perform pre-modularization tests on a design.
InstanceSharedPtrVector getInstancesToModularize(DesignSharedPtr inDesignPtr)
Retrieve the instances to modularize from the design and return them in a vector. ...

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ModularizeWithInputInterNetUnitTest  )

Unit test for modularizing two instances with input inter net.

Definition at line 439 of file ModuleTransformerUnitTest.cpp.

439  {
440  // Verify file opened successfully
441  DesignSharedPtr designPtr
442  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.02.Modularize.xdl");
443  // Get instances to modularize
444  InstanceSharedPtrVector instPtrVector = getInstancesToModularize(designPtr);
445  // Pre modularization verifications
447  // Create a ModuleTransformer object
448  ModuleTransformer moduleTransfomer(designPtr);
449  // Modularize instances in instPtrVector
450  moduleTransfomer.modularize(instPtrVector, sModuleDefinition, sModuleInstanceName);
451  // Post modularization verifications
452  postModularizationVerifications(designPtr, instPtrVector);
453 }
void postModularizationVerifications(DesignSharedPtr inDesignPtr, InstanceSharedPtrVector inInstanceVector, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-modularization tests on a design.
static const string sModuleDefinition
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Vector of Instance shared pointers.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preModularizationVerifications(DesignSharedPtr inDesignPtr)
Perform pre-modularization tests on a design.
InstanceSharedPtrVector getInstancesToModularize(DesignSharedPtr inDesignPtr)
Retrieve the instances to modularize from the design and return them in a vector. ...

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ModularizeWithInputFanoutInterNetUnitTest  )

Unit test for modularizing two instances with input fanout input net.

Definition at line 456 of file ModuleTransformerUnitTest.cpp.

456  {
457  // Verify file opened successfully
458  DesignSharedPtr designPtr
459  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.03.Modularize.xdl");
460  // Get instances to modularize
461  InstanceSharedPtrVector instPtrVector = getInstancesToModularize(designPtr);
462  // Pre modularization verifications
464  // Create a ModuleTransformer object
465  ModuleTransformer moduleTransfomer(designPtr);
466  // Modularize instances in instPtrVector
467  moduleTransfomer.modularize(instPtrVector, sModuleDefinition, sModuleInstanceName);
468  // Post modularization verifications
469  postModularizationVerifications(designPtr, instPtrVector);
470 }
void postModularizationVerifications(DesignSharedPtr inDesignPtr, InstanceSharedPtrVector inInstanceVector, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-modularization tests on a design.
static const string sModuleDefinition
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Vector of Instance shared pointers.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preModularizationVerifications(DesignSharedPtr inDesignPtr)
Perform pre-modularization tests on a design.
InstanceSharedPtrVector getInstancesToModularize(DesignSharedPtr inDesignPtr)
Retrieve the instances to modularize from the design and return them in a vector. ...

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ModularizeWithOutputInterNetUnitTest  )

Unit test for modularizing two instances with output inter net.

Definition at line 473 of file ModuleTransformerUnitTest.cpp.

473  {
474  // Verify file opened successfully
475  DesignSharedPtr designPtr
476  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.04.Modularize.xdl");
477  // Get instances to modularize
478  InstanceSharedPtrVector instPtrVector = getInstancesToModularize(designPtr);
479  // Pre modularization verifications
481  // Create a ModuleTransformer object
482  ModuleTransformer moduleTransfomer(designPtr);
483  // Modularize instances in instPtrVector
484  moduleTransfomer.modularize(instPtrVector, sModuleDefinition, sModuleInstanceName);
485  // Post modularization verifications
486  postModularizationVerifications(designPtr, instPtrVector);
487 }
void postModularizationVerifications(DesignSharedPtr inDesignPtr, InstanceSharedPtrVector inInstanceVector, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-modularization tests on a design.
static const string sModuleDefinition
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Vector of Instance shared pointers.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preModularizationVerifications(DesignSharedPtr inDesignPtr)
Perform pre-modularization tests on a design.
InstanceSharedPtrVector getInstancesToModularize(DesignSharedPtr inDesignPtr)
Retrieve the instances to modularize from the design and return them in a vector. ...

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ModularizeWithOutputFanoutInterNetUnitTest  )

Unit test for modularizing two instances with output fanout inter net.

Definition at line 490 of file ModuleTransformerUnitTest.cpp.

490  {
491  // Verify file opened successfully
492  DesignSharedPtr designPtr
493  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.05.Modularize.xdl");
494  // Get instances to modularize
495  InstanceSharedPtrVector instPtrVector = getInstancesToModularize(designPtr);
496  // Pre modularization verifications
498  // Create a ModuleTransformer object
499  ModuleTransformer moduleTransfomer(designPtr);
500  // Modularize instances in instPtrVector
501  moduleTransfomer.modularize(instPtrVector, sModuleDefinition, sModuleInstanceName);
502  // Post modularization verifications
503  postModularizationVerifications(designPtr, instPtrVector);
504 }
void postModularizationVerifications(DesignSharedPtr inDesignPtr, InstanceSharedPtrVector inInstanceVector, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-modularization tests on a design.
static const string sModuleDefinition
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Vector of Instance shared pointers.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preModularizationVerifications(DesignSharedPtr inDesignPtr)
Perform pre-modularization tests on a design.
InstanceSharedPtrVector getInstancesToModularize(DesignSharedPtr inDesignPtr)
Retrieve the instances to modularize from the design and return them in a vector. ...

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( ModularizeWithIntraAndInterNetUnitTest  )

Unit test for modularizing two instances with fanout intra and inter net.

Definition at line 507 of file ModuleTransformerUnitTest.cpp.

507  {
508  // Verify file opened successfully
509  DesignSharedPtr designPtr
510  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.06.Modularize.xdl");
511  // Get instances to modularize
512  InstanceSharedPtrVector instPtrVector = getInstancesToModularize(designPtr);
513  // Pre modularization verifications
515  // Create a ModuleTransformer object
516  ModuleTransformer moduleTransfomer(designPtr);
517  // Modularize instances in instPtrVector
518  moduleTransfomer.modularize(instPtrVector, sModuleDefinition, sModuleInstanceName);
519  // Post modularization verifications
520  postModularizationVerifications(designPtr, instPtrVector);
521 }
void postModularizationVerifications(DesignSharedPtr inDesignPtr, InstanceSharedPtrVector inInstanceVector, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-modularization tests on a design.
static const string sModuleDefinition
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Vector of Instance shared pointers.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preModularizationVerifications(DesignSharedPtr inDesignPtr)
Perform pre-modularization tests on a design.
InstanceSharedPtrVector getInstancesToModularize(DesignSharedPtr inDesignPtr)
Retrieve the instances to modularize from the design and return them in a vector. ...

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( FlattenWithIntraNetUnitTest  )

Unit test for flattening a module with two instances and an intra net.

Definition at line 526 of file ModuleTransformerUnitTest.cpp.

526  {
527  // Verify file opened successfully
528  DesignSharedPtr designPtr
529  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.01.Flatten.xdl");
530  // Pre flattening verifications
531  preFlatteningVerifications(designPtr);
532  // Create a ModuleTransformer object
533  ModuleTransformer moduleTransfomer(designPtr);
534  // Flatten sModuleInstanceName
535  moduleTransfomer.flatten(sModuleInstanceName);
536  // Post flattening verifications
537  postFlatteningVerifications(designPtr);
538 }
void postFlatteningVerifications(DesignSharedPtr inDesignPtr, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-flattening tests on a design.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preFlatteningVerifications(DesignSharedPtr inDesignPtr)
Perform pre-flattening tests on a design.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( FlattenWithInputInterNetUnitTest  )

Unit test for flattening two instances with input inter net.

Definition at line 541 of file ModuleTransformerUnitTest.cpp.

541  {
542  // Verify file opened successfully
543  DesignSharedPtr designPtr
544  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.02.Flatten.xdl");
545  // Pre flattening verifications
546  preFlatteningVerifications(designPtr);
547  // Create a ModuleTransformer object
548  ModuleTransformer moduleTransfomer(designPtr);
549  // Flatten sModuleInstanceName
550  moduleTransfomer.flatten(sModuleInstanceName);
551  // Post flattening verifications
552  postFlatteningVerifications(designPtr);
553 }
void postFlatteningVerifications(DesignSharedPtr inDesignPtr, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-flattening tests on a design.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preFlatteningVerifications(DesignSharedPtr inDesignPtr)
Perform pre-flattening tests on a design.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( FlattenWithInputFanoutInterNetUnitTest  )

Unit test for flattening two instances with input fanout input net.

Definition at line 556 of file ModuleTransformerUnitTest.cpp.

556  {
557  // Verify file opened successfully
558  DesignSharedPtr designPtr
559  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.03.Flatten.xdl");
560  // Pre flattening verifications
561  preFlatteningVerifications(designPtr);
562  // Create a ModuleTransformer object
563  ModuleTransformer moduleTransfomer(designPtr);
564  // Flatten sModuleInstanceName
565  moduleTransfomer.flatten(sModuleInstanceName);
566  // Post flattening verifications
567  postFlatteningVerifications(designPtr);
568 }
void postFlatteningVerifications(DesignSharedPtr inDesignPtr, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-flattening tests on a design.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preFlatteningVerifications(DesignSharedPtr inDesignPtr)
Perform pre-flattening tests on a design.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( FlattenWithOutputInterNetUnitTest  )

Unit test for flattening two instances with output inter net.

Definition at line 571 of file ModuleTransformerUnitTest.cpp.

571  {
572  // Verify file opened successfully
573  DesignSharedPtr designPtr
574  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.04.Flatten.xdl");
575  // Pre flattening verifications
576  preFlatteningVerifications(designPtr);
577  // Create a ModuleTransformer object
578  ModuleTransformer moduleTransfomer(designPtr);
579  // Flatten sModuleInstanceName
580  moduleTransfomer.flatten(sModuleInstanceName);
581  // Post flattening verifications
582  postFlatteningVerifications(designPtr);
583 }
void postFlatteningVerifications(DesignSharedPtr inDesignPtr, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-flattening tests on a design.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preFlatteningVerifications(DesignSharedPtr inDesignPtr)
Perform pre-flattening tests on a design.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( FlattenWithOutputFanoutInterNetUnitTest  )

Unit test for flattening two instances with output fanout inter net.

Definition at line 586 of file ModuleTransformerUnitTest.cpp.

586  {
587  // Verify file opened successfully
588  DesignSharedPtr designPtr
589  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.05.Flatten.xdl");
590  // Pre flattening verifications
591  preFlatteningVerifications(designPtr);
592  // Create a ModuleTransformer object
593  ModuleTransformer moduleTransfomer(designPtr);
594  // Flatten sModuleInstanceName
595  moduleTransfomer.flatten(sModuleInstanceName);
596  // Post flattening verifications
597  postFlatteningVerifications(designPtr);
598 }
void postFlatteningVerifications(DesignSharedPtr inDesignPtr, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-flattening tests on a design.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preFlatteningVerifications(DesignSharedPtr inDesignPtr)
Perform pre-flattening tests on a design.

+ Here is the call graph for this function:

torc::physical::BOOST_AUTO_TEST_CASE ( FlattenWithIntraAndInterNetUnitTest  )

Unit test for flattening two instances with fanout intra and inter net.

Definition at line 601 of file ModuleTransformerUnitTest.cpp.

601  {
602  // Verify file opened successfully
603  DesignSharedPtr designPtr
604  = verifyDesignOpenedSuccessfully("ModuleTransformerUnitTest.Scenario.06.Flatten.xdl");
605  // Pre flattening verifications
606  preFlatteningVerifications(designPtr);
607  // Create a ModuleTransformer object
608  ModuleTransformer moduleTransfomer(designPtr);
609  // Flatten sModuleInstanceName
610  moduleTransfomer.flatten(sModuleInstanceName);
611  // Post flattening verifications
612  postFlatteningVerifications(designPtr);
613 }
void postFlatteningVerifications(DesignSharedPtr inDesignPtr, bool inKeepPlacement=false, bool inKeepRouting=false)
Perform post-flattening tests on a design.
boost::shared_ptr< Design > DesignSharedPtr
static const string sModuleInstanceName
DesignSharedPtr verifyDesignOpenedSuccessfully(const string &inDesignFileName)
Verify that the design file opened successfully.
void preFlatteningVerifications(DesignSharedPtr inDesignPtr)
Perform pre-flattening tests on a design.

+ Here is the call graph for this function:

InstanceSharedPtrVector torc::physical::getInstancesToModularize ( DesignSharedPtr  inDesignPtr)

Retrieve the instances to modularize from the design and return them in a vector.

Parameters
inDesignPtrThe design shared pointer.

Definition at line 77 of file ModuleTransformerUnitTest.cpp.

77  {
78  // Create instances vector
79  InstanceSharedPtrVector instPtrVector;
80  // Select instance sInstanceOneName to modularize
81  Design::InstanceSharedPtrIterator instIter = inDesignPtr->findInstance(sInstanceOneName);
82  // Verify design has instance sInstanceOneName
83  BOOST_REQUIRE(instIter != inDesignPtr->instancesEnd());
84  // Add instance pointer to instance vector
85  instPtrVector.push_back(*instIter);
86  // Select instance sInstanceTwoName to modularize
87  instIter = inDesignPtr->findInstance(sInstanceTwoName);
88  // Verify design has instance sInstanceTwoName
89  BOOST_REQUIRE(instIter != inDesignPtr->instancesEnd());
90  instPtrVector.push_back(*instIter);
91  // Return instance vector
92  return instPtrVector;
93 }
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Vector of Instance shared pointers.
static const string sInstanceOneName
static const string sInstanceTwoName

+ Here is the caller graph for this function:

std::ostream & torc::physical::operator<< ( std::ostream &  os,
const Design &  rhs 
)

Design stream inserter.

Definition at line 26 of file physical/OutputStreamHelpers.cpp.

26  {
27  return os << rhs.getName() << " [" << rhs.getDevice() << rhs.getPackage()
28  << rhs.getSpeedGrade() << ", " << rhs.getXdlVersion() << "]";
29  }

+ Here is the call graph for this function:

std::ostream & torc::physical::operator<< ( std::ostream &  os,
const Module &  rhs 
)

Module stream inserter.

Definition at line 31 of file physical/OutputStreamHelpers.cpp.

31  {
32  return os << rhs.getName() << " [" << rhs.getAnchor() << "]";
33  }

+ Here is the call graph for this function:

std::ostream & torc::physical::operator<< ( std::ostream &  os,
const Instance &  rhs 
)

Instance stream inserter.

Definition at line 35 of file physical/OutputStreamHelpers.cpp.

35  {
36  return os << rhs.getName();
37  }

+ Here is the call graph for this function:

std::ostream & torc::physical::operator<< ( std::ostream &  os,
const Net &  rhs 
)

Net stream inserter.

Definition at line 39 of file physical/OutputStreamHelpers.cpp.

39  {
40  return os << rhs.getName();
41  }

+ Here is the call graph for this function:

std::ostream & torc::physical::operator<< ( std::ostream &  os,
const InstancePin &  rhs 
)

InstancePin stream inserter.

Definition at line 43 of file physical/OutputStreamHelpers.cpp.

43  {
44  InstanceWeakPtr instancePtr = rhs.getInstancePtr();
45  return os << (instancePtr.expired() ? "[unnamed]" : instancePtr.lock()->getName()) << '.'
46  << rhs.getPinName();
47  }
boost::weak_ptr< Instance > InstanceWeakPtr

+ Here is the call graph for this function:

std::ostream & torc::physical::operator<< ( std::ostream &  os,
const Pip &  rhs 
)

Pip stream inserter.

Definition at line 49 of file physical/OutputStreamHelpers.cpp.

49  {
50  return os << rhs.getTileName() << ' ' << rhs.getSourceWireName() << ' '
51  << rhs.getDirectionString() << ' ' << rhs.getSinkWireName();
52  }

+ Here is the call graph for this function:

std::ostream & torc::physical::operator<< ( std::ostream &  os,
const Config &  rhs 
)

Config iterator stream inserter.

Definition at line 54 of file physical/OutputStreamHelpers.cpp.

54  {
55  return os << rhs.getName() << ':' << rhs.getValue();
56  }

+ Here is the call graph for this function:

void torc::physical::postFlatteningVerifications ( DesignSharedPtr  inDesignPtr,
bool  inKeepPlacement,
bool  inKeepRouting 
)

Perform post-flattening tests on a design.

Parameters
inDesignPtrThe design shared pointer.
inKeepPlacementThe flag to keep placement when flattening, defaults to false.
inKeepRoutingThe flag to keep routing when flattening, defaults to false.

The post-flattening tests consist of the following: 1 - Verify module definition still exists in design. 2 - Verify module instance does not exist in design. 3 - Verify module instances cloning & placement. 4 - Verify module intra nets cloning & routing. 5 - Verify inter nets do not reference module instance & inter net routing.

Definition at line 291 of file ModuleTransformerUnitTest.cpp.

292  {
293  // Begin verify module definition existence and removal of module instance
294  // Search design for sModuleDefinition
295  Design::ModuleSharedPtrIterator modIter = inDesignPtr->findModule(sModuleDefinition);
296  // Verify design has module sModuleDefinition
297  BOOST_REQUIRE(modIter != inDesignPtr->modulesEnd());
298  // Search design for sModuleInstanceName
299  Design::InstanceSharedPtrIterator designInstIter
300  = inDesignPtr->findInstance(sModuleInstanceName);
301  // Verify design has sModuleInstanceName
302  BOOST_REQUIRE(designInstIter == inDesignPtr->instancesEnd());
303  // End verify module definition existence and removal of module instance
304 
305  // Begin verify module instances cloning and placement
306  // Get a pointer to the module definition
307  ModuleSharedPtr modPtr = *modIter;
308  // Get a begin iterator to module definition instances
309  Design::InstanceSharedPtrConstIterator modInstancesBegin = modPtr->instancesBegin();
310  // Get an end iterator to module definition instances
311  Design::InstanceSharedPtrConstIterator modInstancesEnd = modPtr->instancesEnd();
312  // Iterate over all module definition instances
313  while(modInstancesBegin != modInstancesEnd) {
314  // Get a pointer to the current instance
315  InstanceSharedPtr modInstPtr = *modInstancesBegin;
316  // Search for corresponding flattened instance in design
317  designInstIter = inDesignPtr->findInstance(sModuleInstanceName +
318  sHierarchySeparator + modInstPtr->getName());
319  // Verify instance is cloned and moved to design
320  BOOST_REQUIRE(designInstIter != inDesignPtr->instancesEnd());
321  // Verify placement
322  if(!inKeepPlacement) {
323  // Get a pointer to the instance clone
324  InstanceSharedPtr instPtr = *designInstIter;
325  // Verify it is not placed
326  BOOST_REQUIRE_EQUAL(instPtr->getTile().compare(""), 0);
327  BOOST_REQUIRE_EQUAL(instPtr->getSite().compare(""), 0);
328  }
329  // Move to next instance
330  modInstancesBegin++;
331  }
332  // End verify module instances cloning and placement
333 
334  // Begin verify intra net cloning and routing
335  // Get a begin iterator to module nets
336  Design::NetSharedPtrIterator moduleNetsBegin = modPtr->netsBegin();
337  // Get an end iterator to module nets
338  Design::NetSharedPtrIterator moduleNetsEnd = modPtr->netsEnd();
339  // Iterate over all module nets
340  while(moduleNetsBegin != moduleNetsEnd) {
341  // Get a pointer to the current net
342  NetSharedPtr moduleNetPtr = *moduleNetsBegin;
343  // Search for corresponding flattened net in design
344  Design::NetSharedPtrIterator designNetIter = inDesignPtr->findNet(sModuleInstanceName +
345  sHierarchySeparator + moduleNetPtr->getName());
346  // Verify net is cloned and moved to design
347  BOOST_REQUIRE(designNetIter != inDesignPtr->netsEnd());
348  // Get a pointer to the cloned design net
349  NetSharedPtr designNetPtr = *designNetIter;
350  // Verify routing
351  if(!inKeepRouting) {
352  BOOST_REQUIRE(designNetPtr->pipsBegin() == designNetPtr->pipsEnd());
353  }
354  // Move to next net
355  moduleNetsBegin++;
356  }
357  // End verify intra net migration and routing
358 
359  // Begin verify inter nets does not reference module instance & routing
360  // Get a begin iterator to design nets
361  Design::NetSharedPtrIterator designNetsBegin = inDesignPtr->netsBegin();
362  // Get an end iterator to design nets
363  Design::NetSharedPtrIterator designNetsEnd = inDesignPtr->netsEnd();
364  // Iterate over all design nets
365  while(designNetsBegin != designNetsEnd) {
366  // Get a pointer to the current net
367  NetSharedPtr designNetPtr = *designNetsBegin;
368  // Get a begin iterator to net sources
369  Net::InstancePinSharedPtrIterator designNetSourcesBegin = designNetPtr->sourcesBegin();
370  // Get an end iterator to net sources
371  Net::InstancePinSharedPtrIterator designNetSourcesEnd = designNetPtr->sourcesEnd();
372  // Iterate over all net source
373  while(designNetSourcesBegin != designNetSourcesEnd) {
374  // Get a pointer to the current net source pin
375  InstancePinSharedPtr instPinPtr = *designNetSourcesBegin;
376  // Get a pointer to the instance hosting the net source pin
377  InstanceSharedPtr pinInstPtr = instPinPtr->getInstancePtr().lock();
378  // Verify net does not point to flattened module instance
379  BOOST_REQUIRE_NE(pinInstPtr->getName().compare(sModuleInstanceName), 0);
380 
381  // Was this an inter net once?
382  if((pinInstPtr->getName()).find(sModuleInstanceName + sHierarchySeparator)
383  != string::npos) {
384  // Verify routing
385  if(!inKeepRouting) {
386  BOOST_REQUIRE(designNetPtr->pipsBegin() == designNetPtr->pipsEnd());
387  }
388  }
389  // Move to next source
390  designNetSourcesBegin++;
391  }
392  // Get a begin iterator to net sinks
393  Net::InstancePinSharedPtrIterator designNetSinksBegin = designNetPtr->sinksBegin();
394  // Get an end iterator to net sinks
395  Net::InstancePinSharedPtrIterator designNetSinksEnd = designNetPtr->sinksEnd();
396  // Iterate over all net source
397  while(designNetSinksBegin != designNetSinksEnd) {
398  // Get a pointer to the current net source pin
399  InstancePinSharedPtr instPinPtr = *designNetSinksBegin;
400  // Get a pointer to the instance hosting the net source pin
401  InstanceSharedPtr pinInstPtr = instPinPtr->getInstancePtr().lock();
402  // Verify net does not point to flattened module instance
403  BOOST_REQUIRE_NE(pinInstPtr->getName().compare(sModuleInstanceName), 0);
404  // Was this an inter net once?
405  if((pinInstPtr->getName()).find(sModuleInstanceName + sHierarchySeparator)
406  != string::npos) {
407  // Verify routing
408  if(!inKeepRouting) {
409  BOOST_REQUIRE(designNetPtr->pipsBegin() == designNetPtr->pipsEnd());
410  }
411  }
412  // Move to next sink
413  designNetSinksBegin++;
414  }
415  // Move to next net
416  designNetsBegin++;
417  }
418  // End verify inter nets does not reference module instance & routing
419 }
boost::shared_ptr< Instance > InstanceSharedPtr
static const string sModuleDefinition
static const string sModuleInstanceName
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.
static const string sHierarchySeparator

+ Here is the caller graph for this function:

void torc::physical::postModularizationVerifications ( DesignSharedPtr  inDesignPtr,
InstanceSharedPtrVector  inInstanceVector,
bool  inKeepPlacement,
bool  inKeepRouting 
)

Perform post-modularization tests on a design.

Parameters
inDesignPtrThe design shared pointer.
inInstanceVectorThe vector of the instances that were modularized
inKeepPlacementThe flag to keep placement when modularizing, defaults to false.
inKeepRoutingThe flag to keep routing when modularizing, defaults to false.

The post-modularization tests consist of the following: 1 - Verify module definition exists in design. 2 - Verify module instance exists in design. 3 - Verify module instance placement. 4 - Verify instances migration & placement. 5 - Verify intra net migration & routing. 6 - Verify inter net routing. 7 - Verify module definition port count.

Definition at line 124 of file ModuleTransformerUnitTest.cpp.

125  {
126  // Begin verify module definition and module instance creation
127  // Search design for sModuleDefinition
128  Design::ModuleSharedPtrIterator modIter = inDesignPtr->findModule(sModuleDefinition);
129  // Verify design has module sModuleDefinition
130  BOOST_REQUIRE(modIter != inDesignPtr->modulesEnd());
131  // Search design for sModuleInstanceName
132  Design::InstanceSharedPtrIterator instIter = inDesignPtr->findInstance(sModuleInstanceName);
133  // Verify design has sModuleInstanceName
134  BOOST_REQUIRE(instIter != inDesignPtr->instancesEnd());
135  // Get a pointer to the module definition
136  ModuleSharedPtr modPtr = *modIter;
137  // Get a pointer to the module instance
138  InstanceSharedPtr instPtr = *instIter;
139  // Verify placement
140  if(!inKeepPlacement) {
141  // Verify module instance is not placed
142  BOOST_REQUIRE_EQUAL(instPtr->getTile().compare(""), 0);
143  BOOST_REQUIRE_EQUAL(instPtr->getSite().compare(""), 0);
144  }
145  // End verify module definition and module instance creation
146 
147  // Begin verify instance migration and placement
148  // Get a begin iterator to inInstanceVector
149  Design::InstanceSharedPtrConstIterator inInstanceVectorBegin = inInstanceVector.begin();
150  // Get an end iterator to inInstanceVector
151  Design::InstanceSharedPtrConstIterator inInstanceVectorEnd = inInstanceVector.end();
152  // Iterate over all instances in inInstanceVector
153  while(inInstanceVectorBegin != inInstanceVectorEnd) {
154  // Get a pointer to the current instance
155  InstanceSharedPtr instPtr = *inInstanceVectorBegin;
156  // Search design for instance
157  instIter = inDesignPtr->findInstance(instPtr->getName());
158  // Verify design does not have instance
159  BOOST_REQUIRE(instIter == inDesignPtr->instancesEnd());
160  // Search module definition for instance
161  instIter = modPtr->findInstance(instPtr->getName());
162  // Verify module definition has instance
163  BOOST_REQUIRE(instIter != modPtr->instancesEnd());
164  // Get a pointer to the looked up instance
165  InstanceSharedPtr modInstPtr = *instIter;
166  // Verify placement
167  if(!inKeepPlacement) {
168  // Verify instance is not placed
169  BOOST_REQUIRE_EQUAL(modInstPtr->getTile().compare(""), 0);
170  BOOST_REQUIRE_EQUAL(modInstPtr->getSite().compare(""), 0);
171  }
172  // Move to next instance
173  inInstanceVectorBegin++;
174  }
175  // End verify instance migration and placement
176 
177  // Begin verify intra net migration and routing
178  // Get a begin iterator to module nets
179  Design::NetSharedPtrIterator moduleNetsBegin = modPtr->netsBegin();
180  // Get an end iterator to module nets
181  Design::NetSharedPtrIterator moduleNetsEnd = modPtr->netsEnd();
182  // Iterate over all module nets
183  while(moduleNetsBegin != moduleNetsEnd) {
184  // Get a pointer to the current net
185  NetSharedPtr moduleNetPtr = *moduleNetsBegin;
186  // Verify routing
187  if(!inKeepRouting) {
188  BOOST_REQUIRE(moduleNetPtr->pipsBegin() == moduleNetPtr->pipsEnd());
189  }
190  // Search for net in design
191  Design::NetSharedPtrIterator designNetItr = inDesignPtr->findNet(moduleNetPtr->getName());
192  // Verify net does not exist in design
193  BOOST_REQUIRE(designNetItr == inDesignPtr->netsEnd());
194  // Move to next net
195  moduleNetsBegin++;
196  }
197  // End verify intra net migration and routing
198 
199  // Begin verify module port count and inter net routing
200  // Initialize port count
201  u_int32_t portCount = 0;
202  // Search design for sModuleInstanceName
203  instIter = inDesignPtr->findInstance(sModuleInstanceName);
204  // Get a pointer to the module instance
205  instPtr = *instIter;
206  // Get a begin iterator to design nets
207  Design::NetSharedPtrIterator designNetsBegin = inDesignPtr->netsBegin();
208  // Get an end iterator to design nets
209  Design::NetSharedPtrIterator designNetsEnd = inDesignPtr->netsEnd();
210  // Iterate over all design nets
211  while(designNetsBegin != designNetsEnd) {
212  // Get a pointer to the current net
213  NetSharedPtr designNetPtr = *designNetsBegin;
214  // Get a begin iterator to net sources
215  Net::InstancePinSharedPtrIterator designNetSourcesBegin = designNetPtr->sourcesBegin();
216  // Get an end iterator to net sources
217  Net::InstancePinSharedPtrIterator designNetSourcesEnd = designNetPtr->sourcesEnd();
218  // Iterate over all net source
219  while(designNetSourcesBegin != designNetSourcesEnd) {
220  // Get a pointer to the current net source pin
221  InstancePinSharedPtr instPinPtr = *designNetSourcesBegin;
222  // Get a pointer to the instance hosting the net source pin
223  InstanceSharedPtr pinInstPtr = instPinPtr->getInstancePtr().lock();
224  // Is this the module instance?
225  if(pinInstPtr == instPtr) {
226  // Verify routing
227  if(!inKeepRouting) {
228  BOOST_REQUIRE(designNetPtr->pipsBegin() == designNetPtr->pipsEnd());
229  }
230  portCount++;
231  }
232  // Move to next source
233  designNetSourcesBegin++;
234  }
235  // Get a begin iterator to net sinks
236  Net::InstancePinSharedPtrIterator designNetSinksBegin = designNetPtr->sinksBegin();
237  // Get an end iterator to net sinks
238  Net::InstancePinSharedPtrIterator designNetSinksEnd = designNetPtr->sinksEnd();
239  // Iterate over all net source
240  while(designNetSinksBegin != designNetSinksEnd) {
241  // Get a pointer to the current net source pin
242  InstancePinSharedPtr instPinPtr = *designNetSinksBegin;
243  // Get a pointer to the instance hosting the net source pin
244  InstanceSharedPtr pinInstPtr = instPinPtr->getInstancePtr().lock();
245  // Is this the module instance?
246  if(pinInstPtr == instPtr) {
247  // Verify routing
248  if(!inKeepRouting) {
249  BOOST_REQUIRE(designNetPtr->pipsBegin() == designNetPtr->pipsEnd());
250  }
251  portCount++;
252  }
253  // Move to next sink
254  designNetSinksBegin++;
255  }
256  // Move to next net
257  designNetsBegin++;
258  }
259 
260  // Verify that module definition has portCount ports
261  BOOST_REQUIRE_EQUAL(modPtr->getPortCount(), portCount);
262  // End verify module port count and inter net routing
263 }
boost::shared_ptr< Instance > InstanceSharedPtr
static const string sModuleDefinition
static const string sModuleInstanceName
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Definition: Module.hpp:114
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.

+ Here is the caller graph for this function:

void torc::physical::preFlatteningVerifications ( DesignSharedPtr  inDesignPtr)

Perform pre-flattening tests on a design.

Parameters
inDesignPtrThe design shared pointer.

The pre-flattening tests consist of the following: 1 - Verify module definition exists in design. 2 - Verify module instance exists in design.

Definition at line 270 of file ModuleTransformerUnitTest.cpp.

270  {
271  // Search design for sModuleDefinition
272  Design::ModuleSharedPtrIterator modIter = inDesignPtr->findModule(sModuleDefinition);
273  // Verify design has module sModuleDefinition
274  BOOST_REQUIRE(modIter != inDesignPtr->modulesEnd());
275  // Search design for sModuleInstanceName
276  Design::InstanceSharedPtrIterator instIter = inDesignPtr->findInstance(sModuleInstanceName);
277  // Verify design has sModuleInstanceName
278  BOOST_REQUIRE(instIter != inDesignPtr->instancesEnd());
279 }
static const string sModuleDefinition
static const string sModuleInstanceName

+ Here is the caller graph for this function:

void torc::physical::preModularizationVerifications ( DesignSharedPtr  inDesignPtr)

Perform pre-modularization tests on a design.

Parameters
inDesignPtrThe design shared pointer.

The pre-modularization tests consist of the following: 1 - Verify module definition does not exist in design. 2 - Verify module instance does not exist in design.

Definition at line 100 of file ModuleTransformerUnitTest.cpp.

100  {
101  // Search design for sModuleDefinition
102  Design::ModuleSharedPtrIterator modIter = inDesignPtr->findModule(sModuleDefinition);
103  // Verify design does not have module sModuleDefinition
104  BOOST_REQUIRE(modIter == inDesignPtr->modulesEnd());
105  // Search design for sModuleInstanceName
106  Design::InstanceSharedPtrIterator instIter = inDesignPtr->findInstance(sModuleInstanceName);
107  // Verify design does not have sModuleInstanceName
108  BOOST_REQUIRE(instIter == inDesignPtr->instancesEnd());
109 }
static const string sModuleDefinition
static const string sModuleInstanceName

+ Here is the caller graph for this function:

DesignSharedPtr torc::physical::verifyDesignOpenedSuccessfully ( const string &  inDesignFileName)

Verify that the design file opened successfully.

Parameters
inDesignFileNameThe design file name.

Definition at line 53 of file ModuleTransformerUnitTest.cpp.

53  {
54  // Design shared pointer
55  DesignSharedPtr designPtr;
56  // Create the appropriate file paths
57  boost::filesystem::path physicalPath =
58  torc::common::DirectoryTree::getExecutablePath() / "torc" / "physical";
59  // Original xdl
60  boost::filesystem::path originalPath = physicalPath / inDesignFileName;
61  // Import the XDL design
62  std::fstream fileStream(originalPath.string().c_str());
63  // Verify the file is good
64  BOOST_REQUIRE(fileStream.good());
65  // Import the xdl design
66  XdlImporter importer;
67  importer(fileStream, originalPath.string());
68  // Get a pointer to the design
69  designPtr = importer.getDesignPtr();
70  // Verify the design pointer
71  BOOST_REQUIRE(designPtr.get() != 0);
72  return designPtr;
73 }
DesignSharedPtr getDesignPtr(void)
Returns a shared pointer for the design.
boost::shared_ptr< Design > DesignSharedPtr
Architecture aware importer from XDL format into a physical design.
boost::filesystem::path path
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const char torc::physical::delimiters[] = " \n\t\f"
static

Definition at line 24 of file ParsePrimitive.cpp.

const string torc::physical::elementNames = "SRUSED REVUSED PRECYINIT DUSED CUSED COUTUSED CEUSED BUSED AUSED DCY0 CCY0 BCY0 ACY0 END"

Definition at line 32 of file XdlUnpack.hpp.

const string torc::physical::extraInvNames = "CLKINV T1INV T2INV D1INV D2INV END"

Definition at line 38 of file XdlUnpack.hpp.

const string torc::physical::extraMuxNames = "CY0G CY0F GYMUX DYMUX FXMUX DXMUX CYINIT DIG_MUX DIF_MUX XBMUX DOUTMUX COUTMUX BOUTMUX AOUTMUX DFFMUX CFFMUX BFFMUX AFFMUX ACY0 BCY0 CCY0 DCY0 PRECYINIT CDI1MUX BDI1MUX ADI1MUX WEMUX TMUX OMUX IDELMUX D2OBYP_SEL IFFDELMUX IFFMUX END"

Definition at line 35 of file XdlUnpack.hpp.

const string torc::physical::sHierarchySeparator = "/"
static

Definition at line 39 of file ModuleTransformerUnitTest.cpp.

const string torc::physical::sInstanceOneName = "c1"
static

Definition at line 35 of file ModuleTransformerUnitTest.cpp.

const string torc::physical::sInstanceTwoName = "c2"
static

Definition at line 36 of file ModuleTransformerUnitTest.cpp.

const string torc::physical::sModuleDefinition = "aModule"
static

Definition at line 37 of file ModuleTransformerUnitTest.cpp.

const string torc::physical::sModuleInstanceName = "aModuleInstance"
static

Definition at line 38 of file ModuleTransformerUnitTest.cpp.