Add a few more filename rewrites
authorBen Widawsky <ben@bwidawsk.net>
Thu, 20 Jun 2019 17:27:59 +0000 (10:27 -0700)
committerBen Widawsky <ben@bwidawsk.net>
Thu, 20 Jun 2019 17:27:59 +0000 (10:27 -0700)
This now allows a full pipeline to work, something such as:
yosys -p "synth_ecp5 -json ~/work/fpga/prjtrellis/examples/ecp5_evn/blinky.v"

Otherwise, you will get something along the lines of:
ERROR: Can't open output file `~/work/fpga/prjtrellis/examples/ecp5_evn/blinky.v' for writing: No such file or directory

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
kernel/register.cc
passes/sat/sat.cc

index 71eb6b1870808219bc74edea57c930d4577e79a2..26da96b95b6d9e62a217f3577050a25d510c4d38 100644 (file)
@@ -545,6 +545,7 @@ void Backend::extra_args(std::ostream *&f, std::string &filename, std::vector<st
                }
 
                filename = arg;
+               rewrite_filename(filename);
                std::ofstream *ff = new std::ofstream;
                ff->open(filename.c_str(), std::ofstream::trunc);
                yosys_output_files.insert(filename);
index cbba738f06b70cf1a5832fead05034bd8970484b..e4654d83549383dca604b774b74a1539ce2df3f8 100644 (file)
@@ -659,6 +659,7 @@ struct SatHelper
 
        void dump_model_to_vcd(std::string vcd_file_name)
        {
+               rewrite_filename(vcd_file_name);
                FILE *f = fopen(vcd_file_name.c_str(), "w");
                if (!f)
                        log_cmd_error("Can't open output file `%s' for writing: %s\n", vcd_file_name.c_str(), strerror(errno));
@@ -761,6 +762,7 @@ struct SatHelper
 
        void dump_model_to_json(std::string json_file_name)
        {
+               rewrite_filename(json_file_name);
                FILE *f = fopen(json_file_name.c_str(), "w");
                if (!f)
                        log_cmd_error("Can't open output file `%s' for writing: %s\n", json_file_name.c_str(), strerror(errno));
@@ -1505,6 +1507,7 @@ struct SatPass : public Pass {
                                        {
                                                if (!cnf_file_name.empty())
                                                {
+                                                       rewrite_filename(cnf_file_name);
                                                        FILE *f = fopen(cnf_file_name.c_str(), "w");
                                                        if (!f)
                                                                log_cmd_error("Can't open output file `%s' for writing: %s\n", cnf_file_name.c_str(), strerror(errno));
@@ -1608,6 +1611,7 @@ struct SatPass : public Pass {
 
                        if (!cnf_file_name.empty())
                        {
+                               rewrite_filename(cnf_file_name);
                                FILE *f = fopen(cnf_file_name.c_str(), "w");
                                if (!f)
                                        log_cmd_error("Can't open output file `%s' for writing: %s\n", cnf_file_name.c_str(), strerror(errno));