3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-29 17:38:46 +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
commit 513f0f16dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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();