diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-07-29 16:06:27 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-07-29 16:35:13 +0200 |
commit | 03c96f9ce7120adf1c9bab93485a3b4bf6493ae9 (patch) | |
tree | c59b7586ba36ebc0dc1576337c882b44db5f8dc5 /passes/techmap/techmap.cc | |
parent | 397b00252dc0c4af725614bd12fc299147ba8efa (diff) |
Added "techmap -map %{design-name}"
Diffstat (limited to 'passes/techmap/techmap.cc')
-rw-r--r-- | passes/techmap/techmap.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc index 5a69baca..0ae5220e 100644 --- a/passes/techmap/techmap.cc +++ b/passes/techmap/techmap.cc @@ -656,13 +656,22 @@ struct TechmapPass : public Pass { Frontend::frontend_call(map, f, "<stdcells.v>", verilog_frontend); fclose(f); } else - for (auto &fn : map_files) { - FILE *f = fopen(fn.c_str(), "rt"); - if (f == NULL) - log_cmd_error("Can't open map file `%s'\n", fn.c_str()); - Frontend::frontend_call(map, f, fn, (fn.size() > 3 && fn.substr(fn.size()-3) == ".il") ? "ilang" : verilog_frontend); - fclose(f); - } + for (auto &fn : map_files) + if (fn.substr(0, 1) == "%") { + if (!saved_designs.count(fn.substr(1))) { + delete map; + log_cmd_error("Can't saved design `%s'.\n", fn.c_str()+1); + } + for (auto mod : saved_designs.at(fn.substr(1))->modules()) + if (!map->has(mod->name)) + map->add(mod->clone()); + } else { + FILE *f = fopen(fn.c_str(), "rt"); + if (f == NULL) + log_cmd_error("Can't open map file `%s'\n", fn.c_str()); + Frontend::frontend_call(map, f, fn, (fn.size() > 3 && fn.substr(fn.size()-3) == ".il") ? "ilang" : verilog_frontend); + fclose(f); + } std::map<RTLIL::IdString, RTLIL::Module*> modules_new; for (auto &it : map->modules_) { |