def visit_Port(self, node):
        if node.type is None:
            name = node.name
            p = vtypes.AnyType(name=name)
            self.add_object(p)
            return p
        
        name = node.name
        width = self.visit(node.width) if node.width is not None else None
        _type = getattr(vtypes, node.type, None)
        if _type is None:
            raise TypeError("No such port type '%s'" % node.type)
        p = _type(name, width)
        self.add_object(p)
        return p
dataset/ETHPy150Open PyHDI/veriloggen/veriloggen/verilog/from_verilog.py/VerilogReadVisitor.visit_Port/original