Skip to content

Commit

Permalink
Merge pull request #6512 from The-OpenROAD-Project-staging/odb-rm-dbT…
Browse files Browse the repository at this point in the history
…arget

odb: rm unused dbTarget
  • Loading branch information
maliberty authored Jan 13, 2025
2 parents 7cde4b1 + d1b01de commit 29fbad4
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 577 deletions.
56 changes: 0 additions & 56 deletions src/odb/include/odb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class dbSite;
class dbMaster;
class dbMTerm;
class dbMPin;
class dbTarget;
class dbGDSLib;

// Tech objects
Expand Down Expand Up @@ -5906,11 +5905,6 @@ class dbMTerm : public dbObject
///
Rect getBBox();

///
/// Get the target points of this terminal.
///
dbSet<dbTarget> getTargets();

///
/// Add antenna info that is not specific to an oxide model.
///
Expand Down Expand Up @@ -6009,56 +6003,6 @@ class dbMPin : public dbObject
static dbMPin* getMPin(dbMaster* master, uint oid);
};

///////////////////////////////////////////////////////////////////////////////
///
/// A Target is the element that represents a physical target point on a MTerm.
///
///////////////////////////////////////////////////////////////////////////////
class dbTarget : public dbObject
{
public:
///
/// Get the master this target belongs too.
///
dbMaster* getMaster();

///
/// Get the mterm this target
///
dbMTerm* getMTerm();

///
/// Get the tech-layer this target
///
dbTechLayer* getTechLayer();

///
/// Get the target point of this target.
///
Point getPoint();

///
/// Create a new master terminal.
/// Returns nullptr if a master terminal with this name already exists
///
static dbTarget* create(dbMTerm* mterm, dbTechLayer* layer, Point point);

///
/// Destroy a target
///
static void destroy(dbTarget* t);

///
/// Destroy a target
///
static dbSet<dbTarget>::iterator destroy(dbSet<dbTarget>::iterator& itr);

///
/// Translate a database-id back to a pointer.
///
static dbTarget* getTarget(dbMaster* master, uint oid);
};

///////////////////////////////////////////////////////////////////////////////
///
/// A Tech is the element that represents technology specific data.
Expand Down
9 changes: 0 additions & 9 deletions src/odb/include/odb/dbCompare.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,6 @@ struct less<odb::dbMPin*>
}
};

template <>
struct less<odb::dbTarget*>
{
bool operator()(const odb::dbTarget* lhs, const odb::dbTarget* rhs) const
{
return odb::compare_by_id(lhs, rhs);
}
};

template <>
struct less<odb::dbTech*>
{
Expand Down
1 change: 0 additions & 1 deletion src/odb/include/odb/dbObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ enum dbObjectType
dbMasterObj,
dbMPinObj,
dbMTermObj,
dbTargetObj,
dbTechAntennaPinModelObj,

// Tech Objects
Expand Down
2 changes: 0 additions & 2 deletions src/odb/src/db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ add_library(db
dbCCSegItr.cpp
dbWireShapeItr.cpp
dbWirePathItr.cpp
dbTarget.cpp
dbTargetItr.cpp
dbTechNonDefaultRule.cpp
dbTechLayerRule.cpp
dbCapNode.cpp
Expand Down
5 changes: 4 additions & 1 deletion src/odb/src/db/dbDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ namespace odb {
const uint db_schema_major = 0; // Not used...
const uint db_schema_initial = 57;

const uint db_schema_minor = 99; // Current revision number
const uint db_schema_minor = 100; // Current revision number

// Revision where dbTarget was removed
const uint db_rm_target = 100;

// Revision where mask information was added to track grids
const uint db_track_mask = 99;
Expand Down
8 changes: 0 additions & 8 deletions src/odb/src/db/dbMTerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include "dbMaster.h"
#include "dbTable.h"
#include "dbTable.hpp"
#include "dbTargetItr.h"
#include "dbTechLayerAntennaRule.h"
#include "odb/db.h"
#include "odb/lefout.h"
Expand Down Expand Up @@ -381,13 +380,6 @@ Rect dbMTerm::getBBox()
return bbox;
}

dbSet<dbTarget> dbMTerm::getTargets()
{
_dbMTerm* mterm = (_dbMTerm*) this;
_dbMaster* master = (_dbMaster*) mterm->getOwner();
return dbSet<dbTarget>(mterm, master->_target_itr);
}

void* dbMTerm::staPort()
{
_dbMTerm* mterm = (_dbMTerm*) this;
Expand Down
28 changes: 5 additions & 23 deletions src/odb/src/db/dbMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
#include "dbSite.h"
#include "dbTable.h"
#include "dbTable.hpp"
#include "dbTarget.h"
#include "dbTargetItr.h"
#include "dbTechLayerAntennaRule.h"
#include "odb/db.h"
#include "odb/dbTransform.h"
Expand Down Expand Up @@ -154,10 +152,6 @@ bool _dbMaster::operator==(const _dbMaster& rhs) const
return false;
}

if (*_target_tbl != *rhs._target_tbl) {
return false;
}

if (*_box_tbl != *rhs._box_tbl) {
return false;
}
Expand Down Expand Up @@ -200,7 +194,6 @@ void _dbMaster::differences(dbDiff& diff,
DIFF_HASH_TABLE(_mterm_hash);
DIFF_TABLE_NO_DEEP(_mterm_tbl);
DIFF_TABLE_NO_DEEP(_mpin_tbl);
DIFF_TABLE_NO_DEEP(_target_tbl);
DIFF_TABLE_NO_DEEP(_box_tbl);
DIFF_TABLE_NO_DEEP(_poly_box_tbl);
DIFF_TABLE_NO_DEEP(_antenna_pin_model_tbl);
Expand Down Expand Up @@ -232,7 +225,6 @@ void _dbMaster::out(dbDiff& diff, char side, const char* field) const
DIFF_OUT_HASH_TABLE(_mterm_hash);
DIFF_OUT_TABLE_NO_DEEP(_mterm_tbl);
DIFF_OUT_TABLE_NO_DEEP(_mpin_tbl);
DIFF_OUT_TABLE_NO_DEEP(_target_tbl);
DIFF_OUT_TABLE_NO_DEEP(_box_tbl);
DIFF_OUT_TABLE_NO_DEEP(_poly_box_tbl);
DIFF_OUT_TABLE_NO_DEEP(_antenna_pin_model_tbl);
Expand Down Expand Up @@ -270,9 +262,6 @@ _dbMaster::_dbMaster(_dbDatabase* db)
_mpin_tbl = new dbTable<_dbMPin>(
db, this, (GetObjTbl_t) &_dbMaster::getObjectTable, dbMPinObj, 4, 2);

_target_tbl = new dbTable<_dbTarget>(
db, this, (GetObjTbl_t) &_dbMaster::getObjectTable, dbTargetObj, 4, 2);

_box_tbl = new dbTable<_dbBox>(
db, this, (GetObjTbl_t) &_dbMaster::getObjectTable, dbBoxObj, 8, 3);

Expand All @@ -295,8 +284,6 @@ _dbMaster::_dbMaster(_dbDatabase* db)

_mpin_itr = new dbMPinItr(_mpin_tbl);

_target_itr = new dbTargetItr(_target_tbl);

_mterm_hash.setTable(_mterm_tbl);

_sta_cell = nullptr;
Expand Down Expand Up @@ -330,8 +317,6 @@ _dbMaster::_dbMaster(_dbDatabase* db, const _dbMaster& m)

_mpin_tbl = new dbTable<_dbMPin>(db, this, *m._mpin_tbl);

_target_tbl = new dbTable<_dbTarget>(db, this, *m._target_tbl);

_box_tbl = new dbTable<_dbBox>(db, this, *m._box_tbl);

_poly_box_tbl = new dbTable<_dbPolygon>(db, this, *m._poly_box_tbl);
Expand All @@ -347,24 +332,20 @@ _dbMaster::_dbMaster(_dbDatabase* db, const _dbMaster& m)

_mpin_itr = new dbMPinItr(_mpin_tbl);

_target_itr = new dbTargetItr(_target_tbl);

_mterm_hash.setTable(_mterm_tbl);
}

_dbMaster::~_dbMaster()
{
delete _mterm_tbl;
delete _mpin_tbl;
delete _target_tbl;
delete _box_tbl;
delete _poly_box_tbl;
delete _antenna_pin_model_tbl;
delete _box_itr;
delete _pbox_itr;
delete _pbox_box_itr;
delete _mpin_itr;
delete _target_itr;

if (_name) {
free((void*) _name);
Expand Down Expand Up @@ -392,7 +373,6 @@ dbOStream& operator<<(dbOStream& stream, const _dbMaster& master)
stream << master._mterm_hash;
stream << *master._mterm_tbl;
stream << *master._mpin_tbl;
stream << *master._target_tbl;
stream << *master._box_tbl;
stream << *master._poly_box_tbl;
stream << *master._antenna_pin_model_tbl;
Expand Down Expand Up @@ -428,7 +408,11 @@ dbIStream& operator>>(dbIStream& stream, _dbMaster& master)
stream >> master._mterm_hash;
stream >> *master._mterm_tbl;
stream >> *master._mpin_tbl;
stream >> *master._target_tbl;
if (!db->isSchema(db_rm_target)) {
// obsolete table is always unpopulated so type/values unimportant
dbTable<_dbMaster> dummy(nullptr, nullptr, nullptr, dbDatabaseObj);
stream >> dummy;
}
stream >> *master._box_tbl;
if (db->isSchema(db_schema_polygon)) {
stream >> *master._poly_box_tbl;
Expand All @@ -444,8 +428,6 @@ dbObjectTable* _dbMaster::getObjectTable(dbObjectType type)
return _mterm_tbl;
case dbMPinObj:
return _mpin_tbl;
case dbTargetObj:
return _target_tbl;
case dbBoxObj:
return _box_tbl;
case dbPolygonObj:
Expand Down
4 changes: 0 additions & 4 deletions src/odb/src/db/dbMaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ class _dbBox;
class _dbPolygon;
class _dbLib;
class _dbMPin;
class _dbTarget;
class _dbSite;
class _dbDatabase;
class _dbTechAntennaPinModel;
class dbBoxItr;
class dbPolygonItr;
class dbMPinItr;
class dbTargetItr;
class dbIStream;
class dbOStream;
class dbDiff;
Expand Down Expand Up @@ -93,7 +91,6 @@ class _dbMaster : public _dbObject
dbHashTable<_dbMTerm> _mterm_hash;
dbTable<_dbMTerm>* _mterm_tbl;
dbTable<_dbMPin>* _mpin_tbl;
dbTable<_dbTarget>* _target_tbl;
dbTable<_dbBox>* _box_tbl;
dbTable<_dbPolygon>* _poly_box_tbl;
dbTable<_dbTechAntennaPinModel>* _antenna_pin_model_tbl;
Expand All @@ -105,7 +102,6 @@ class _dbMaster : public _dbObject
dbPolygonItr* _pbox_itr;
dbBoxItr* _pbox_box_itr;
dbMPinItr* _mpin_itr;
dbTargetItr* _target_itr;

_dbMaster(_dbDatabase* db);
_dbMaster(_dbDatabase* db, const _dbMaster& m);
Expand Down
1 change: 0 additions & 1 deletion src/odb/src/db/dbObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ static const char* name_tbl[] = {"dbDatabase",
"dbMaster",
"dbMPin",
"dbMTerm",
"dbTarget",
"dbTechAntennaPinModel",

// Tech Objects
Expand Down
Loading

0 comments on commit 29fbad4

Please sign in to comment.