aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-12-02 21:19:00 +0100
committerTristan Gingold <tgingold@free.fr>2019-12-02 21:19:00 +0100
commit87544a7a106b7854a51ad639f371b3301257d92a (patch)
tree1ee19099f058556a387a4a86ba3fa4186dda7213 /src
parent83e16d4bdde512fb25a507a2550677a428881556 (diff)
downloadghdl-yosys-plugin-87544a7a106b7854a51ad639f371b3301257d92a.tar.gz
ghdl-yosys-plugin-87544a7a106b7854a51ad639f371b3301257d92a.tar.bz2
ghdl-yosys-plugin-87544a7a106b7854a51ad639f371b3301257d92a.zip
Support multiple synthesis. Fix #73
Diffstat (limited to 'src')
-rw-r--r--src/ghdl.cc11
1 files changed, 7 insertions, 4 deletions
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<std::string> 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");
}