Fixed another bug in write_blif handling of $lut cells
authorClifford Wolf <clifford@clifford.at>
Fri, 19 Dec 2014 16:54:44 +0000 (17:54 +0100)
committerClifford Wolf <clifford@clifford.at>
Fri, 19 Dec 2014 16:54:44 +0000 (17:54 +0100)
backends/blif/blif.cc

index 366ed0369abe2b94c3716648a7ab9b00d5cb3e9b..6422d9f017b76ed4e010a6a464977db8de776005 100644 (file)
@@ -220,7 +220,7 @@ struct BlifDumper
                                auto &inputs = cell->getPort("\\A");
                                auto width = cell->parameters.at("\\WIDTH").as_int();
                                log_assert(inputs.size() == width);
-                               for (int i = 0; i < inputs.size(); i++) {
+                               for (int i = width-1; i >= 0; i--) {
                                        f << stringf(" %s", cstr(inputs.extract(i, 1)));
                                }
                                auto &output = cell->getPort("\\Y");