opt_lut to ignore LUT cells, or those that drive bits, with (* keep *)
authorEddie Hung <eddie@fpgeh.com>
Wed, 7 Aug 2019 20:12:28 +0000 (13:12 -0700)
committerEddie Hung <eddie@fpgeh.com>
Wed, 7 Aug 2019 20:15:02 +0000 (13:15 -0700)
passes/opt/opt_lut.cc

index 587ef878a6d68728fa2a93ccc7bc7fb7cb54be5e..4c199ba723a7b8cef5fbdf492cc90416085ba716 100644 (file)
@@ -101,6 +101,12 @@ struct OptLutWorker
                {
                        if (cell->type == "$lut")
                        {
+                               if (cell->has_keep_attr())
+                                       continue;
+                               SigBit lut_output = cell->getPort("\\Y");
+                               if (lut_output.wire->get_bool_attribute("\\keep"))
+                                       continue;
+
                                int lut_width = cell->getParam("\\WIDTH").as_int();
                                SigSpec lut_input = cell->getPort("\\A");
                                int lut_arity = 0;