def Wire(self, name, width=None, length=None, signed=False, value=None): t = vtypes.Wire(width, length, signed, value, name=name, module=self) self.check_existing_identifier(name, vtypes.Input, vtypes.Output) if self.is_reg(name): raise ValueError("Object '%s' is already defined." % name) self.variable[name] = t self.items.append(t) return t
def visit_Wire(self, node): name = node.name width = self.visit(node.width) if node.width is not None else None signed = node.signed obj = vtypes.Wire(width, signed=signed, name=name) if node.width is not None: obj._set_raw_width(self.visit(node.width.msb), self.visit(node.width.lsb)) self.add_object(obj) return obj
def visit_Wire(self, node): name = node.name raw_width = self.visit(node.width) if node.width is not None else None width = to_width(raw_width) raw_dims = self.visit( node.dimensions) if node.dimensions is not None else None dims = to_dims(raw_dims) signed = node.signed obj = vtypes.Wire(width, dims, signed=signed, name=name, raw_width=raw_width, raw_dims=raw_dims) self.add_object(obj) return obj