def add_input(self, name: str, width: int = None): if width is None: new_input = PortIn(name, self) self._netlist[name] = new_input self._inputs.append(new_input) self._inputs_vectors.append(new_input) else: for num in range(width + 1): name_v = name + ("[{}]".format(str(num))) new_input_v = PortIn(name_v, self) self._netlist[name_v] = new_input_v self._inputs.append(new_input_v) self._inputs_vectors.append(VectorWire("input", name, width))
def __init__(self, name: str, interfaces: list, input: str, outputs: set, area, delay): super().__init__(name) self._interface = interfaces self._gate_count = area self._delay = delay self._input = PortIn(input, self) self._outputs = {x: PortOut(x, self) for x in outputs}
def __init__(self, name: str, interfaces: list, inputs: list, output: str, tt: int, area, delay): super().__init__(name) self._interface = interfaces self._gate_count = area self._delay = delay self._inputs = [PortIn(x, self) for x in inputs] self._output = PortOut(output, self) self._truth_tables = tt