Exemplo n.º 1
0
  /**
   * Pushes size, care, and constant information forward through this ReductionOrOp according to
   * this rule:
   *
   * <p>Result has only 1 care bit.
   *
   * @return a value of type 'boolean'
   */
  @Override
  public boolean pushValuesForward() {
    boolean mod = false;

    Value inValue = getDataPort().getValue();

    Value newValue = new Value(inValue.getSize(), false);

    for (int i = 1; i < inValue.getSize(); i++) {
      newValue.setBit(i, Bit.ZERO);
    }

    mod |= getResultBus().pushValueForward(newValue);

    return mod;
  }
Exemplo n.º 2
0
  /**
   * Gets the FPGA hardware resource usage of this component.
   *
   * @return a FPGAResource objec
   */
  @Override
  public FPGAResource getHardwareResourceUsage() {
    int lutCount = 0;

    Value inputValue = getDataPort().getValue();
    for (int i = 0; i < inputValue.getSize(); i++) {
      Bit inputBit = inputValue.getBit(i);
      if (!inputBit.isConstant() && inputBit.isCare()) {
        lutCount++;
      }
    }

    FPGAResource hwResource = new FPGAResource();
    hwResource.addLUT(lutCount);

    return hwResource;
  }