|
degate 0.1.1
|
Representation of a via that interconnects layers of a chip. More...
#include <Via.h>

Public Types | |
| enum | DIRECTION { DIRECTION_UNDEFINED = 0, DIRECTION_UP = 1, DIRECTION_DOWN = 2 } |
| An enum to indicate, which layer is connected. More... | |
Public Member Functions | |
| Via (int _x, int _y, diameter_t _diameter, DIRECTION _direction=DIRECTION_UNDEFINED) | |
| Constructor for a via object. | |
| virtual | ~Via () |
| Destructor for a via object. | |
| virtual DIRECTION | get_direction () const |
| Get direction. | |
| virtual void | set_direction (DIRECTION dir) |
| Set direction. | |
| virtual const std::string | get_direction_as_string () const |
| Get the direction as a human readable string. | |
| virtual const std::string | get_descriptive_identifier () const |
| Get a human readable string that describes the whole logic model object. | |
| virtual const std::string | get_object_type_name () const |
| Get a human readable string that names the object type. | |
| void | print (std::ostream &os, int n_tabs) const |
| Print the object. | |
| void | shift_x (int delta_x) |
| Shift the shape vertically. | |
| void | shift_y (int delta_y) |
| Shift the shape horizontally. | |
| void | set_x (int x) |
| void | set_y (int y) |
| void | set_diameter (unsigned int diameter) |
| virtual bool | in_bounding_box (BoundingBox const &bbox) const |
| Check if this shape is in the bounding box. | |
| virtual BoundingBox const & | get_bounding_box () const |
| Get the bounding box. | |
| virtual bool | in_shape (int x, int y, int max_distance=0) const |
| Check in the Point with coordinates x and y is within the area of the shape. | |
Static Public Member Functions | |
| static Via::DIRECTION | get_via_direction_from_string (std::string const &via_direction_str) |
| Parse a via direction string and return it as enum value. | |
Protected Member Functions | |
| virtual object_id_t | push_object_to_server (std::string const &server_url) |
Private Attributes | |
| DIRECTION | direction |
An enum to indicate, which layer is connected.
Vias are placed on a layer. If the via connects an object from the current layer to a layer that is above, then the direction is up.
Definition at line 55 of file Via.h.
{
DIRECTION_UNDEFINED = 0,
DIRECTION_UP = 1,
DIRECTION_DOWN = 2
};
| Via::Via | ( | int | _x, |
| int | _y, | ||
| diameter_t | _diameter, | ||
| Via::DIRECTION | _direction = DIRECTION_UNDEFINED |
||
| ) |
| virtual BoundingBox const& degate::Via::get_bounding_box | ( | ) | const [inline, virtual] |
Get the bounding box.
Reimplemented from degate::Circle.
Definition at line 137 of file Via.h.
Referenced by print().
{
return Circle::get_bounding_box();
}

| const std::string Via::get_descriptive_identifier | ( | ) | const [virtual] |
Get a human readable string that describes the whole logic model object.
The string should be unique in order to let the user identify the concrete object. But that is not a must.
Reimplemented from degate::LogicModelObjectBase.
Definition at line 60 of file Via.cc.
References degate::LogicModelObjectBase::get_name(), degate::LogicModelObjectBase::get_object_id(), and degate::LogicModelObjectBase::has_name().
{
if(has_name()) {
boost::format fmter("via %1% (%2%)");
fmter % get_name() % get_object_id();
return fmter.str();
}
else {
boost::format fmter("via (%1%)");
fmter % get_object_id();
return fmter.str();
}
}

| Via::DIRECTION Via::get_direction | ( | ) | const [virtual] |
| const std::string Via::get_direction_as_string | ( | ) | const [virtual] |
Get the direction as a human readable string.
Definition at line 43 of file Via.cc.
References direction, DIRECTION_DOWN, DIRECTION_UNDEFINED, and DIRECTION_UP.
Referenced by push_object_to_server().
{
switch(direction) {
case DIRECTION_UP: return std::string("up");
case DIRECTION_DOWN: return std::string("down");
case DIRECTION_UNDEFINED:
default: return std::string("undefined");
}
}

| const std::string Via::get_object_type_name | ( | ) | const [virtual] |
Get a human readable string that names the object type.
Here it is "Via".
Reimplemented from degate::LogicModelObjectBase.
Definition at line 73 of file Via.cc.
{
return std::string("Via");
}
| Via::DIRECTION Via::get_via_direction_from_string | ( | std::string const & | via_direction_str | ) | [static] |
Parse a via direction string and return it as enum value.
Definition at line 52 of file Via.cc.
References DIRECTION_DOWN, DIRECTION_UNDEFINED, and DIRECTION_UP.
Referenced by degate::process_changelog_command().
{
if(via_direction_str == "up") return Via::DIRECTION_UP;
else if(via_direction_str == "down") return Via::DIRECTION_DOWN;
else if(via_direction_str == "undefined") return Via::DIRECTION_UNDEFINED;
else throw DegateRuntimeException("Can't parse via direction type.");
}

| virtual bool degate::Via::in_bounding_box | ( | BoundingBox const & | bbox | ) | const [inline, virtual] |
Check if this shape is in the bounding box.
Note: it is somhow unclear if this 'in' means complete within or if an intersection is sufficient.
Reimplemented from degate::Circle.
Definition at line 133 of file Via.h.
{
return Circle::in_bounding_box(bbox);
}
| virtual bool degate::Via::in_shape | ( | int | x, |
| int | y, | ||
| int | max_distance = 0 |
||
| ) | const [inline, virtual] |
Check in the Point with coordinates x and y is within the area of the shape.
Reimplemented from degate::Circle.
Definition at line 141 of file Via.h.
{
return Circle::in_shape(x, y, max_distance);
}
| void Via::print | ( | std::ostream & | os, |
| int | n_tabs | ||
| ) | const [virtual] |
Print the object.
Implements degate::PlacedLogicModelObject.
Definition at line 78 of file Via.cc.
References degate::gen_tabs(), get_bounding_box(), degate::LogicModelObjectBase::get_name(), degate::LogicModelObjectBase::get_object_id(), degate::Circle::get_x(), degate::Circle::get_y(), and degate::BoundingBox::to_string().
{
os
<< gen_tabs(n_tabs) << "Via name : " << get_name() << std::endl
<< gen_tabs(n_tabs) << "Object ID : " << get_object_id() << std::endl
<< gen_tabs(n_tabs) << "Via position : " << get_x() << " / " << get_y() << std::endl
<< gen_tabs(n_tabs) << "Bounding box : " << Circle::get_bounding_box().to_string() << std::endl
<< std::endl;
;
}

| object_id_t Via::push_object_to_server | ( | std::string const & | server_url | ) | [protected, virtual] |
Implements degate::RemoteObject.
Definition at line 120 of file Via.cc.
References degate::Circle::get_diameter(), get_direction_as_string(), degate::PlacedLogicModelObject::get_layer(), degate::Circle::get_x(), degate::Circle::get_y(), degate::PlacedLogicModelObject::layer, degate::remote_method_call(), and degate::RemoteObject::set_remote_object_id().
{
try {
xmlrpc_c::paramList params;
params.add(xmlrpc_c::value_string("add"));
params.add(xmlrpc_c::value_string("via"));
Layer_shptr layer = get_layer();
assert(layer != NULL);
params.add(xmlrpc_c::value_int(layer->get_layer_id()));
params.add(xmlrpc_c::value_int(get_x()));
params.add(xmlrpc_c::value_int(get_y()));
params.add(xmlrpc_c::value_int(get_diameter()));
params.add(xmlrpc_c::value_string(get_direction_as_string()));
int const transaction_id =
xmlrpc_c::value_int(remote_method_call(server_url, "degate.push", params));
set_remote_object_id(transaction_id);
std::cout << "Pushed via to server. remote id is: " << transaction_id << std::endl;
return transaction_id;
}
catch(std::exception const& e) {
std::cerr << "Client threw error: " << e.what() << std::endl;
throw XMLRPCException(e.what());
}
catch(...) {
std::cerr << "Client threw unexpected error." << std::endl;
throw XMLRPCException("Client threw unexpected error.");
}
}

| void Via::set_diameter | ( | unsigned int | diameter | ) | [virtual] |
Reimplemented from degate::Circle.
Definition at line 114 of file Via.cc.
References degate::PlacedLogicModelObject::notify_shape_change().

| void Via::set_direction | ( | Via::DIRECTION | dir | ) | [virtual] |
| void Via::set_x | ( | int | x | ) | [virtual] |
Reimplemented from degate::Circle.
Definition at line 104 of file Via.cc.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Circle::set_x(x);
notify_shape_change();
}

| void Via::set_y | ( | int | y | ) | [virtual] |
Reimplemented from degate::Circle.
Definition at line 109 of file Via.cc.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Circle::set_y(y);
notify_shape_change();
}

| void Via::shift_x | ( | int | delta_x | ) | [virtual] |
Shift the shape vertically.
Note: If you store this shape in a QuadTree, you have to manage the changes in your QuadTree by yourself.
Reimplemented from degate::Circle.
Definition at line 94 of file Via.cc.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Circle::shift_x(delta_x);
notify_shape_change();
}

| void Via::shift_y | ( | int | delta_y | ) | [virtual] |
Shift the shape horizontally.
Note: If you store this shape in a QuadTree, you have to manage the changes in your QuadTree by yourself.
Reimplemented from degate::Circle.
Definition at line 99 of file Via.cc.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Circle::shift_y(delta_y);
notify_shape_change();
}

DIRECTION degate::Via::direction [private] |
Definition at line 63 of file Via.h.
Referenced by get_direction(), get_direction_as_string(), and set_direction().
1.7.4