scratchpad entry abc9.if.R to &if -R
authorEddie Hung <eddie@fpgeh.com>
Wed, 8 Jan 2020 20:13:06 +0000 (12:13 -0800)
committerEddie Hung <eddie@fpgeh.com>
Wed, 8 Jan 2020 20:13:06 +0000 (12:13 -0800)
passes/techmap/abc9.cc

index 5bcbb1611a592a43ea746dcb9317fd5472d2170e..3fdcc0e5c00fe7d128438c652018b2565522ff30 100644 (file)
@@ -303,6 +303,12 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *module, std::string scrip
        for (size_t pos = abc9_script.find("{C}"); pos != std::string::npos; pos = abc9_script.find("{C}", pos))
                abc9_script = abc9_script.substr(0, pos) + C + abc9_script.substr(pos+3);
 
+       std::string R;
+       if (design->scratchpad.count("abc9.if.R"))
+               C = "-C " + design->scratchpad_get_string("abc9.if.R");
+       for (size_t pos = abc9_script.find("{R}"); pos != std::string::npos; pos = abc9_script.find("{R}", pos))
+               abc9_script = abc9_script.substr(0, pos) + C + abc9_script.substr(pos+3);
+
        if (nomfs)
                for (size_t pos = abc9_script.find("&mfs"); pos != std::string::npos; pos = abc9_script.find("&mfs", pos))
                        abc9_script = abc9_script.erase(pos, strlen("&mfs"));