Skip to content

Commit

Permalink
Documenting physical design
Browse files Browse the repository at this point in the history
  • Loading branch information
jucemarmonteiro committed Apr 1, 2017
1 parent a10ec74 commit 8a2400e
Show file tree
Hide file tree
Showing 11 changed files with 190 additions and 171 deletions.
4 changes: 1 addition & 3 deletions rsyn/src/rsyn/gui/frame/MainFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ class SaveSnapshot : public SaveSnapshotBase {
m_spinCtrl2->SetValue(canvas->GetSize().x);
m_spinCtrl3->SetValue(canvas->GetSize().y);
}

setDimensions(canvas->GetSize().x, canvas->GetSize().y);
} // end method

//--------------------------------------------------------------------------
Expand All @@ -281,7 +279,7 @@ class SaveSnapshot : public SaveSnapshotBase {
if( !m_checkBox7->IsChecked() )
return;

const float width = m_spinCtrl2->GetValue();
const int width = m_spinCtrl2->GetValue();

m_spinCtrl3->SetValue( (int) (width / ratioWH) );
}; // end method
Expand Down
9 changes: 3 additions & 6 deletions rsyn/src/rsyn/phy/obj/data/PhysicalSiteData.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ namespace Rsyn {

class PhysicalSiteData : public PhysicalObject {
public:
Rsyn::PhysicalSiteClass clsSiteClass;
Rsyn::PhysicalSiteClass clsSiteClass = INVALID_SITECLASS;
DBUxy clsSize;
std::string clsSiteName;
PhysicalSiteData() {
clsSiteClass = INVALID_SITECLASS;
clsSiteName = Rsyn::getPhysicalInvalidName();
}
std::string clsSiteName = Rsyn::getPhysicalInvalidName();
PhysicalSiteData()=default;
}; // end namespace

} // end namespace
Expand Down
6 changes: 2 additions & 4 deletions rsyn/src/rsyn/phy/obj/data/PhysicalSpacingData.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ class PhysicalSpacingData : public PhysicalObject {
public:
PhysicalLayer clsLayer1;
PhysicalLayer clsLayer2;
DBU clsDistance;
PhysicalSpacingData() {
clsDistance = 0;
} // end constructor
DBU clsDistance = 0;
PhysicalSpacingData()=default;
}; // end class

} // end namespace
Expand Down
19 changes: 11 additions & 8 deletions rsyn/src/rsyn/phy/util/BookshelfDscp.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

// -----------------------------------------------------------------------------

//! Row descriptor of the Bookshelf format
class BookshelfRow {
public:
std::string clsDirection;
Expand All @@ -47,31 +48,34 @@ class BookshelfRow {
std::string clsSiteSymmetry;
int clsSubRowOrigin;
int clsNumSites;
BookshelfRow()=default;
}; // end class

// -----------------------------------------------------------------------------

//! Pin descriptor of the Bookshelf format
class BookshelfPin {
public:
std::string clsNodeName;
std::string clsDirection;
double2 clsDisplacement;
BookshelfPin()=default;
}; // end class

// -----------------------------------------------------------------------------

//! Net descriptor of the Bookshelf format
class BookshelfNet {
public:
bool clsHasName;
bool clsHasName = false;
std::string clsName;
std::vector<BookshelfPin> clsPins;
BookshelfNet() {
clsHasName = false;
} // end constructor
BookshelfNet()=default;
}; // end class

// -----------------------------------------------------------------------------

//! Node descriptor of the Bookshelf format
class BookshelfNode {
public:
std::string clsName;
Expand All @@ -90,18 +94,17 @@ class BookshelfNode {

// -----------------------------------------------------------------------------

//! Bookshelf descriptor.
class BookshelfDscp {
public:
int clsNumPins;
int clsNumPins = 0;
std::string clsDesignName;
std::vector<BookshelfRow> clsRows;
std::vector<BookshelfNet> clsNets;
std::vector<BookshelfNode> clsNodes;
std::unordered_map<std::string, int> clsMapNets;
std::unordered_map<std::string, int> clsMapNodes;
BookshelfDscp() {
clsNumPins = 0;
} // end constructor
BookshelfDscp()=default;
}; // end class

// -----------------------------------------------------------------------------
Expand Down
11 changes: 0 additions & 11 deletions rsyn/src/rsyn/phy/util/BookshelfMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@

#include <iostream>

BookshelfMapper::BookshelfMapper() {
// using the first design units resolution
clsDesignUnits = 100;
clsNumComponents = 0;
} // end constructor

// -----------------------------------------------------------------------------

BookshelfMapper::~BookshelfMapper() {
} // end destructor

// -----------------------------------------------------------------------------

// the order which methods are called is mandatory to keep, due to dependence of mapping result between methods.
Expand Down
29 changes: 24 additions & 5 deletions rsyn/src/rsyn/phy/util/BookshelfMapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,25 @@
#include "rsyn/core/Rsyn.h"

#include <unordered_map>

//! Mapper of bookshelf circuit description to LEF/DEF formats.
class BookshelfMapper {
protected:
std::unordered_map<std::string, int> clsMapNodeToMacros;
DoubleRectangle clsDieBounds;
//! Associating bookshelf net to its pins.
struct Net {
std::string name;
std::vector<int> pins;
};
//! Recovering bookshelf pin data
struct Pin {
std::string clsNode;
std::string clsNet;
std::string clsDirection;
double2 displ;
std::string clsName;
};
//! Associating bookshelf macro to its pins.
struct Macro {
std::string clsName;
std::vector<int> pins;
Expand All @@ -60,22 +63,38 @@ class BookshelfMapper {
std::vector<Pin> pins;
std::vector<Net> nets;
std::unordered_map<std::string, int> mapNets;
int clsDesignUnits;
int clsNumComponents;
int clsDesignUnits = 100;
int clsNumComponents = 0;
public:
BookshelfMapper();
virtual ~BookshelfMapper();
//! @brief Default C++11 constructor
BookshelfMapper()=default;
//! @brief Default C++11 destructor
virtual ~BookshelfMapper()=default;
//! @brief Converting bookshelf description into LEF/DEF formats.
void mapLefDef(const BookshelfDscp & bookshelf, LefDscp & lef, DefDscp & def);
//! @brief Populates Rsyn design from bookshelf format.
void populateRsyn(const BookshelfDscp & dscp, LefDscp & lef, DefDscp & def, Rsyn::Design design);
protected:
//! @brief Generates synthetic net name for the circuits with nets not named.
void updateNets(const BookshelfDscp & dscp);
//! @brief Associating pin names to nodes and nets.
void updateNodePins(const BookshelfDscp & dscp);
//! @brief Generates a synthetic LEF header.
void mapLefHeader(LefDscp & lef);
//! @brief Generates a site used in rows.
//! @warning Assuming all the rows in bookshelf have the same site.
void mapLefSites(const BookshelfDscp & dscp, LefDscp & lef);
//! @brief Generates Library cells to LEF from bookshelf macros.
//! @warning Each macro from Bookshelf generates a LEF library cell.
//! @todo Creates common LEF library cells from bookshelf macros.
void mapLefCells(const BookshelfDscp & dscp, LefDscp & lef);
//! @brief Creates 4 layers synthetic metal data.
void createMetal(LefDscp & lef);
//! @brief Mapping Row from Bookshelf to DEF.
void mapDefRows(const BookshelfDscp & dscp, DefDscp & def);
//! @brief Generates a synthetic DEF header.
void mapDefHeader(const BookshelfDscp & dscp, DefDscp & def);
//! @brief Mapping macros from Bookshelf to DEF.
void mapDefComponents(const BookshelfDscp &dscp, DefDscp &def);
}; // end class

Expand Down
73 changes: 35 additions & 38 deletions rsyn/src/rsyn/phy/util/DefDescriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,80 +34,77 @@

static const std::string INVALID_DEF_NAME = "*<INVALID_DEF_NAME>*";

//! Descriptor for DEF rows.
class DefRowDscp {
public:
std::string clsName;
std::string clsSite;
std::string clsName = INVALID_DEF_NAME;
std::string clsSite = INVALID_DEF_NAME;
DBUxy clsOrigin;
std::string clsOrientation;
int clsNumX;
int clsNumY;
int clsStepX;
int clsStepY;
DefRowDscp() : clsName(INVALID_DEF_NAME), clsSite(INVALID_DEF_NAME),
clsOrientation(INVALID_DEF_NAME), clsNumX(0), clsNumY(0),
clsStepX(0), clsStepY(0) {}
std::string clsOrientation = INVALID_DEF_NAME;
int clsNumX = 0;
int clsNumY = 0;
int clsStepX = 0;
int clsStepY = 0;
DefRowDscp()=default;
}; // end class

// -----------------------------------------------------------------------------

//! Descriptor for DEF components
class DefComponentDscp {
public:
std::string clsName;
std::string clsMacroName;
std::string clsLocationType; // {FIXED | COVER | PLACED | UNPLACED }
std::string clsName = INVALID_DEF_NAME;
std::string clsMacroName = INVALID_DEF_NAME;
std::string clsLocationType = INVALID_DEF_NAME; // {FIXED | COVER | PLACED | UNPLACED }
DBUxy clsPos;
std::string clsOrientation;
bool clsIsFixed;
bool clsIsPlaced;
DefComponentDscp() : clsName(INVALID_DEF_NAME), clsMacroName(INVALID_DEF_NAME),
clsLocationType(INVALID_DEF_NAME), clsOrientation(INVALID_DEF_NAME),
clsIsFixed(false), clsIsPlaced(false) {}
std::string clsOrientation = INVALID_DEF_NAME;
bool clsIsFixed = false;
bool clsIsPlaced = false;
DefComponentDscp()=default;
}; // end class

// -----------------------------------------------------------------------------

//! Descriptor for DEF ports
class DefPortDscp {
public:
std::string clsName;
std::string clsNetName;
std::string clsDirection; // {INPUT | OUTPUT | INOUT | FEEDTHRU}
std::string clsLocationType; // {FIXED | COVER | PLACED }
std::string clsName = INVALID_DEF_NAME;
std::string clsNetName = INVALID_DEF_NAME;
std::string clsDirection = INVALID_DEF_NAME; // {INPUT | OUTPUT | INOUT | FEEDTHRU}
std::string clsLocationType = INVALID_DEF_NAME; // {FIXED | COVER | PLACED }
DBUxy clsPos;
DBUxy clsICCADPos;
std::string clsOrientation;
std::string clsLayerName;
std::string clsOrientation = INVALID_DEF_NAME;
std::string clsLayerName = INVALID_DEF_NAME;
Bounds clsLayerBounds;
DefPortDscp() : clsName(INVALID_DEF_NAME), clsNetName(INVALID_DEF_NAME),
clsDirection(INVALID_DEF_NAME), clsLocationType(INVALID_DEF_NAME),
clsOrientation(INVALID_DEF_NAME), clsLayerName(INVALID_DEF_NAME) {}
DefPortDscp()=default;
}; // end class

// -----------------------------------------------------------------------------

//! Descriptor for DEF Nets
class DefNetDscp {
public:
std::string clsName;
DefNetDscp() : clsName(INVALID_DEF_NAME) {}
std::string clsName = INVALID_DEF_NAME;
DefNetDscp()=default;
}; // end class

// -----------------------------------------------------------------------------

//! Descriptor for DEF Design
class DefDscp {
public:
double clsVersion;
std::string clsDeviderChar;
std::string clsBusBitChars;
std::string clsDesignName;
double clsVersion = 0.0;
std::string clsDeviderChar = INVALID_DEF_NAME;
std::string clsBusBitChars = INVALID_DEF_NAME;
std::string clsDesignName = INVALID_DEF_NAME;
Bounds clsDieBounds;
int clsDatabaseUnits;
int clsDatabaseUnits = 0;
std::vector<DefRowDscp> clsRows;
std::vector<DefComponentDscp> clsComps;
std::vector<DefPortDscp> clsPorts;
std::vector<DefNetDscp> clsNets;
DefDscp() : clsVersion(0.0), clsDeviderChar(INVALID_DEF_NAME),
clsBusBitChars(INVALID_DEF_NAME), clsDesignName(INVALID_DEF_NAME),
clsDatabaseUnits(0) {}
DefDscp()=default;
}; // end class

// -----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 8a2400e

Please sign in to comment.