Skip to content

Commit

Permalink
Merge pull request #6041 from The-OpenROAD-Project-staging/multiple-d…
Browse files Browse the repository at this point in the history
…esigns

Multiple designs
  • Loading branch information
maliberty authored Oct 29, 2024
2 parents f980e02 + e2da153 commit 844f9a4
Show file tree
Hide file tree
Showing 211 changed files with 558 additions and 442 deletions.
48 changes: 37 additions & 11 deletions include/ord/Design.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#pragma once

#include <cstdint>
#include <memory>
#include <mutex>
#include <string>
#include <vector>

Expand All @@ -61,6 +63,10 @@ namespace ant {
class AntennaChecker;
}

namespace dft {
class Dft;
}

namespace grt {
class GlobalRouter;
}
Expand All @@ -77,6 +83,10 @@ namespace mpl {
class MacroPlacer;
}

namespace mpl2 {
class MacroPlacer2;
}

namespace ppl {
class IOPlacer;
}
Expand Down Expand Up @@ -113,6 +123,10 @@ namespace rmp {
class Restructure;
}

namespace rsz {
class Resizer;
}

namespace stt {
class SteinerTreeBuilder;
}
Expand All @@ -136,12 +150,14 @@ class LibertyCell;

namespace ord {

class OpenRoad;
class Tech;

class Design
{
public:
explicit Design(Tech* tech);

void readVerilog(const std::string& file_name);
void readDef(const std::string& file_name,
bool continue_on_errors = false,
Expand Down Expand Up @@ -176,25 +192,32 @@ class Design
std::uint64_t getNetRoutedLength(odb::dbNet* net);

// Services
ifp::InitFloorplan* getFloorplan();
ant::AntennaChecker* getAntennaChecker();
grt::GlobalRouter* getGlobalRouter();
gpl::Replace* getReplace();
dpl::Opendp* getOpendp();
mpl::MacroPlacer* getMacroPlacer();
ppl::IOPlacer* getIOPlacer();
tap::Tapcell* getTapcell();
cts::TritonCTS* getTritonCts();
drt::TritonRoute* getTritonRoute();
dft::Dft* getDft();
dpl::Opendp* getOpendp();
dpo::Optdp* getOptdp();
drt::TritonRoute* getTritonRoute();
fin::Finale* getFinale();
gpl::Replace* getReplace();
grt::GlobalRouter* getGlobalRouter();
ifp::InitFloorplan getFloorplan();
mpl::MacroPlacer* getMacroPlacer();
mpl2::MacroPlacer2* getMacroPlacer2();
odb::dbDatabase* getDb();
pad::ICeWall* getICeWall();
par::PartitionMgr* getPartitionMgr();
pdn::PdnGen* getPdnGen();
ppl::IOPlacer* getIOPlacer();
psm::PDNSim* getPDNSim();
rcx::Ext* getOpenRCX();
rmp::Restructure* getRestructure();
rsz::Resizer* getResizer();
stt::SteinerTreeBuilder* getSteinerTreeBuilder();
psm::PDNSim* getPDNSim();
pdn::PdnGen* getPdnGen();
pad::ICeWall* getICeWall();
tap::Tapcell* getTapcell();

// Needed by standalone startup, not for general use.
ord::OpenRoad* getOpenRoad();

// This returns a database that is not the one associated with
// the rest of the application. It is usable as a standalone
Expand All @@ -209,6 +232,9 @@ class Design
sta::LibertyCell* getLibertyCell(odb::dbMaster* master);

Tech* tech_;

// Single-thread access to the interpreter in evalTclString
static std::mutex interp_mutex;
};

} // namespace ord
5 changes: 5 additions & 0 deletions include/ord/OpenRoad.hh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class OpenRoad
// Tools should use their initialization functions to get the
// OpenRoad object and/or any other tools they need to reference.
static OpenRoad* openRoad();
static void setOpenRoad(OpenRoad* app, bool reinit_ok = false);
void init(Tcl_Interp* tcl_interp);

Tcl_Interp* tclInterp() { return tcl_interp_; }
Expand Down Expand Up @@ -293,6 +294,10 @@ class OpenRoad
std::set<OpenRoadObserver*> observers_;

int threads_ = 1;

static OpenRoad* app_;

friend class Tech;
};

int tclAppInit(Tcl_Interp* interp);
Expand Down
19 changes: 11 additions & 8 deletions include/ord/Tech.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,38 @@

#pragma once

#include <memory>
#include <string>

namespace odb {
class dbDatabase;
}

namespace utl {
class Logger;
}
class dbTech;
} // namespace odb

namespace sta {
class dbSta;
class dbNetwork;
class LibertyCell;
} // namespace sta

namespace ord {

class OpenRoad;

class Tech
{
public:
Tech();
~Tech();

void readLef(const std::string& file_name);
void readLiberty(const std::string& file_name);
odb::dbDatabase* getDB();
odb::dbTech* getTech();
sta::dbSta* getSta();

private:
odb::dbDatabase* db_;
OpenRoad* app_;

friend class Design;
};

} // namespace ord
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ if (Python3_FOUND AND BUILD_PYTHON)
dbSta
odb
OpenSTA
ifp
)
target_link_libraries(openroad
openroad_swig_py
Expand Down
Loading

0 comments on commit 844f9a4

Please sign in to comment.