Examples of EncapsulatedAccess


Examples of org.pshdl.interpreter.access.EncapsulatedAccess

        stack[++stackPos] = b.xor(a);
        break;
      }
      case isFallingEdge: {
        final int off = f.arg1;
        final EncapsulatedAccess access = getInternal(off, arrayPos);
        arrayPos = -1;
        if (access.skip(deltaCycle, epsCycle)) {
          if (listener != null) {
            listener.skippingHandledEdge(uniqueID, access.ii, false, this);
          }
          return;
        }
        final long curr = access.getDataLong();
        final EncapsulatedAccess prevAccess = internals_prev[off];
        prevAccess.offset = access.offset;
        final long prev = prevAccess.getDataLong();
        if ((prev != 1) || (curr != 0)) {
          if (listener != null) {
            listener.skippingNotAnEdge(uniqueID, access.ii, false, this);
          }
          return;
        }
        access.setLastUpdate(deltaCycle, epsCycle);
        break;
      }
      case isRisingEdge: {
        final int off = f.arg1;
        final EncapsulatedAccess access = getInternal(off, arrayPos);
        arrayPos = -1;
        if (access.skip(deltaCycle, epsCycle)) {
          if (listener != null) {
            listener.skippingHandledEdge(uniqueID, access.ii, true, this);
          }
          return;
        }
        final long curr = access.getDataLong();
        final EncapsulatedAccess prevAccess = internals_prev[off];
        prevAccess.offset = access.offset;
        final long prev = prevAccess.getDataLong();
        if ((prev != 0) || (curr != 1)) {
          if (listener != null) {
            listener.skippingNotAnEdge(uniqueID, access.ii, true, this);
          }
          return;
        }
        access.setLastUpdate(deltaCycle, epsCycle);
        break;
      }
      case posPredicate: {
        final int off = f.arg1;
        final EncapsulatedAccess access = getInternal(off, arrayPos);
        arrayPos = -1;
        // If data is not from this deltaCycle it was not
        // updated that means prior predicates failed
        if (!access.isFresh(deltaCycle, epsCycle)) {
          if (listener != null) {
            listener.skippingPredicateNotFresh(uniqueID, access.ii, true, this);
          }
          return;
        }
        if (ZERO.equals(access.getDataBig())) {
          if (listener != null) {
            listener.skippingPredicateNotMet(uniqueID, access.ii, true, access.getDataBig(), this);
          }
          return;
        }
        break;
      }
      case negPredicate: {
        final int off = f.arg1;
        final EncapsulatedAccess access = getInternal(off, arrayPos);
        arrayPos = -1;
        // If data is not from this deltaCycle it was not
        // updated that means prior predicates failed
        if (!access.isFresh(deltaCycle, epsCycle)) {
          if (listener != null) {
            listener.skippingPredicateNotFresh(uniqueID, access.ii, true, this);
          }
          return;
        }
        if (!ZERO.equals(access.getDataBig())) {
          if (listener != null) {
            listener.skippingPredicateNotMet(uniqueID, access.ii, false, access.getDataBig(), this);
          }
          return;
        }
        break;
      }
      case pushAddIndex:
        writeIndex[++arrayPos] = a.intValue();
        break;
      case writeInternal:
        final int off = f.arg1;
        final EncapsulatedAccess access = getInternal(off, -1);
        access.fillDataBig(arrayPos, writeIndex, a, deltaCycle, epsCycle);
        arrayPos = -1;
        break;
      }
      if (listener != null)
        if (stackPos >= 0) {
View Full Code Here

Examples of org.pshdl.interpreter.access.EncapsulatedAccess

    return;
  }

  public EncapsulatedAccess getInternal(int off, int arrayPos) {
    final EncapsulatedAccess res = internals[off];
    if (arrayPos != -1) {
      res.setOffset(writeIndex);
    }
    return res;
  }
View Full Code Here

Examples of org.pshdl.interpreter.access.EncapsulatedAccess

      case xor:
        stack[++stackPos] = fixOp(b ^ a, fi.arg1);
        break;
      case isFallingEdge: {
        final int off = fi.arg1;
        final EncapsulatedAccess access = getInternal(off, arrayPos);
        arrayPos = -1;
        if (access.skip(deltaCycle, epsCycle)) {
          if (listener != null) {
            listener.skippingHandledEdge(uniqueID, access.ii, false, this);
          }
          return;
        }
        final long curr = access.getDataLong();
        final EncapsulatedAccess prevAcc = internals_prev[off];
        prevAcc.offset = access.offset;
        final long prev = prevAcc.getDataLong();
        if ((prev != 1) || (curr != 0)) {
          if (listener != null) {
            listener.skippingNotAnEdge(uniqueID, access.ii, false, this);
          }
          return;
        }
        access.setLastUpdate(deltaCycle, epsCycle);
        break;
      }
      case isRisingEdge: {
        final int off = fi.arg1;
        final EncapsulatedAccess access = getInternal(off, arrayPos);
        arrayPos = -1;
        if (access.skip(deltaCycle, epsCycle)) {
          if (listener != null) {
            listener.skippingHandledEdge(uniqueID, access.ii, true, this);
          }
          return;
        }
        final long curr = access.getDataLong();
        final EncapsulatedAccess prevAcc = internals_prev[off];
        prevAcc.offset = access.offset;
        final long prev = prevAcc.getDataLong();
        if ((prev != 0) || (curr != 1)) {
          if (listener != null) {
            listener.skippingNotAnEdge(uniqueID, access.ii, true, this);
          }
          return;
        }
        access.setLastUpdate(deltaCycle, epsCycle);
        break;
      }
      case posPredicate: {
        final int off = fi.arg1;
        final EncapsulatedAccess access = getInternal(off, arrayPos);
        arrayPos = -1;
        // If data is not from this deltaCycle it was not
        // updated that means prior predicates failed
        if (!access.isFresh(deltaCycle, epsCycle)) {
          if (listener != null) {
            listener.skippingPredicateNotFresh(uniqueID, access.ii, true, this);
          }
          return;
        }
        if (access.getDataLong() == 0) {
          if (listener != null) {
            listener.skippingPredicateNotMet(uniqueID, access.ii, true, access.getDataBig(), this);
          }
          return;
        }
        break;
      }
      case negPredicate: {
        final int off = fi.arg1;
        final EncapsulatedAccess access = getInternal(off, arrayPos);
        arrayPos = -1;
        // If data is not from this deltaCycle it was not
        // updated that means prior predicates failed
        if (!access.isFresh(deltaCycle, epsCycle)) {
          if (listener != null) {
            listener.skippingPredicateNotFresh(uniqueID, access.ii, false, this);
          }
          return;
        }
        if (access.getDataLong() != 0) {
          if (listener != null) {
            listener.skippingPredicateNotMet(uniqueID, access.ii, false, access.getDataBig(), this);
          }
          return;
        }
        break;
      }
      case pushAddIndex:
        writeIndex[++arrayPos] = (int) a;
        break;
      case writeInternal:
        final int off = fi.arg1;
        final EncapsulatedAccess access = getInternal(off, -1);
        access.fillDataLong(arrayPos, writeIndex, a, deltaCycle, epsCycle);
        if (listener != null) {
          listener.writeInternal(uniqueID, arrayPos, writeIndex, BigInteger.valueOf(a), access.ii, this);
        }
        arrayPos = -1;
        break;
View Full Code Here

Examples of org.pshdl.interpreter.access.EncapsulatedAccess

      return ((l << val) >> val);
    return l & ((1l << val) - 1);
  }

  public EncapsulatedAccess getInternal(int off, int arrayPos) {
    final EncapsulatedAccess ea = internals[off];
    if (arrayPos != -1) {
      ea.setOffset(writeIndex);
    }
    if (listener != null) {
      listener.loadingInternal(uniqueID, ea.ii, ea.getDataBig(), this);
    }
    return ea;
  }
View Full Code Here

Examples of org.pshdl.interpreter.access.EncapsulatedAccess

   * @see org.pshdl.interpreter.IHDLInterpreter#setInput(int,
   * java.math.BigInteger, int)
   */
  @Override
  public void setInput(int idx, BigInteger value, int... arrayIdx) {
    final EncapsulatedAccess acc = full[idx];
    if (arrayIdx != null) {
      acc.setOffset(arrayIdx);
    }
    acc.setDataBig(value, deltaCycle, 0);
  }
View Full Code Here

Examples of org.pshdl.interpreter.access.EncapsulatedAccess

   *
   * @see org.pshdl.interpreter.IHDLInterpreter#setInput(int, long, int)
   */
  @Override
  public void setInput(int idx, long value, int... arrayIdx) {
    final EncapsulatedAccess acc = full[idx];
    if (arrayIdx != null) {
      acc.setOffset(arrayIdx);
    }
    acc.setDataLong(value, deltaCycle, 0);
  }
View Full Code Here

Examples of org.pshdl.interpreter.access.EncapsulatedAccess

   *
   * @see org.pshdl.interpreter.IHDLInterpreter#getOutputLong(int, int)
   */
  @Override
  public long getOutputLong(int idx, int... arrayIdx) {
    final EncapsulatedAccess acc = full[idx];
    if (arrayIdx != null) {
      acc.setOffset(arrayIdx);
    }
    return acc.getDataLong();
  }
View Full Code Here

Examples of org.pshdl.interpreter.access.EncapsulatedAccess

   *
   * @see org.pshdl.interpreter.IHDLInterpreter#getOutputBig(int, int)
   */
  @Override
  public BigInteger getOutputBig(int idx, int... arrayIdx) {
    final EncapsulatedAccess acc = full[idx];
    if (arrayIdx != null) {
      acc.setOffset(arrayIdx);
    }
    return acc.getDataBig();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.