Commit aff051ea by lvzhengyang

add describe for db_mgr

parent 0c66a59f
#pragma once
#ifndef _DB_MGR_H_
#define _DB_MGR_H_
#include <unordered_map>
#include <string>
namespace odb {
class dbDatabase;
}
// Logger symbol: MGR
namespace utl {
class Logger;
}
/* DB Manager: for hierarchical design. A hierarchical design
* contains multiple sub-block within the 'top' module. Because
* dbBlock class in OpenDB only supports two-levels of hierarchy,
* I choose to use a dbDatabase to represent a Block.
*
* NOTE: OpenDB claims that it supports that a dbDataBase can
* store multiple dbChip, but denote with "DEPRECATE".
*
* A hierarchical design:
* * ---------TOP--------- *
* | * ------- * ------- * |
* | | | | |
* | | Block A | Block B | |
* | | | | |
* | * ------- * ------- * |
* | | | | |
* | | Block C | Block D | |
* | | | | |
* | * ------- * ------- * |
* * --------------------- *
* Abutting Style: no spare cells amonng Blocks.
*/
class DbMgr {
public:
DbMgr();
void deleteDbMgr(); // dbDatadase::destroy()
bool readLibDB();
bool readBlockDBs();
bool addBlockDB();
bool deleteBlockDB();
bool haveBlockDB(std::string block);
private:
/* all Blocks share the same lib (.lef files)
* First, read the lib files into the lib_db_.
* Then, for each block, create a new db with copy of
* lib_db_, by `dbDatabase::duplicate(lib_db_)`
*/
odb::dbDatabase* lib_db_;
/* use a STL Hash table to store Block DBs.
* use the block name as key.
* check if there exists duplicate name when inserting
* blocks.
*/
std::unordered_map<std::string, odb::dbDatabase> block_dbs_;
};
#endif // _DB_MGR_H_
......@@ -49,34 +49,16 @@
namespace utl {
#define FOREACH_TOOL(X) \
X(ANT) \
X(CTS) \
X(DPL) \
X(DPO) \
X(DRT) \
X(DST) \
X(FIN) \
X(FLW) \
X(EDA) \
X(ODB) \
X(MGR) \
X(GPL) \
X(GRT) \
X(GUI) \
X(PAD) \
X(IFP) \
X(MPL) \
X(ODB) \
X(EDA) \
X(PAR) \
X(PDN) \
X(PDR) \
X(PPL) \
X(PSM) \
X(PSN) \
X(RCX) \
X(RMP) \
X(RSZ) \
X(STA) \
X(STT) \
X(TAP) \
X(UKN) \
#define GENERATE_ENUM(ENUM) ENUM,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment