From: Miodrag Milanovic Date: Sun, 29 Sep 2019 11:22:11 +0000 (+0200) Subject: Open aig frontend as binary file X-Git-Tag: working-ls180~1031^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f70c1fd26eb109c2c4d899cce55f24bbf04acc1;p=yosys.git Open aig frontend as binary file --- diff --git a/frontends/aiger/aigerparse.cc b/frontends/aiger/aigerparse.cc index e8ee487e5..b0a04749c 100644 --- a/frontends/aiger/aigerparse.cc +++ b/frontends/aiger/aigerparse.cc @@ -1056,7 +1056,7 @@ struct AigerFrontend : public Frontend { } break; } - extra_args(f, filename, args, argidx); + extra_args(f, filename, args, argidx, true); if (module_name.empty()) { #ifdef _WIN32 diff --git a/kernel/register.cc b/kernel/register.cc index 3033ee710..37f2e5e1b 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -439,7 +439,7 @@ void Frontend::execute(std::vector args, RTLIL::Design *design) FILE *Frontend::current_script_file = NULL; std::string Frontend::last_here_document; -void Frontend::extra_args(std::istream *&f, std::string &filename, std::vector args, size_t argidx) +void Frontend::extra_args(std::istream *&f, std::string &filename, std::vector args, size_t argidx, bool bin_input) { bool called_with_fp = f != NULL; @@ -489,7 +489,7 @@ void Frontend::extra_args(std::istream *&f, std::string &filename, std::vectoropen(filename.c_str()); + ff->open(filename.c_str(), bin_input ? std::ifstream::binary : std::ifstream::in); yosys_input_files.insert(filename); if (ff->fail()) delete ff; diff --git a/kernel/register.h b/kernel/register.h index be836013f..85d552f0d 100644 --- a/kernel/register.h +++ b/kernel/register.h @@ -94,7 +94,7 @@ struct Frontend : Pass virtual void execute(std::istream *&f, std::string filename, std::vector args, RTLIL::Design *design) = 0; static std::vector next_args; - void extra_args(std::istream *&f, std::string &filename, std::vector args, size_t argidx); + void extra_args(std::istream *&f, std::string &filename, std::vector args, size_t argidx, bool bin_input = false); static void frontend_call(RTLIL::Design *design, std::istream *f, std::string filename, std::string command); static void frontend_call(RTLIL::Design *design, std::istream *f, std::string filename, std::vector args); diff --git a/passes/techmap/abc9.cc b/passes/techmap/abc9.cc index 7eac08d17..7c764451f 100644 --- a/passes/techmap/abc9.cc +++ b/passes/techmap/abc9.cc @@ -471,7 +471,7 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *current_module, std::stri 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.aig"); - ifs.open(buffer); + ifs.open(buffer, std::ifstream::binary); if (ifs.fail()) log_error("Can't open ABC output file `%s'.\n", buffer.c_str());