Permalink
Browse files

Added support for routing point extensions.

  • Loading branch information...
gaflach committed Dec 26, 2017
1 parent 50fcd61 commit 39d8044dcc9dee6ec368b7448924786467e6b232
@@ -1425,14 +1425,19 @@ void PhysicalCanvasGL::populateGeometryManager() {
for (Rsyn::PhysicalWire phWire : phNet.allWires()) {
for (Rsyn::PhysicalWireSegment phWireSegment : phWire.allSegments()) {
const int numRoutingPoint = phWireSegment.getNumRoutingPoints();
const std::vector<Rsyn::PhysicalRoutingPoint> & routingPts = phWireSegment.allRoutingPoints();
if (phWireSegment.getNumRoutingPoints() > 1) {
if (numRoutingPoint >= 2) {
std::vector<DBUxy> points;
points.reserve(routingPts.size());
for (Rsyn::PhysicalRoutingPoint phRoutingPt : routingPts) {
points.push_back(phRoutingPt.getPosition());
} // end for
points.reserve(numRoutingPoint);
points.push_back(phWireSegment.getSourcePosition());
for (int i = 1; i < numRoutingPoint - 1; i++) {
points.push_back(routingPts[i].getPosition());
} // end for
points.push_back(phWireSegment.getTargetPosition());
Rsyn::PhysicalLayer phLayer = phWireSegment.getLayer();
const DBU width = phLayer.getWidth();
const GeometryManager::LayerId layerId =
@@ -35,10 +35,12 @@ class PhysicalWireSegmentData {
public:
Rsyn::PhysicalLayer clsPhysicalLayer;
std::vector<PhysicalRoutingPoint> clsRoutingPoints;
DBUxy clsSourcePosition;
DBUxy clsTargetPosition;
DBU clsRoutedWidth = 0;
bool clsNew : 1;
PhysicalWireSegmentData() {
PhysicalWireSegmentData() : clsSourcePosition(0, 0), clsTargetPosition(0, 0) {
clsNew = false;
} // end constructor
}; // end class
@@ -13,19 +13,6 @@
* limitations under the License.
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: PhysicalDesign.h
* Author: jucemar
*
* Created on 12 de Setembro de 2016, 20:05
*/
#ifndef PHYSICALDESIGN_PHYSICALDESIGN_H
#define PHYSICALDESIGN_PHYSICALDESIGN_H
@@ -299,6 +286,9 @@ class PhysicalDesign : public Proxy<PhysicalDesignData> {
//! @warning works only for rectangles
void mergeBounds(const std::vector<Bounds> & source, std::vector<Bounds> & target, const Dimension dim = X);
//! @brief Returns the extended position of a point in a wire segment.
DBUxy getExtendedPosition(const DBUxy p0, const DBUxy p1, const DBU extension) const;
private:
//! @brief Returns the Rsyn::PhysicalRow unique identifier.
PhysicalIndex getId(Rsyn::PhysicalRow phRow) const;
@@ -309,6 +299,10 @@ class PhysicalDesign : public Proxy<PhysicalDesignData> {
//! @brief Returns the Rsyn::PhysicalSpacing unique identifier.
PhysicalIndex getId(Rsyn::PhysicalSpacing spacing) const;
//! @brief Post-processing for wire segments. Currently it sets the start
//! and end point positions for segments taking into account extensions.
void postProcessWireSegment(Rsyn::PhysicalWireSegment phWireSegment);
public:
//! @details Creates the physical object to handle the physical object extensions.
//! The extension maps the physical object to a null reference.
@@ -66,6 +66,27 @@ class PhysicalRoutingPoint : public Proxy<PhysicalRoutingPointData> {
bool hasVia() const;
}; // end class
// -----------------------------------------------------------------------------
class PhysicalRoutingPointPair {
friend class PhysicalWireSegment;
public:
PhysicalRoutingPoint getSource() const {return clsSourcePoint;}
PhysicalRoutingPoint getTarget() const {return clsTargetPoint;}
DBUxy getExtendedSourcePosition() const {return clsExtendedSourcePosition;}
DBUxy getExtendedTargetPosition() const {return clsExtendedTargetPosition;}
private:
PhysicalRoutingPoint clsSourcePoint;
PhysicalRoutingPoint clsTargetPoint;
DBUxy clsExtendedSourcePosition;
DBUxy clsExtendedTargetPosition;
}; // end class
} // end namespace
#endif /* PHYSICALDESIGN_PHYSICALROUTINGPOINT_H */
@@ -34,6 +34,14 @@ class PhysicalWireSegment : public Proxy<PhysicalWireSegmentData> {
PhysicalWireSegment(std::nullptr_t) : Proxy(nullptr) {
}
//! @brief Returns the start point of this wire segment taking into account
//! routing point extension.
DBUxy getSourcePosition() const;
//! @brief Returns the end point of this wire segment taking into account
//! routing point extension.
DBUxy getTargetPosition() const;
//! @brief Returns routed wire width segment. It is valid only for special nets.
//! @warning Regular wire segments must get wire width from layer.
DBU getRoutedWidth() const;
@@ -44,7 +52,7 @@ class PhysicalWireSegment : public Proxy<PhysicalWireSegmentData> {
//! @brief Returns number of points in segment (clsPoints.size())
const std::size_t getNumRoutingPoints() const;
const std::vector<PhysicalRoutingPoint> & allRoutingPoints() const;
}; // end class
} // end namespace
@@ -652,9 +652,11 @@ void PhysicalDesign::addPhysicalNet(const DefNetDscp & netDscp) {
if (routingPoint.clsHasRectangle) {
phPoint->clsRectangle = routingPoint.clsRect;
phPoint->clsHasRectangle = true;
} // end if
} // end for
} // end for
} // end if
} // end for
postProcessWireSegment(phWireSegment);
} // end for
} // end for
} // end method
@@ -696,7 +698,6 @@ void PhysicalDesign::addWireSegment(const DefWireSegmentDscp & segmentDscp, Phys
PhysicalRoutingPoint phPoint = phWireSegment->clsRoutingPoints.back();
phPoint->clsExtension = routingPoint.clsExtension;
phPoint->clsPos = routingPoint.clsPos;
phPoint->clsExtension = routingPoint.clsExtension;
phPoint->clsOrientation = getPhysicalOrientation(routingPoint.clsOrientation);
if (routingPoint.clsHasVia)
phPoint->clsVia = getPhysicalViaByName(routingPoint.clsViaName);
@@ -705,7 +706,9 @@ void PhysicalDesign::addWireSegment(const DefWireSegmentDscp & segmentDscp, Phys
phPoint->clsRectangle = routingPoint.clsRect;
phPoint->clsHasRectangle = true;
} // end if
} // end for
} // end for
postProcessWireSegment(phWireSegment);
} // end method
// -----------------------------------------------------------------------------
@@ -857,4 +860,63 @@ void PhysicalDesign::mergeBounds(const std::vector<Bounds> & source,
} // end method
// -----------------------------------------------------------------------------
void PhysicalDesign::postProcessWireSegment(Rsyn::PhysicalWireSegment phWireSegment) {
const int numRoutingPoints = phWireSegment->clsRoutingPoints.size();
if (numRoutingPoints > 0) {
phWireSegment->clsSourcePosition = phWireSegment->clsRoutingPoints.front().getPosition();
phWireSegment->clsTargetPosition = phWireSegment->clsRoutingPoints.back().getPosition();
} // end if
if (numRoutingPoints >= 2) {
DBUxy p0;
DBUxy p1;
DBU extension;
p0 = phWireSegment->clsRoutingPoints[0].getPosition();
p1 = phWireSegment->clsRoutingPoints[1].getPosition();
extension = phWireSegment->clsRoutingPoints[0].getExtension();
phWireSegment->clsSourcePosition = getExtendedPosition(p0, p1, extension);
p0 = phWireSegment->clsRoutingPoints[numRoutingPoints - 1].getPosition();
p1 = phWireSegment->clsRoutingPoints[numRoutingPoints - 2].getPosition();
extension = phWireSegment->clsRoutingPoints[numRoutingPoints - 1].getExtension();
phWireSegment->clsTargetPosition = getExtendedPosition(p0, p1, extension);
} // end if
} // end method
// -----------------------------------------------------------------------------
DBUxy PhysicalDesign::getExtendedPosition(const DBUxy p0, const DBUxy p1, const DBU extension) const {
DBUxy pos = p0;
const DBUxy d = p1 - p0;
const bool horizontal = d.x != 0;
const bool vertical = d.y != 0;
if (horizontal && !vertical) {
// Horizontal
if (d.x > 0) {
// p0.x < p1.x
pos.x -= extension;
} else {
// p0.x > p1.x
pos.x += extension;
} // end else
} else if (vertical && !horizontal) {
// Vertical
if (d.y > 0) {
// p0.y < p1.y
pos.y -= extension;
} else {
// p0.y > p1.y
pos.y += extension;
} // end else
} // end else-if
return pos;
} // end method
// -----------------------------------------------------------------------------
} // end namespace
@@ -13,21 +13,19 @@
* limitations under the License.
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace Rsyn {
/*
* File: PhysicalWireSegment.h
* Author: jucemar
*
* Created on 13 de Maio de 2017, 16:01
*/
inline DBUxy PhysicalWireSegment::getSourcePosition() const {
return data->clsSourcePosition;
} // end method
// -----------------------------------------------------------------------------
namespace Rsyn {
inline DBUxy PhysicalWireSegment::getTargetPosition() const {
return data->clsTargetPosition;
} // end method
// -----------------------------------------------------------------------------
inline DBU PhysicalWireSegment::getRoutedWidth() const {
return data->clsRoutedWidth;
@@ -21,10 +21,6 @@
// name, name is the overlay label and visibility is the initial visibility
// state of the overlay.
#include "rsyn/gui/canvas/overlay/Layout.h"
#include "rsyn/gui/canvas/overlay/DensityGridOverlay.h"
#include "rsyn/gui/canvas/overlay/RoutingGuidesOverlay.h"
#include "x/gui/overlay/Jezz.h"
#include "x/gui/overlay/Abu.h"
#include "x/gui/overlay/OverlapRemoverOverlay.h"
@@ -33,13 +29,9 @@
// Overlays
namespace Rsyn {
static Startup registerOverlays([]{
MainFrame::registerOverlay<LayoutOverlay>("Layout", true);
MainFrame::registerOverlay<DensityGridOverlay>("Density Grid");
MainFrame::registerOverlay<JezzOverlay>("Jezz");
MainFrame::registerOverlay<AbuOverlay>("Abu");
MainFrame::registerOverlay<OverlapRemoverOverlay>("Macro Overlap");
MainFrame::registerOverlay<RoutingEstimatorOverlay>("Routing Estimation");
MainFrame::registerOverlay<RoutingGuidesOverlay>("Routing guide");
});
} // end namespace

0 comments on commit 39d8044

Please sign in to comment.