mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 01:25:33 +00:00
Changed frontend-api from FILE to std::istream
This commit is contained in:
parent
5dce303a2a
commit
19cff41eb4
22 changed files with 116 additions and 89 deletions
|
@ -101,13 +101,13 @@ struct IntersynthBackend : public Backend {
|
|||
log("Output filename: %s\n", filename.c_str());
|
||||
|
||||
for (auto filename : libfiles) {
|
||||
FILE *f = fopen(filename.c_str(), "rt");
|
||||
if (f == NULL)
|
||||
std::ifstream f;
|
||||
f.open(filename.c_str());
|
||||
if (f.fail())
|
||||
log_error("Can't open lib file `%s'.\n", filename.c_str());
|
||||
RTLIL::Design *lib = new RTLIL::Design;
|
||||
Frontend::frontend_call(lib, f, filename, (filename.size() > 3 && filename.substr(filename.size()-3) == ".il") ? "ilang" : "verilog");
|
||||
Frontend::frontend_call(lib, &f, filename, (filename.size() > 3 && filename.substr(filename.size()-3) == ".il") ? "ilang" : "verilog");
|
||||
libs.push_back(lib);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
if (libs.size() > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue