summaryrefslogtreecommitdiff
path: root/passes/techmap/abc.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-05-17 15:10:37 +0200
committerClifford Wolf <clifford@clifford.at>2015-05-17 15:10:37 +0200
commite5116eeb77c5b7d77f726da4d512f14b7f31eada (patch)
tree7898dced7846eedcd7c5c88d922490a1830b79f0 /passes/techmap/abc.cc
parent7dad017c9ce7b00a1aa3cc0b323297d8fe2cccf5 (diff)
Generalized blifparse API
Diffstat (limited to 'passes/techmap/abc.cc')
-rw-r--r--passes/techmap/abc.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc
index 2db9e259..a180e311 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"];