Examples of Pin


Examples of cl.alejo.jcsim.csim.dom.Pin

      addGatesAttachedToPin(gate, listGate, i);
    }
  }

  private static void addGatesAttachedToPin(Gate gate, List listGate, int i) {
    Pin pinFirst = gate.getPin(i);
    Pin pin = pinFirst;
    do {
      findGates(pin.getGate(), listGate);
      pin = (Pin) pin.next();
    } while (pin != pinFirst);
  }
View Full Code Here

Examples of cl.alejo.jcsim.csim.dom.Pin

    List gates = new ArrayList();

    for (Iterator iter = contacts.iterator(); iter.hasNext();) {
      ContactPin ctt = (ContactPin) iter.next();

      Pin pin = ctt.getGuidePin();

      if (pin != null)
        findGates(pin.getGate(), gates);
    }

    return gates;
  }
View Full Code Here

Examples of cl.alejo.jcsim.csim.dom.Pin

    // 0 : entrada
    // 1 : salida
    // 2 : clock
    _pin = new Pin[pinCount()];
    for (int i = 0; i < pinCount(); i++)
      _pin[i] = new Pin(this, circ, (byte) i);

    // El pin que controla el valor del pin de salida
    _pin[2] = new FFDataPin(this, circ, (byte) 2);
  }
View Full Code Here

Examples of cl.alejo.jcsim.csim.dom.Pin

    // Los parametros
    this._gateDescriptor = gatedesc;
    this._parameters = params;
    this._circuit = circ;
    _pin = new Pin[pinCount()];
    _pin[0] = new Pin(this, circ, (byte) 0);
  }
View Full Code Here

Examples of edu.byu.ece.rapidSmith.design.Pin

            ((LogicPathElement)currElement).setInstance(instance);
            if(instance == null){
              MessageGenerator.briefErrorAndExit("This instance \"" + parts[4] +
              "\" is null.");
            }
            Pin p = instance.getPin(pinName);
            if(p == null){
              //System.out.println("Problem Getting Pin: " + parts[1]);
              //System.out.println("Line: " + line);
              //System.exit(1);
            }
View Full Code Here

Examples of edu.byu.ece.rapidSmith.design.Pin

   * This is a helper method to convertToHardMacro which iterates through the nets
   * to turn the design into a hard macro
   */
  private void handleNets(){
    // Iterate through all nets to turn design into hard macro
    Pin pin = null;
    for(Net net: design.getNets()){
      ArrayList<Pin> pins = null;
     
      //check for forbidden pips and unroute
      boolean clearPips = false;
      for(PIP p : net.getPIPs()){
        if(forbiddenPips.contains(p.getStartWireName(design.getWireEnumerator()))
            ||forbiddenPips.contains(p.getEndWireName(design.getWireEnumerator()))){
          clearPips = true;
          break;
        }
      }
      if(clearPips){
        net.getPIPs().clear();
      }
     
      if(net.hasAttributes()){
        netsToRemove.add(net);
      }
      else if((pins = isNetConnectedToIOB(net)).size() > 0){
        handleIOBs(net, pins);
      }
      // Handle BUFG
      else if((pin = isNetOutputofBUFG(net)) != null){
       
        //check to see if the BUFG has an IOBSource before removing
        boolean IOBSource = false;
        for(Net n : pin.getInstance().getNetList()){
          if(n.getSource().getInstance().getType().equals(PrimitiveType.IOB)){
            IOBSource = true;
            break;
          }
        }
       
        if(IOBSource){
         
          // Remove BUFG and source pin
          instancesToRemove.add(pin.getInstance());
          net.getPins().remove(pin);
          net.getPIPs().clear();
         
          // Arbitrarily choose an inpin as the new port
          Pin port = net.getPins().get(0);
          String clkname = pin.getInstance().getName();
          String[] parts = clkname.split("_");
          clkname = "";
          for(String p : parts){
            if(p.contains("IBUF") || p.contains("BUFG")){
              break;
            }
            else{
              clkname += p + "_";
            }
          }
          if(clkname.endsWith("_")){
            clkname = clkname.substring(0, clkname.length()-1);
          }
         
          Port newPort = new Port(clkname +"_inport",port);
          hardMacro.getPorts().add(newPort);
          port.setPort(newPort);
         
        }

      }
      // Rip out DCMs/PMV
View Full Code Here

Examples of edu.byu.ece.rapidSmith.design.Pin

         
          // Create New Net and static SLICE source with Pin connected to static SLICE
          Net newNet = new Net(pin.getInstance().getName() +"_"+ net.getType(), NetType.WIRE);
          Instance inst = createStaticSliceSource(net.getType());
          placeStaticSlice(inst, true);
          Pin newPin = null;
          if(design.getExactFamilyName().contains("virtex4")){
             newPin = new Pin(true,"Y",inst);
          }else if(design.getExactFamilyName().contains("virtex5")){
            //TODO V5
            newPin = new Pin(true,"D",inst);
          }
          newNet.replaceSource(newPin);
          netsToAdd.add(newNet);
          instancesToAdd.add(inst);
          Port newPort = new Port(pin.getInstance().getName()+"_outport",newPin);
          hardMacro.getPorts().add(newPort);
          newPin.setPort(newPort);
        }
      }
    }
    else{ // This is just a single IOB
      // There should only be 1 pin
      Pin pin = pins.get(0);
      // Remove IOB
      if(isTriState(pin.getInstance())){
        failGracefully("Sorry, this design contains tri-state IO.  Tri-state IO is not yet supported by the HMG.");
      }
      instancesToRemove.add(pin.getInstance());
      net.getPins().remove(pin);
      net.getPIPs().clear();
     
      if(pin.isOutPin()){
        // Check if this net drives the BUFG, if so, we don't want to create any ports
        // We'll do that with the output of the BUFG
        for(Pin p : net.getPins()){
          if(p.getInstance().getType().equals(PrimitiveType.BUFG)){
            netsToRemove.add(net);
            return;
          }
        }
        // CASE 1:
        // CASE 2:
        // Now create a port, we just choose an arbitrary one if there are more than one
        Pin p = net.getPins().get(0);
        //XDL_Pin p = pins.get(0); -- This is wrong here because we already removed this pin
        Port newPort = new Port(pin.getInstance().getName()+"_inport",p);
        hardMacro.addPort(newPort);
        p.setPort(newPort);
      }
      else{
        // Check if this is a static net
        if(net.isStaticNet()){
          if(!net.getSource().getInstance().getType().equals(PrimitiveType.TIEOFF)){
            failAndExit("2. This case is unexpected. Talk to Chris about getting it implemented.");
          }
         
          instancesToRemove.add(net.getSource().getInstance());
          netsToRemove.add(net);
         
          // Create New Net and static SLICE source with Pin connected to static SLICE
          Net newNet = new Net(pin.getInstance().getName() + "_" + net.getType(),NetType.WIRE);
          Instance inst = createStaticSliceSource(net.getType());
          placeStaticSlice(inst, true);
          Pin newPin = null;
          if(design.getExactFamilyName().contains("virtex4")){
             newPin = new Pin(true,"Y",inst);
          }else if(design.getExactFamilyName().contains("virtex5")){
            //TODO V5
            newPin = new Pin(true,"D",inst);
          }
          newNet.getPins().add(newPin);
          newNet.replaceSource(newPin);
          netsToAdd.add(newNet);
          instancesToAdd.add(inst);
          Port newPort = new Port(pin.getInstance().getName()+"_outport",newPin);
          hardMacro.getPorts().add(newPort);
          newPin.setPort(newPort);
        }
        else{
         
          // CASE 3:
          // CASE 4:
          Pin p = net.getSource();
          Port newPort = new Port(pin.getInstance().getName()+"_outport",p);
          hardMacro.getPorts().add(newPort);
          p.setPort(newPort);
        }
      }
    }
  }
View Full Code Here

Examples of edu.byu.ece.rapidSmith.design.Pin

   */
  private void handlePassThruIOBs(Net net, ArrayList<Pin> pins) {
    System.out.println("WARNING: Design contains wires only connected to IOBs, net: " + net.getName());
    System.out.println("         This net has been divided by a LUT. Performance of signal will go down.");
    net.getPIPs().clear();
    Pin inPin = null;
   
    for(Pin pin : pins){
      // For each output IOB, create a new LUT and net
      if(!pin.isOutPin()){
        Net newOutputNet = new Net();
        Instance newLUT = createPassThruSlice();
        placeStaticSlice(newLUT, true);
        instancesToAdd.add(newLUT);
        newOutputNet.setName(net.getName() + "_OUTPUT");
        Pin newLUTPin = null;
        if(design.getExactFamilyName().contains("virtex4")){
           newLUTPin = new Pin(true,"Y",newLUT);
        }else if(design.getExactFamilyName().contains("virtex5")){
          //TODO V5
          newLUTPin = new Pin(true,"D",newLUT);
        }
        newOutputNet.getPins().add(newLUTPin);
        Pin newPin = null;
        if(design.getExactFamilyName().contains("virtex4")){
           newPin = new Pin(false,"G1",newLUT);
        }else if(design.getExactFamilyName().contains("virtex5")){
          //TODO V5
          newPin = new Pin(false,"D1",newLUT);
        }
        net.getPins().add(newPin);
        Port newPort = new Port(pin.getInstance().getName()+"_outport",
            newLUTPin);
        hardMacro.getPorts().add(newPort);
        newLUTPin.setPort(newPort);
      }
      else{
        inPin = pin;
      }
     
      // Remove the IOB instance
      instancesToRemove.add(pin.getInstance());
      net.getPins().remove(pin);
   
    if(net.getPins().size() < 1){
      failAndExit("ERROR: Check net: " + net.getName());
    }
    boolean containsBUFG = false;
    Pin bufgPin = null;
    for(Pin p : net.getPins()){
      if(p.getInstance().getType().equals(PrimitiveType.BUFG)){
        containsBUFG = true;
        bufgPin = p;
      }
View Full Code Here

Examples of edu.byu.ece.rapidSmith.design.Pin

        }
        else if(token.equals(VCC) || token.equals(POWER)){
          currNet.setType(NetType.VCC);
        }
        else if(token.equals(INPIN)){
          currPin = new Pin();
          currPin.setIsOutputPin(false);
          currNet.addPin(currPin);
          state = ParserState.PIN_INSTANCE_NAME;
          break;
        }
        else if(token.equals(OUTPIN)){
          currPin = new Pin();
          currPin.setIsOutputPin(true);
          if(currNet.getSource() != null){
            MessageGenerator.briefErrorAndExit("XDL Design Parser Error in file: "+ fileName +", The net " +
              currNet.getName() + " has two or more outpins (line " +
              lineNumber + ")");
          }
          currNet.addPin(currPin);
          state = ParserState.PIN_INSTANCE_NAME;
          break;
        }
        else if(token.equals(INOUT)){
          currPin = new Pin();
          currPin.setPinType(PinType.INOUT);
          currNet.addPin(currPin);
          state = ParserState.PIN_INSTANCE_NAME;
          break;
        }
        else{
          expect("wire, vcc or power, gnd or ground or ,",token, ParserState.NET_TYPE);
        }
        state = ParserState.NET_STATEMENT;
        break;
      case NET_STATEMENT:
        if(token.equals(PIP)){
          currPIP = new PIP();
          currNet.addPIP(currPIP);
          state = ParserState.PIP_TILE;
        }
        else if(token.equals(INPIN)){
          currPin = new Pin();
          currPin.setIsOutputPin(false);
          currNet.addPin(currPin);
          state = ParserState.PIN_INSTANCE_NAME;
        }
        else if(token.equals(OUTPIN)){
          currPin = new Pin();
          currPin.setIsOutputPin(true);
          if(currNet.getSource() != null){
            MessageGenerator.briefErrorAndExit("XDL Design Parser Error in file: "+ fileName +", The net " +
              currNet.getName() + " has two or more outpins (line " +
              lineNumber + ")");
          }
          currNet.addPin(currPin);
          state = ParserState.PIN_INSTANCE_NAME;
        }
        else if(token.equals(INOUT)){
          currPin = new Pin();
          currPin.setPinType(PinType.INOUT);
          currNet.addPin(currPin);
          state = ParserState.PIN_INSTANCE_NAME;
          break;
        }
View Full Code Here

Examples of edu.byu.ece.rapidSmith.design.Pin

  /**
   * This method routes all the connections within a net. 
   * @param i The number of the net (in sequence from the beginning)
   */
  public void routeNet(int i){
    Pin currSource = currNet.getSource();
    ArrayList<Node> sources = new ArrayList<Node>();
    currSources = new HashSet<Node>();
    boolean firstConnection = true;
   
    // Route each pin by itself
    for(Pin currSinkPin : currNet.getPins()){
      // Ignore the source pin
      if (currSinkPin.isOutPin()) continue;

      // This will print out until the Virtex 5 patch is complete
      if(dev.getPrimitiveExternalPin(currSinkPin) == null){
        MessageGenerator.printHeader("Pin Missing from V5 Patch: " + currNet.getName() + " " + currSinkPin.getName()
            + " " +currSinkPin.getInstance().getTile() + " " + currSinkPin.getInstance().getType());
        continue;
      }
     
      // Populate the current sink node
      currSink.tile = currSinkPin.getInstance().getTile();
      currSink.wire = dev.getPrimitiveExternalPin(currSinkPin);

      // Is this source from a buffer (likely a clock net)?
      boolean currNetOutputFromBUF = currSource.getInstance().getType().toString().contains("BUF");
     
      isCurrSinkAClkWire = (we.getWireDirection(currSink.wire).equals(WireDirection.CLK) ||
                  currSinkPin.getName().contains("CLK") ||
                  currSinkPin.getName().equals("C")) &&
                 (currNetOutputFromBUF ||
                  currSinkPin.getInstance().getType().toString().contains("BUF")
                 );

      // Add additional sources if this is not the first sink of the net being routed
      if(firstConnection){
        // Error checking
        if(dev.getPrimitiveExternalPin(currSource) == null){
          MessageGenerator.briefErrorAndExit("ERROR: Could not find valid external source pin name: " +
              currSource + " " + currSource.getInstance().getType());
        }
       
        // just add the original source
        Node n = new Node(currSource.getInstance().getTile(),
            dev.getPrimitiveExternalPin(currSource), null, 0);
        sources.add(n);
        currSources.add(n);
      }
      else{
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.