detect ff/latch before processing other nodes
authorargama <argama@gmail.com>
Sat, 13 Oct 2018 17:42:48 +0000 (01:42 +0800)
committerargama <argama@gmail.com>
Sat, 13 Oct 2018 17:42:48 +0000 (01:42 +0800)
frontends/liberty/liberty.cc

index 0a5bd84de2aff972d6538d67111f5a5c788ce940..0018d6dac58583a382547dc47ba033a0f2fb3373 100644 (file)
@@ -634,6 +634,8 @@ struct LibertyFrontend : public Frontend {
                                }
                        }
 
+                       // some liberty files do not put ff/latch at the beginning of a cell
+                       // try to find "ff" or "latch" and create FF/latch before processing all other nodes 
                        for (auto node : cell->children)
                        {
                                if (!flag_lib) {
@@ -645,6 +647,21 @@ struct LibertyFrontend : public Frontend {
                                                        goto skip_cell;
                                                }
                                }
+                       }
+
+                       for (auto node : cell->children)
+                       {
+                               /*
+                               if (!flag_lib) {
+                                       if (node->id == "ff" && node->args.size() == 2)
+                                               create_ff(module, node);
+                                       if (node->id == "latch" && node->args.size() == 2)
+                                               if (!create_latch(module, node, flag_ignore_miss_data_latch)) {
+                                                       delete module;
+                                                       goto skip_cell;
+                                               }
+                               }
+                               */
 
                                if (node->id == "pin" && node->args.size() == 1)
                                {