Пример #1
0
 def add_output(self, name: str, width: int = None):
     if width is None:
         new_output = PortOut(name, self)
         self._netlist[name] = new_output
         self._outputs.append(new_output)
         self._output_vectors.append(new_output)
     else:
         for num in range(width + 1):
             name_v = name + ("[{}]".format(str(num)))
             new_output_v = PortOut(name_v, self)
             self._netlist[name_v] = new_output_v
             self._outputs.append(new_output_v)
         self._output_vectors.append(VectorWire("output", name, width))
Пример #2
0
 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}
Пример #3
0
 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