Added .barbuf support to abc BLIF parser
authorClifford Wolf <clifford@clifford.at>
Wed, 13 May 2015 04:45:12 +0000 (06:45 +0200)
committerClifford Wolf <clifford@clifford.at>
Wed, 13 May 2015 04:45:12 +0000 (06:45 +0200)
passes/abc/blifparse.cc

index db87eec4a9e4d72a2fabf936262a7a1e9ec068ca..a69cfde199fd251f6f5d897ad74fc6ee40f063df 100644 (file)
@@ -144,6 +144,26 @@ RTLIL::Design *abc_parse_blif(FILE *f, std::string dff_name)
                                continue;
                        }
 
+                       if (!strcmp(cmd, ".barbuf"))
+                       {
+                               char *p = strtok(NULL, " \t\r\n");
+                               if (p == NULL)
+                                       goto error;
+
+                               char *q = strtok(NULL, " \t\r\n");
+                               if (q == NULL)
+                                       goto error;
+
+                               if (module->wires_.count(RTLIL::escape_id(p)) == 0)
+                                       module->addWire(RTLIL::escape_id(p));
+
+                               if (module->wires_.count(RTLIL::escape_id(q)) == 0)
+                                       module->addWire(RTLIL::escape_id(q));
+
+                               module->connect(module->wires_.at(RTLIL::escape_id(q)), module->wires_.at(RTLIL::escape_id(p)));
+                               continue;
+                       }
+
                        if (!strcmp(cmd, ".names"))
                        {
                                char *p;