This commit is contained in:
commit
d16d05e415
3 changed files with 10 additions and 4 deletions
2
README
2
README
|
@ -3,7 +3,7 @@
|
|||
| |
|
||||
| yosys -- Yosys Open SYnthesis Suite |
|
||||
| |
|
||||
| Copyright (C) 2012 - 2015 Clifford Wolf <clifford@clifford.at> |
|
||||
| Copyright (C) 2012 - 2016 Clifford Wolf <clifford@clifford.at> |
|
||||
| |
|
||||
| Permission to use, copy, modify, and/or distribute this software for any |
|
||||
| purpose with or without fee is hereby granted, provided that the above |
|
||||
|
|
|
@ -104,7 +104,7 @@ void yosys_banner()
|
|||
log(" | |\n");
|
||||
log(" | yosys -- Yosys Open SYnthesis Suite |\n");
|
||||
log(" | |\n");
|
||||
log(" | Copyright (C) 2012 - 2015 Clifford Wolf <clifford@clifford.at> |\n");
|
||||
log(" | Copyright (C) 2012 - 2016 Clifford Wolf <clifford@clifford.at> |\n");
|
||||
log(" | |\n");
|
||||
log(" | Permission to use, copy, modify, and/or distribute this software for any |\n");
|
||||
log(" | purpose with or without fee is hereby granted, provided that the above |\n");
|
||||
|
@ -763,6 +763,8 @@ void run_frontend(std::string filename, std::string command, std::string *backen
|
|||
command = "verilog";
|
||||
else if (filename.size() > 2 && filename.substr(filename.size()-3) == ".sv")
|
||||
command = "verilog -sv";
|
||||
else if (filename.size() > 2 && filename.substr(filename.size()-4) == ".vhd")
|
||||
command = "vhdl";
|
||||
else if (filename.size() > 4 && filename.substr(filename.size()-5) == ".blif")
|
||||
command = "blif";
|
||||
else if (filename.size() > 3 && filename.substr(filename.size()-3) == ".il")
|
||||
|
|
|
@ -31,19 +31,23 @@ std::map<std::string, std::string> loaded_plugin_aliases;
|
|||
#ifdef YOSYS_ENABLE_PLUGINS
|
||||
void load_plugin(std::string filename, std::vector<std::string> aliases)
|
||||
{
|
||||
std::string orig_filename = filename;
|
||||
|
||||
if (filename.find('/') == std::string::npos)
|
||||
filename = "./" + filename;
|
||||
|
||||
if (!loaded_plugins.count(filename)) {
|
||||
void *hdl = dlopen(filename.c_str(), RTLD_LAZY|RTLD_LOCAL);
|
||||
if (hdl == NULL && orig_filename.find('/') == std::string::npos)
|
||||
hdl = dlopen((proc_share_dirname() + "plugins/" + orig_filename + ".so").c_str(), RTLD_LAZY|RTLD_LOCAL);
|
||||
if (hdl == NULL)
|
||||
log_cmd_error("Can't load module `%s': %s\n", filename.c_str(), dlerror());
|
||||
loaded_plugins[filename] = hdl;
|
||||
loaded_plugins[orig_filename] = hdl;
|
||||
Pass::init_register();
|
||||
}
|
||||
|
||||
for (auto &alias : aliases)
|
||||
loaded_plugin_aliases[alias] = filename;
|
||||
loaded_plugin_aliases[alias] = orig_filename;
|
||||
}
|
||||
#else
|
||||
void load_plugin(std::string, std::vector<std::string>)
|
||||
|
|
Loading…
Add table
Reference in a new issue