Package edu.byu.ece.rapidSmith.design

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


        }
        break;
      case INSTANCES:
        // populate attributes
        subModels[0].removeRows(0, subModels[0].rowCount());
        Instance instance = explorer.design.getInstance(proxyModel.data(index.row(),0).toString());
        for(Attribute attribute : instance.getAttributes()){
          ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
          items.add(new DesignItem(attribute.getPhysicalName(), attribute));
          items.add(new DesignItem(attribute.getLogicalName(), attribute));
          items.add(new DesignItem(attribute.getValue(), attribute));
          subModels[0].appendRow(items);
View Full Code Here


       
    // Handle each group of sinks separately, allocating TIEOFF to those sinks according
    // to priority
    for(PinSorter ps : pinSwitchMatrixMap.values()){
      ssLoop : for(StaticSink ss : ps.useTIEOFF){
        Instance inst = updateTIEOFF(ss.switchMatrixSink.tile, ss.pin.getNet(), true);
        if(dev.getFamilyType().equals(FamilyType.VIRTEX5)){       
          String[] fanWireNames = null;
          if((fanWireNames = fanBounceMap.get(we.getWireName(ss.switchMatrixSink.wire))) != null){
            Node nn = new Node(inst.getTile(), we.getWireEnum(fanWireNames[0]), null, 0);
            for(String fanWireName : fanWireNames){
              nn.setWire(we.getWireEnum(fanWireName));
              boolean reservedWire = addReservedGNDVCCNode(nn, ss.pin);
              if(reservedWire){
                break;
              }
              if(!reservedWire && fanWireName.equals(fanWireNames[fanWireNames.length-1])){
                ps.useSLICE.add(ss);
                continue ssLoop;
              }
            }
          }
        }
       
        // Find the correct net corresponding to this TIEOFF if it exists
        Net matchingNet = null;
        for(Net net : inst.getNetList()){
          if(net.getType().equals(ss.pin.getNet().getType()) && !net.getSource().getName().equals("KEEP1")){
            matchingNet = net;
            break;
          }
        }
        if(matchingNet == null){
          matchingNet = createNewNet(ss.pin.getNet(), ss.pin);
          finalStaticNets.add(matchingNet);
          inst.addToNetList(matchingNet);
          createAndAddPin(matchingNet, inst, true);
        }
        else{
          matchingNet.addPin(ss.pin);
          ss.pin.getInstance().addToNetList(matchingNet);
        }
      }
     
      for(StaticSink ss : ps.attemptTIEOFF){
        Instance inst = updateTIEOFF(ss.switchMatrixSink.tile, ss.pin.getNet(), false);
        // Special case with CLK pins BRAMs on Virtex5 devices, when competing for FANs against GND Nets
        if(dev.getFamilyType().equals(FamilyType.VIRTEX5)){
          int switchBoxSink = ss.switchMatrixSink.wire;     
         
          if(we.getWireName(ss.switchMatrixSink.getWire()).startsWith("BYP_B")){
            Node nn = new Node(inst.getTile(), we.getWireEnum(we.getWireName(switchBoxSink).replace("_B","")), null, 0);
            if(!addReservedGNDVCCNode(nn, ss.pin)){
              // we need to use a SLICE
              ps.useSLICE.add(ss);
              continue;
            }
          }
          else if(switchBoxSink == v5ctrlWires[0] || switchBoxSink == v5ctrlWires[1] || switchBoxSink == v5ctrlWires[2] || switchBoxSink == v5ctrlWires[3]){
            Node nn = new Node(inst.getTile(), we.getWireEnum(we.getWireName(switchBoxSink).replace("_B","")), null, 0);
            if(!addReservedGNDVCCNode(nn, ss.pin)){
              // we need to use a SLICE
              ps.useSLICE.add(ss);
              continue;
            }
          }else if(ss.pin.getInstance().getPrimitiveSite().getType().equals(PrimitiveType.DSP48E) && ss.pin.getName().contains("CEP")){
            Node nn = new Node(inst.getTile(), we.getWireEnum("CTRL1"), null, 0);
            if(!addReservedGNDVCCNode(nn, ss.pin)){
              // we need to use a SLICE
              ps.useSLICE.add(ss);
              continue;
            }
          }
          else if(ss.pin.getName().contains("ENBL")){
            Node nn = new Node(inst.getTile(), we.getWireEnum("CTRL2"), null, 0);
            if(!addReservedGNDVCCNode(nn, ss.pin)){
              // we need to use a SLICE
              ps.useSLICE.add(ss);
              continue;
            }
          }
        }
       
        Net matchingNet = null;
       
        // Find the correct net corresponding to this TIEOFF if it exists
        for(Net net : inst.getNetList()){
          if(net.getType().equals(ss.pin.getNet().getType()) && !net.getSource().getName().equals("HARD1")){
            matchingNet = net;
            break;
          }
        }
        if(matchingNet == null){
          matchingNet = createNewNet(ss.pin.getNet(), ss.pin);
          finalStaticNets.add(matchingNet);
          inst.addToNetList(matchingNet);
          createAndAddPin(matchingNet, inst, false);
        }
        else{
          matchingNet.addPin(ss.pin);
          ss.pin.getInstance().addToNetList(matchingNet);
        }
      }
     
      if(ps.useSLICE.size() > 0){
        ArrayList<Pin> gnds = new ArrayList<Pin>();
        ArrayList<Pin> vccs = new ArrayList<Pin>();
        for(StaticSink ss : ps.useSLICE){
          if(ss.pin.getNet().getType().equals(NetType.GND)){
            gnds.add(ss.pin);
          }
          else if(ss.pin.getNet().getType().equals(NetType.VCC)){
            vccs.add(ss.pin);
          }
        }   
       
        if(gnds.size() > 0){
          // Create the new net
          Net newNet = createNewNet(NetType.GND, gnds);
          finalStaticNets.add(newNet);

          // Create new instance of SLICE primitive to get source
          Instance currInst = findClosestAvailableSLICE(ps.useSLICE.get(0).switchMatrixSink.tile, NetType.GND);
          if(currStaticSourcePin != null){
            currInst.addToNetList(newNet);
            newNet.addPin(currStaticSourcePin);
          }
          else{
            router.design.addInstance(currInst);
            currInst.addToNetList(newNet);
            Pin source = new Pin(true, slicePin, currInst);
            newNet.addPin(source);         
          }
        }
        if(vccs.size() > 0){
          // Create the new net
          Net newNet = createNewNet(NetType.VCC, vccs);
          finalStaticNets.add(newNet);

          // Create new instance of SLICE primitive to get source
          Instance currInst = findClosestAvailableSLICE(ps.useSLICE.get(0).switchMatrixSink.tile, NetType.VCC);

          if(currStaticSourcePin != null){
            currInst.addToNetList(newNet);
            newNet.addPin(currStaticSourcePin);
          }
          else{
            router.design.addInstance(currInst);
            currInst.addToNetList(newNet);
            Pin source = new Pin(true, slicePin, currInst);
            newNet.addPin(source);
          }
        }
      }
View Full Code Here

      currentTile = dev.getTile(row, column);
      if(currentTile != null && currentTile.getPrimitiveSites() != null){
        for(PrimitiveSite site : currentTile.getPrimitiveSites()){
          if(site.getType().equals(PrimitiveType.SLICEL) || site.getType().equals(PrimitiveType.SLICEM)){
            if(!router.design.getUsedPrimitiveSites().contains(site)){
              Instance returnMe = new Instance();
              HashMap<String, Attribute> attributeMap = new HashMap<String, Attribute>();
              attributeMap.put("_NO_USER_LOGIC", new Attribute("_NO_USER_LOGIC","",""));
             
              attributeMap.put(srcTypeString, new Attribute(srcTypeString,"",slicePin));
             
              returnMe.place(site);
              returnMe.setType(PrimitiveType.SLICEL);
              returnMe.setAttributes(attributeMap);
              returnMe.setName("XDL_DUMMY_" + returnMe.getTile() + "_" + site.getName());
              currStaticSourcePin = null;
              return returnMe;             
            }
            else if(isVirtex5){
              // Check all the LUTs in this slice
              Instance i = router.design.getInstanceAtPrimitiveSite(site);
              String[] letters = {"A","B","C","D"};
              for(String letter : letters){
                if(i.testAttributeValue(letter+"5LUT", "#OFF") &&
                   i.testAttributeValue(letter+"6LUT", "#OFF") &&
                   !i.hasAttribute("_GND_SOURCE") &&
                   !i.hasAttribute("_VCC_SOURCE")){
                  i.addAttribute(new Attribute(new Attribute(srcTypeString,"",letter)));
                  currStaticSourcePin = new Pin(true, letter, i);
                  i.addPin(currStaticSourcePin);
                  return i;
                }
              }
            }
          } 
View Full Code Here

   * @return The created/updated TIEOFF.
   */
  private Instance updateTIEOFF(Tile tile, Net net, boolean needHard1){
    String tileSuffix = tile.getTileNameSuffix();
    String instName = "XDL_DUMMY_INT" + tileSuffix + "_TIEOFF" + tileSuffix;
    Instance currInst = router.design.getInstance(instName);
    Attribute vccAttr = needHard1 ? hard1Attr : keep1Attr;
    // Add the appropriate attribute if instance already exists
    if(currInst != null){
      if(net.getType().equals(NetType.VCC)){
        // Add HARD1
        if(!currInst.hasAttribute(vccAttr.getPhysicalName())){
          currInst.addAttribute(vccAttr);
        }
      }
      else if(net.getType().equals(NetType.GND)){
        if(!currInst.hasAttribute(keep0Attr.getPhysicalName())){
          currInst.addAttribute(keep0Attr);
        }
      }
    }
    // Add the instance (it doesn't exist yet)
    else{
      currInst = new Instance();
      currInst.place(router.dev.getPrimitiveSite("TIEOFF" + tileSuffix));
      currInst.setType(PrimitiveType.TIEOFF);
      currInst.setName(instName);
      currInst.addAttribute(noUserLogicAttr);
      if(net.getType().equals(NetType.VCC)){
        // Add HARD1
        currInst.addAttribute(vccAttr);
      }
      else if(net.getType().equals(NetType.GND)){
        currInst.addAttribute(keep0Attr);
      }
      router.design.addInstance(currInst);
    }

    return currInst;
View Full Code Here

TOP

Related Classes of edu.byu.ece.rapidSmith.design.Instance

Copyright © 2018 www.massapicom. 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.