utils: v2x: handle implicit cells

Signed-off-by: Karol Gugala <kgugala@antmicro.com>
diff --git a/vlog_to_pbtype.py b/vlog_to_pbtype.py
index a30fd0b..79f6c2e 100755
--- a/vlog_to_pbtype.py
+++ b/vlog_to_pbtype.py
@@ -155,7 +155,9 @@
         """Returns the name of the module relative to the pin and a boolean that indicates whether
         the module is a cell (True) or the top one (False)"""
         cname, cellpin = pin
-        if cname != mod.name:
+        if cname.startswith("$"):
+            return cname, True
+        elif cname != mod.name:
             cname = mod.cell_type(cname)
             return mod_pb_name(yj.module(cname)), True
         else:
diff --git a/yosys/json.py b/yosys/json.py
index 9d3005d..5307108 100755
--- a/yosys/json.py
+++ b/yosys/json.py
@@ -228,8 +228,6 @@
         """
         conn_ports = []
         for cell in sorted(self.data["cells"].keys()):
-            if cell.startswith("$"):
-                continue
             cdata = self.data["cells"][cell]
             for port, condata in sorted(cdata["connections"].items()):
                 if cdata["port_directions"][port] == pdir: