ROOM » Core » C++ Classes » Instance
Instance Class
Placement of a child cell. Equivalent to a GDS SREF. Moreā¦
| Header: | #include "instance.h" |
|---|---|
| CMake: | target_link_libraries(mytarget PRIVATE ROOM::room) |
Public Functions
| Instance(std::string cellName, Transform transform) | Constructs a placement of a child cell at the given transform. |
| const std::string & cellName() const | Returns the name of the referenced cell. |
| Transform & transform() | Returns the placement transform for modification. |
| const Transform & transform() const | Returns the placement transform for read-only access. |
| std::vector<Property> & properties() | Returns instance metadata for modification. |
| const std::vector<Property> & properties() const | Returns instance metadata for read-only access. |
Detailed Description
Member Function Documentation
Instance(std::string cellName, Transform transform)
Constructs a placement of a child cell at the given transform.
| Parameter | Description |
|---|---|
cellName | Name of the referenced cell in the same Lib (must match an existing or future cell name). |
transform | Offset (x, y in DBU), orientation, and magnification. |
const std::string & cellName() const
Returns the name of the referenced cell.
Returns: Cell name string (not resolved to a Cell object).
Transform & transform()
Returns the placement transform for modification.
Returns: Mutable reference to offset, orientation, and scale.
const Transform & transform() const
Returns the placement transform for read-only access.
Returns: Const reference to the transform.
std::vector<Property> & properties()
Returns instance metadata for modification.
Returns: Mutable reference to name/value properties.
const std::vector<Property> & properties() const
Returns instance metadata for read-only access.
Returns: Const reference to instance properties.
Example
room::Transform xf;
xf.x = 2000;
xf.y = 2000;
xf.orient = room::Orient::R90;
xf.mag = 1.0;
block.instances().emplace_back("INV", xf);
for (const room::Instance & inst : block.instances()) {
std::cout << inst.cellName()
<< " at " << inst.transform().x
<< "," << inst.transform().y << "\n";
}