Package edu.byu.ece.rapidSmith.bitstreamTools.configuration

Examples of edu.byu.ece.rapidSmith.bitstreamTools.configuration.FrameAddressRegister


            e.printStackTrace();
        }
       
        XilinxConfigurationSpecification spec = DeviceLookup.lookupPartV4V5V6withPackageName(bitstream.getHeader().getPartName());
       
        FrameAddressRegister far = new FrameAddressRegister(spec);
       
        Map<Integer, Integer> columnMap = new LinkedHashMap<Integer, Integer>();
       
        PacketList packets = bitstream.getPackets();
        for (Packet p : packets) {
            if (p.getRegType() == RegisterType.LOUT) {
                int farAddress = p.getData().get(0);
                far.setFAR(farAddress);
                if (far.getRow() != 0 || far.getTopBottom() != 0) {
                    break;
                }
                int column = far.getColumn();
                int frame = far.getMinor();
                columnMap.put(column, frame + 1);
                //System.out.println("TB: " + far.getTopBottom() + ", Block: " + far.getBlockType() + ", Row: " + far.getRow() + ", Column: " + far.getColumn() + ", Frame: " + far.getMinor());
            }
        }
       
View Full Code Here


            e.printStackTrace();
        }
       
        XilinxConfigurationSpecification spec = DeviceLookup.lookupPartV4V5V6withPackageName(bitstream.getHeader().getPartName());
       
        FrameAddressRegister far = new FrameAddressRegister(spec);
       
        Set<Integer> topRows = new HashSet<Integer>();
        Set<Integer> bottomRows = new HashSet<Integer>();
       
        PacketList packets = bitstream.getPackets();
        for (Packet p : packets) {
            if (p.getRegType() == RegisterType.LOUT) {
                int farAddress = p.getData().get(0);
                far.setFAR(farAddress);
                int currentRow = far.getRow();
                int currentTopBottom = far.getTopBottom();
                Set<Integer> rowSet = (currentTopBottom == 0) ? topRows : bottomRows;
                rowSet.add(currentRow);
            }
        }
View Full Code Here

    }
  }

  public static void printIntermediateFAR(XilinxConfigurationSpecification spec,
      int farAddress, int frames) {
    FrameAddressRegister far = new FrameAddressRegister(spec,farAddress);
    for (int i = 0; i < frames; i++) {
      System.out.println("Frame #"+i+":"+far);
      far.incrementFAR();
    }
  }
View Full Code Here

      System.exit(1);
    }

    ArrayList<Integer> diffFARs = new ArrayList<Integer>();
   
    FrameAddressRegister far = new FrameAddressRegister(spec1);
   
    // Diff counters
    int configuredDataNonEmptyDifferences = 0;
    int configuredFPGA1EmptyDifferences = 0;
    int configuredFPGA2EmptyDifferences = 0;
    int configuredFramesEqualWithData = 0;
    int configuredFramesEqualEmpty = 0;
   
    int fpga1ConfiguredFrames = 0;
    int fpga2ConfiguredFrames = 0;
    int fpga1NonEmptyFrames = 0;
    int fpga2NonEmptyFrames = 0;
   
    for (; far.validFARAddress(); far.incrementFAR()) {
      Frame f1 = fpga1.getFrame(far);
      Frame f2 = fpga2.getFrame(far);
      String msg = null;

      // Collect statistics
      if (f1.isConfigured()) {
        fpga1ConfiguredFrames++;
        if (!f1.getData().isEmpty())
          fpga1NonEmptyFrames++;
      }
      if (f2.isConfigured()) {
        fpga2ConfiguredFrames++;
        if (!f2.getData().isEmpty())
          fpga2NonEmptyFrames++;
      }
     
      // Check #1: see if frames are configured or not
      if ( !f1.isConfigured() || !f2.isConfigured()) {
        String umsg = null;
       
        // Don't create a message if the ignore unconfigured frames option was set
        if (ignoreUnconfiguredFrames) continue;
       
        if (!f1.isConfigured() && f2.isConfigured() ) {         
          umsg = "FPGA 1 not configured";
          if (!f2.getData().isEmpty())
            umsg += " (non empty frame in FPGA2)";
          else
            umsg += " (empty frame in FPGA2)";
        } else if (f1.isConfigured() && !f2.isConfigured()) {
          umsg = "FPGA 2 not configured";
          if (!f1.getData().isEmpty())
            umsg += " (non empty frame in FPGA1)";
          else
            umsg += " (empty frame in FPGA1)";
        }
        msg = umsg;
       
      } else {
     
        // both frames configured
        FrameData d1 = f1.getData();
        FrameData d2 = f2.getData();
        if (!d1.isEqual(d2)) {
         
          diffFARs.add(far.getAddress());
         
          if (d1.isEmpty())
            configuredFPGA1EmptyDifferences++;
          else if (d2.isEmpty())
            configuredFPGA2EmptyDifferences++;
          else
            configuredDataNonEmptyDifferences++;
         
          msg = "Frames differ in contents";
          if (printData) {
            msg += "\nFPGA 1\n";
            msg += d1.toString();
            msg += "FPGA2 2\n";
            msg += d2.toString();
          }
        } else {
          // frame data is equal
          if (d1.isEmpty())
            configuredFramesEqualEmpty++;
          else
            configuredFramesEqualWithData++;
        }
     
      }

      // print out message if there is one
      if (!silentMode && msg != null) {
        System.out.println(far.getHexAddress() + " (" + far + "):"+ msg);
      }
     
    } 

    // Print summary
View Full Code Here

    // Create FPGA object
    FPGA fpga = new FPGA(partInfo);   
    // Configure FPGA
    fpga.configureBitstream(bitstream);

    FrameAddressRegister far = new FrameAddressRegister(partInfo, 0);
   
    boolean empty = false;
    boolean nonempty = false;
    int startFar = 0;
    int count = 0;

    while (far.validFARAddress()) {
      Frame f = fpga.getFrame(far);     
      if (!f.isConfigured() || f.getData().isEmpty()) {
        if (printDetail) {
          if (f.isConfigured())
            System.out.println(far + " = EMPTY");
        }
        if (empty) {
          // Another empty: add count
          count++;
        } else {
          if (!nonempty) {
            // In no state. Initialize
            startFar = far.getAddress();
            count = 1;
            empty = true;
          } else {
            // End of non empty state
            System.out.println("0x"+Integer.toHexString(startFar)+" ("+count+" frames) "+far);
            empty = true; nonempty = false;
            count = 1;
            startFar = far.getAddress();
          }
        }
      } else {
        if (nonempty) {
          // another non-empty
          count++;
        } else {
          if (!empty) {
            // In no state. Initialize
            startFar = far.getAddress();
            count = 1;
            nonempty = true;
          } else {           
            // End of empty state
            if (false)
              System.out.println("FAR=0x"+Integer.toHexString(startFar)+" count="+count+" empty "+far);
            empty = false; nonempty = true;
            count = 1;
            startFar = far.getAddress();
          }
        }
        if (printDetail) System.out.println(far);
      }
      far.incrementFAR();
    }
  }
View Full Code Here

   
    boolean staticChanged = false;
    boolean partialChanged = false;
   
    // Iterate over all of the frames
    FrameAddressRegister far = new FrameAddressRegister(partInfo);
    for (; far.validFARAddress(); far.incrementFAR()) {
      //System.out.println(far);
     
      Frame fullFrame = fullFPGA.getFrame(far);
      if (!fullFrame.isConfigured()) {
        System.err.println("Error: Unconfigured Frame in the full bitstream at FAR:"+far.getHexAddress());
        System.exit(1);
      }
     
      Frame staticFrame = staticFPGA.getFrame(far);
      Frame partialFrame = partialFPGA.getFrame(far);

      FrameData fullData = fullFrame.getData();
      FrameData staticData = staticFrame.getData();
      FrameData partialData = partialFrame.getData();
     
      if (staticFrame.isConfigured() && partialFrame.isConfigured()) {
        // Both static and partial frames configured
        if (fullData.isEqual(staticData)) {
          if (fullData.isEqual(partialData)) {
            // TODO: All equal: could probably remove the partial frame (future)
            if (verbose)
              System.out.println(far.getHexAddress()+" Static, full, and partial all equal");           
          } else {
            // full and static equal, partial not equal
            System.out.println("Full and static equal, partial not equal:"+far.getHexAddress());           
            if (printData) {
              System.out.println("Full Data\n"+fullData);
              System.out.println("Static Data\n"+staticData);             
              System.out.println("Partial Data\n"+partialData);             
            }
          }       
        } else {
          // full is not equal to static
          if (fullData.isEqual(partialData)) {
            // This is OK. Don't need to do anything here.
            if (staticData.isEmpty())
              System.out.println(far.getHexAddress() + " Full and partial equal, static empty");
            else
              System.out.println(far.getHexAddress() + " Full and partial equal, static not equal and not empty");
            if (printData) {
              System.out.println("Full Data\n"+fullData);
              System.out.println("Static Data\n"+staticData);             
              System.out.println("Partial Data\n"+partialData);             
            }
          } else {
            // Full data is NOT equal to partial data
            if (staticData.isEqual(partialData)) {
              System.out.println("*** Full not equal but static and partial equal:"+far.getHexAddress());                         
            } else {
              System.out.println("*** All three not equal:"+far.getHexAddress());                         
            }
          }
        }     
      } else if (staticFrame.isConfigured()) {
        // static frame is configured and partial frame is NOT configured
        if (fullData.isEqual(staticData)) {
          if (verbose)
            System.out.println(far.getHexAddress()+" Static and full Equal (partial not configured)");
        } else {
          if (!fullData.isEmpty()) {
            // full has data
            if (!staticData.isEmpty()) {
              // Full and static have data
              System.out.println(far.getHexAddress()+" * Full and static NOT equal (partial not configured)");
              if (printData) {
                System.out.println("Full Data\n"+fullData);
                System.out.println("Static Data\n"+staticData);
              }
            } else {
              // full has data , static is empty
              System.out.println(far.getHexAddress()+" * Full has data, static is empty (partial not configured)");
            }
          } else {
            // full does not have data
            System.out.println(far.getHexAddress()+" * Full empty and static NOT equal (partial not configured)");
          }
          if (!patchPartial) {
            staticData.setData(fullData);
            staticChanged = true;
          } else {
            partialData.setData(fullData);
            partialChanged = true;
          }
        }
      } else if (partialFrame.isConfigured()) {
        // partial frame is configured, static frame is NOT configured
        if (fullData.isEqual(partialData)) {
          System.out.println("Partial and full Equal (static not configured):"+far.getHexAddress());
        } else {
          System.out.println("Partial Not Equal:"+far.getHexAddress());         
        }
      } else {
        // neither frame is configured
        if (!fullData.isEmpty()) {
          System.out.println("Frame not empty and static/partial not conifgured:"+far);
View Full Code Here

TOP

Related Classes of edu.byu.ece.rapidSmith.bitstreamTools.configuration.FrameAddressRegister

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.