Examples of FPGA


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

    // 2. Obtain part information
    /////////////////////////////////////////////////////////////////////
    XilinxConfigurationSpecification partInfo = cmdLineParser.getPartInfoExitOnError(options, bitstream, true);
   
    // 3. Create FPGA object
    FPGA fpga = new FPGA(partInfo);   
    // Configure FPGA
    fpga.configureBitstream(bitstream);
   
    String outputBitstreamFileName = cmdLineParser.getOutputFileNameStringExitOnError(options);
   
    /////////////////////////////////////////////////////////////////////
    // Perform Bitstreams Operations
    /////////////////////////////////////////////////////////////////////

    if (options.has(XOR_STRING) || options.has(OVERWRITE_STRING) ||options.has(CLEAR_STRING) ||
        options.has(AND_STRING) ||options.has(NOT_STRING) ||options.has(OR_STRING)
        || options.has(APPEND_OPTION_STRING)) {

      if (!options.has("r")) {
        System.err.println("Operational bitfile name needed for bitstream operation");
        cmdLineParser.printUsageAndExit();
      }
      String operationalBitstreamFileName = (String) options.valueOf("r");
     
      // load operational bitstream (this is an odd way of doing it but I am copying Ben's code)
      Bitstream opBitstream = BitstreamParser.parseBitstreamExitOnError(operationalBitstreamFileName);     
      System.out.print("Successfully loaded operational bitstream - ");
     
      // TODO: Make sure the two bitstreams are the same size. Same part?     
      FPGA fpga2 = new FPGA(partInfo);
      fpga2.configureBitstream(opBitstream);

     
      if(options.has(XOR_STRING))
      {
        FPGAOperation.operation(fpga, fpga2, FPGAOperation.OPERATORS.XOR );
        System.out.println("XOR operation performed"); // use this to find differences in BRAM data.
      }
      else if(options.has(AND_STRING))
      {
        FPGAOperation.operation(fpga, fpga2, FPGAOperation.OPERATORS.AND );
        System.out.println("AND operation performed");
      }
      else if(options.has(OR_STRING))
      {
        FPGAOperation.operation(fpga, fpga2, FPGAOperation.OPERATORS.OR );
        System.out.println("OR operation performed");
      }
      else if(options.has(NOT_STRING))
      {
        FPGAOperation.operation(fpga, fpga2, FPGAOperation.OPERATORS.NOT );
        System.out.println("NOT operation performed");
      }
      else if(options.has(OVERWRITE_STRING))
      {
        fpga.configureBitstream(opBitstream);
        System.out.println("Overwrite operation performed");
      }
      else if(options.has(CLEAR_STRING))
      { 
        // Find all of the frames that are configured on fpga2
        ArrayList<Frame> fpga2configuredFrames = fpga2.getConfiguredFrames();
       
        // Clear all the corresponding frames on fpga1
        for (Frame fd : fpga2configuredFrames) {
          fd.clear();
        }
View Full Code Here

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

    boolean printData = options.has(PRINT_DATA_OPTION);
   
    /////////////////////////////////////////////////////////////////////
    // 1. Get base FPGA object
    /////////////////////////////////////////////////////////////////////
    FPGA fpga1 = null;   
    fpga1 = cmdLineParser.createFPGAFromBitstreamOrReadbackFileExitOnError(options);
    XilinxConfigurationSpecification part = fpga1.getDeviceSpecification();
   
    /////////////////////////////////////////////////////////////////////
    // 2. Get compare FPGA object
    /////////////////////////////////////////////////////////////////////
    FPGA fpga2 = null;
    fpga2 = cmdLineParser.createFPGAFromBitstreamOrReadbackFileExitOnError(options,
        COMPARE_READBACK_OPTION,
        COMPARE_BITSTREAM_OPTION, part);

    /////////////////////////////////////////////////////////////////////
    // 3. Get mask FPGA object (if it exists)
    /////////////////////////////////////////////////////////////////////
    Bitstream maskBitstream = cmdLineParser.parseOptionalBitstreamFromOptionsExitOnError(options, MASK_BITSTREAM_OPTION, true);
    if (maskBitstream != null) {
      XilinxConfigurationSpecification partInfo = cmdLineParser.getPartInfoExitOnError(options, maskBitstream, true);
      FPGA maskFPGA = new FPGA(partInfo);   
      // Configure FPGA
      maskFPGA.configureBitstream(maskBitstream);
     
      // Now mask the two FPGAs
      FPGAOperation.MASKoperation(fpga1, maskFPGA);
      FPGAOperation.MASKoperation(fpga2, maskFPGA);
    }
View Full Code Here

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

  }
 
  public static void main(String[] args){
    Bitstream bitstream = BitstreamParser.parseBitstreamExitOnError(args[0]);
    XilinxConfigurationSpecification spec = DeviceLookup.lookupPartFromPartnameOrBitstreamExitOnError(bitstream);
    FPGA fpga = new FPGA(spec);
    fpga.configureBitstream(bitstream);
     
    Bitstream bitstreamMask = BitstreamParser.parseBitstreamExitOnError(args[1]);
    XilinxConfigurationSpecification specMask = DeviceLookup.lookupPartFromPartnameOrBitstreamExitOnError(bitstream);
    FPGA fpgaMask = new FPGA(specMask);
    fpgaMask.configureBitstream(bitstreamMask);
    int correct = 0, incorrect = 0, close = 0;
   
    for(Frame frame : fpga.getAllFrames()){
      if(frame.getData().isEmpty()) continue;
      Frame maskFrame = fpgaMask.getFrame(frame.getFrameAddress());
     
      //ArrayList<Integer> oneBits = new ArrayList<Integer>();
      int calcECC = calculateFrameECCBits(frame, maskFrame, spec);
      int trueECC = frame.getData().getECCBits();
      if(calcECC == trueECC){
View Full Code Here

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

    // Load up all the RapidSmith data structures
    Device dev = FileTools.loadDevice(partName + packageName);
   
    XilinxConfigurationSpecification spec = DeviceLookup.lookupPartV4V5V6(partName);

    FPGA fpga = new FPGA(spec);
   
    // Pick a tile...
    Tile tile = dev.getTile("CLBLL_X14Y65");
   
    // This class has some internal state
    Virtex5TileTranslation tileTranslator = new Virtex5TileTranslation();
   
    // In order to get the frame, the minor address is needed. 
    int minorAddress = 0;
   
    // *** Here is the good part, we get the FAR address from the tile *** ///
    // NOTE: These methods aren't fully developed yet and there are likely to be bugs
    int farAddress = tileTranslator.getFARFromTile(spec, tile, minorAddress);

    System.out.println("Top/Bottom: " + (FrameAddressRegister.getTopBottomFromAddress(spec, farAddress)==1 ? "bottom" : "top"));
    System.out.println("Block Type: " + FrameAddressRegister.getBlockTypeFromAddress(spec, farAddress));
    System.out.println("       Row: " + FrameAddressRegister.getRowFromAddress(spec, farAddress));
    System.out.println("    Column: " + FrameAddressRegister.getColumnFromAddress(spec, farAddress));
    System.out.println("     Minor: " + FrameAddressRegister.getMinorFromAddress(spec, farAddress));
   
    // Here we can get the frame
    Frame frame = fpga.getFrame(farAddress);
    System.out.println(frame.toString());
  }
View Full Code Here

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

   
    boolean printDetail =(options.has(PRINT_DETAIL));

   
    // 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");
        }
View Full Code Here

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

      System.err.println("Bitstreams do not match");
      System.exit(1);
    }

    // 3. Create FPGA object
    FPGA fullFPGA = new FPGA(partInfo);   
    FPGA staticFPGA = new FPGA(partInfo);   
    FPGA partialFPGA = new FPGA(partInfo);   

    // Configure FPGA
    fullFPGA.configureBitstream(fullBitstream);
    staticFPGA.configureBitstream(staticBitstream);
    partialFPGA.configureBitstream(partialBitstream);
   
    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();
     
View Full Code Here

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

   
    /////////////////////////////////////////////////////////////////////
    // 1. Parse bitstream
    /////////////////////////////////////////////////////////////////////
    FPGA fpga = null;
   
    fpga = cmdLineParser.createFPGAFromBitstreamOrReadbackFileExitOnError(options);

    /*
    if(options.has(READBACK_RAW_FILE_OPTION)){
      // get data from a readback file
      XilinxConfigurationSpecification part = cmdLineParser.getRequiredPartInfoExitOnError(options);
      String readbackfilename = (String) options.valueOf(READBACK_RAW_FILE_OPTION);   

      fpga = ReadbackFPGA.parseRawReadbackDataFromOptionsExitOnError(readbackfilename,
          part);
     
    } else {
      Bitstream bitstream = cmdLineParser.parseBitstreamFromOptionsExitOnError(options, true);
      // get data from a bitstream
      /////////////////////////////////////////////////////////////////////
      // 2. Obtain part information
      /////////////////////////////////////////////////////////////////////
      XilinxConfigurationSpecification partInfo = cmdLineParser.getPartInfoExitOnError(options, bitstream, true);
      fpga = new FPGA(partInfo);   
      // Configure FPGA
      fpga.configureBitstream(bitstream);

    }
    */
   
    /////////////////////////////////////////////////////////////////////
    // 3. Parameters
    /////////////////////////////////////////////////////////////////////
   
    // Start frame
    int startFrame = cmdLineParser.getIntegerStringExitOnError(options, FAR_START_ADDRESS_OPTION, 16, 0);

    // Number of frames
    XilinxConfigurationSpecification partInfo = fpga.getDeviceSpecification();
    int defaultNumberOfFrames = FrameAddressRegister.getNumberOfFrames(partInfo);
    int numberOfFrames = cmdLineParser.getIntegerStringExitOnError(options, NUMBER_OF_FRAMES_OPTION, 10, defaultNumberOfFrames);     

    System.out.println(fpga.getFrameContents(startFrame, numberOfFrames));
 
View Full Code Here

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

  }
 
  public FPGA createFPGAFromBitstreamOrReadbackFileExitOnError(OptionSet options, String readback_raw_file_option,
      String regular_bitstream_file_option, XilinxConfigurationSpecification part) {

    FPGA fpga = null;
   
    if(options.has(readback_raw_file_option)){
      // get data from a readback file
      if (part == null)
        part = getRequiredPartInfoExitOnError(options);
      String readbackfilename = (String) options.valueOf(readback_raw_file_option);   
     
      fpga = ReadbackFPGA.parseRawReadbackDataFromOptionsExitOnError(readbackfilename,
          part);

    } else {
      Bitstream bitstream = parseRequiredBitstreamFromOptionsExitOnError(options, regular_bitstream_file_option, true);
      // get data from a bitstream
      /////////////////////////////////////////////////////////////////////
      // 2. Obtain part information
      /////////////////////////////////////////////////////////////////////
      XilinxConfigurationSpecification partInfo = getPartInfoExitOnError(options, bitstream, true);
      fpga = new FPGA(partInfo);   
      // Configure FPGA
      fpga.configureBitstream(bitstream);
    }
    return fpga;
  }
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.