Open aig frontend as binary file
authorMiodrag Milanovic <mmicko@gmail.com>
Sun, 29 Sep 2019 11:22:11 +0000 (13:22 +0200)
committerMiodrag Milanovic <mmicko@gmail.com>
Sun, 29 Sep 2019 11:22:11 +0000 (13:22 +0200)
frontends/aiger/aigerparse.cc
kernel/register.cc
kernel/register.h
passes/techmap/abc9.cc

index e8ee487e50e36381f0e62346fbb7eac9bec0906c..b0a04749c06735c92c3dfd70bf614e5d23c2200c 100644 (file)
@@ -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
index 3033ee710a75e7e0fea768a37df60c84bf3a2fa4..37f2e5e1bf8a676dc9717e8e9220729926cfa7a8 100644 (file)
@@ -439,7 +439,7 @@ void Frontend::execute(std::vector<std::string> 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<std::string> args, size_t argidx)
+void Frontend::extra_args(std::istream *&f, std::string &filename, std::vector<std::string> 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::vector<s
                                next_args.insert(next_args.end(), filenames.begin()+1, filenames.end());
                        }
                        std::ifstream *ff = new std::ifstream;
-                       ff->open(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;
index be836013f9c74b9ac879ecf5a784dcc79ab085f5..85d552f0dc8fe3173d31702ca573a0bc3f8e2a93 100644 (file)
@@ -94,7 +94,7 @@ struct Frontend : Pass
        virtual void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) = 0;
 
        static std::vector<std::string> next_args;
-       void extra_args(std::istream *&f, std::string &filename, std::vector<std::string> args, size_t argidx);
+       void extra_args(std::istream *&f, std::string &filename, std::vector<std::string> 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<std::string> args);
index 7eac08d17b40da774828071e63b33bece4047be3..7c764451f57808cbe8a4b48f89a86414e057e5be 100644 (file)
@@ -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());