diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-05-17 15:10:37 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-05-17 15:10:37 +0200 |
commit | e5116eeb77c5b7d77f726da4d512f14b7f31eada (patch) | |
tree | 7898dced7846eedcd7c5c88d922490a1830b79f0 /passes/techmap | |
parent | 7dad017c9ce7b00a1aa3cc0b323297d8fe2cccf5 (diff) | |
download | yosys-e5116eeb77c5b7d77f726da4d512f14b7f31eada.tar.gz yosys-e5116eeb77c5b7d77f726da4d512f14b7f31eada.tar.bz2 yosys-e5116eeb77c5b7d77f726da4d512f14b7f31eada.zip |
Generalized blifparse API
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/abc.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index 2db9e259e..a180e311c 100644 --- a/passes/techmap/abc.cc +++ b/passes/techmap/abc.cc @@ -877,14 +877,16 @@ void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std::strin log_error("ABC: execution of command \"%s\" failed: return code %d.\n", buffer.c_str(), ret); buffer = stringf("%s/%s", tempdir_name.c_str(), "output.blif"); - f = fopen(buffer.c_str(), "rt"); - if (f == NULL) + std::ifstream ifs; + ifs.open(buffer); + if (ifs.fail()) log_error("Can't open ABC output file `%s'.\n", buffer.c_str()); bool builtin_lib = liberty_file.empty() && script_file.empty() && !lut_mode; - RTLIL::Design *mapped_design = abc_parse_blif(f, builtin_lib ? "\\DFF" : "\\_dff_"); + RTLIL::Design *mapped_design = new RTLIL::Design; + parse_blif(mapped_design, ifs, builtin_lib ? "\\DFF" : "\\_dff_"); - fclose(f); + ifs.close(); log_header("Re-integrating ABC results.\n"); RTLIL::Module *mapped_mod = mapped_design->modules_["\\netlist"]; |