示例#1
0
 /** Does this set contain a certain object? */
 public boolean contains(T o) {
   int n = map.getMappedIndex(o);
   if (n == -1) {
     return false;
   }
   return vector.get(n);
 }
示例#2
0
  /**
   * Shift data in chain.inBits into the selected scan chain on the chip. The previous data on the
   * chip is shifted out into chain.outBits. Should only be called by ChainNode.
   *
   * @param chain Root scan chain to shift data into
   * @param readEnable whether to set opcode's read-enable bit
   * @param writeEnable whether to set opcode's write-enable bit
   * @param irBadSeverity action when bits scanned out of IR are wrong
   * @see ChainNode
   * @see Infrastructure#SEVERITY_NOMESSAGE
   * @see Infrastructure#SEVERITY_WARNING
   * @see Infrastructure#SEVERITY_NONFATAL
   * @see Infrastructure#SEVERITY_FATAL
   */
  void shift(ChainNode chain, boolean readEnable, boolean writeEnable, int irBadSeverity) {
    logOther("MockJTAG shift: opcode=" + chain.getOpcode() + "\n " + chain.getInBits());

    int length = chain.getLength();
    BitVector outBits = new BitVector(length, "MockJtag.shift().outBits");
    BitVector outBitsExpected = chain.getOutBitsExpected();
    for (int ibit = 0; ibit < length; ibit++) {
      if (outBitsExpected.isValid(ibit) == true) {
        /* need to handle shadowState carefully - for scanBB */
        if (!writeEnable) {
          outBits.set(ibit, outBitsExpected.get(ibit));
        } else {
          outBits.putIndiscriminate(ibit, chain.getShadowState().getIndiscriminate(ibit, 1));
        }
      } else {
        outBits.clear(ibit);
      }
    }
    chain.getOutBits().putIndiscriminate(0, outBits);
  }