1
0
mirror of synced 2026-04-19 02:47:35 +00:00

Merge pull request #5173 from RonxBulld/refine_setup_shutdown_flags

Allows calling yosys_shutdown and then yosys_setup to restart.
This commit is contained in:
Emil J
2025-06-24 12:32:52 +02:00
committed by GitHub

View File

@@ -187,12 +187,14 @@ int run_command(const std::string &command, std::function<void(const std::string
#endif
bool already_setup = false;
bool already_shutdown = false;
void yosys_setup()
{
if(already_setup)
return;
already_setup = true;
already_shutdown = false;
#ifdef WITH_PYTHON
// With Python 3.12, calling PyImport_AppendInittab on an already
@@ -224,12 +226,11 @@ bool yosys_already_setup()
return already_setup;
}
bool already_shutdown = false;
void yosys_shutdown()
{
if(already_shutdown)
return;
already_setup = false;
already_shutdown = true;
log_pop();