From 87544a7a106b7854a51ad639f371b3301257d92a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 2 Dec 2019 21:19:00 +0100 Subject: Support multiple synthesis. Fix #73 --- src/ghdl.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ghdl.cc b/src/ghdl.cc index 814f613..627b81f 100644 --- a/src/ghdl.cc +++ b/src/ghdl.cc @@ -851,12 +851,13 @@ struct GhdlPass : public Pass { #ifdef YOSYS_ENABLE_GHDL virtual void execute(std::vector args, RTLIL::Design *design) { - static bool initialized; + static bool lib_initialized; + static unsigned work_initialized; log_header(design, "Executing GHDL.\n"); // Initialize the library. - if (!initialized) { - initialized = 1; + if (!lib_initialized) { + lib_initialized = 1; libghdl_init (); ghdlsynth__init_for_ghdl_synth(); } @@ -871,7 +872,9 @@ struct GhdlPass : public Pass { cmd_argv[i] = args[i + 1].c_str(); GhdlSynth::Module top; - top = ghdl_synth(cmd_argc, cmd_argv); + top = ghdl_synth + (!work_initialized, cmd_argc, cmd_argv); + work_initialized++; if (!is_valid(top)) { log_cmd_error("vhdl import failed.\n"); } -- cgit v1.2.3