Skip to content

Commit

Permalink
ord: fix last commit
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Liberty <[email protected]>
  • Loading branch information
maliberty committed Oct 29, 2024
1 parent 2043eda commit e2da153
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ static void initPython()

static volatile sig_atomic_t fatal_error_in_progress = 0;

// When we enter through main() we have a single tech and design.
// Custom applications using OR as a library might define multiple.
// Such applications won't allocate or use these objects.
static std::unique_ptr<ord::Tech> the_tech;
static std::unique_ptr<ord::Design> the_design;

static void handler(int sig)
{
if (fatal_error_in_progress) {
Expand Down Expand Up @@ -265,11 +271,8 @@ int main(int argc, char* argv[])
cmd_argc = argc;
cmd_argv = argv;

// When we enter through main() we have a single tech and design.
// Custom applications using OR as a library might define multiple.
// Such applications won't allocate or use these objects.
auto the_tech = std::make_unique<ord::Tech>();
auto the_design = std::make_unique<ord::Design>(the_tech.get());
the_tech = std::make_unique<ord::Tech>();
the_design = std::make_unique<ord::Design>(the_tech.get());
ord::OpenRoad::setOpenRoad(the_design->getOpenRoad());
#ifdef ENABLE_PYTHON3
if (findCmdLineFlag(cmd_argc, cmd_argv, "-python")) {
Expand Down

0 comments on commit e2da153

Please sign in to comment.