v2x: direct connections now are in the old format

Before this commit direct connections were in the following format:
<direct>
  <port name="out[0]" type="input"/>
  <port from="dsp_in_registered" name="out[0]" type="output"/>
</direct>

Direct connections's correct format is the following:
<direct input="<input>" name="<name>" output="<output>"/>

Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
diff --git a/vlog_to_pbtype.py b/vlog_to_pbtype.py
index 3b9b1e0..ca1e3aa 100755
--- a/vlog_to_pbtype.py
+++ b/vlog_to_pbtype.py
@@ -151,36 +151,25 @@
     """Build the pb_type content - child pb_types, timing and direct interconnect,
     but not IO. This may be put directly inside <pb_type>, or inside <mode>."""
 
-    def get_pin_name(pin):
+    def get_full_pin_name(pin):
         cname, cellpin = pin
         if cname != mod.name:
             cname = mod.cell_type(cname)
             cname = mod_pb_name(yj.module(cname))
         else:
             cname = mod_pname
-        return cname
+        return ("{}.{}".format(cname, cellpin))
 
-    def get_cellpin(pin):
-        cname, cellpin = pin
-        return cellpin
+    def make_direct_conn(ic_xml, src, dst):
+        src_pin = get_full_pin_name(src)
+        dst_pin = get_full_pin_name(dst)
+        dc_name = dst_pin.replace(".", "_").replace("[", "_").replace("]", "")
 
-    def make_direct_conn(ic_xml, source, dest):
-        s_cellpin = get_cellpin(source)
-        d_cellpin = get_cellpin(dest)
-        d_cname = get_pin_name(dest)
-
-        dir_xml = ET.SubElement(ic_xml, 'direct')
-        in_port_xml = ET.SubElement(
-            dir_xml, 'port', {
-                'name': s_cellpin,
-                'type': "input"
-            }
-        )
-        out_port_xml = ET.SubElement(
-            dir_xml, 'port', {
-                'name': d_cellpin,
-                'type': "output",
-                'from': d_cname
+        dir_xml = ET.SubElement(
+            ic_xml, 'direct', {
+                'name': dc_name,
+                'input': src_pin,
+                'output': dst_pin
             }
         )