/*! flashbench -- Flash memory benchmark for ZTEX USB-FPGA Module 1.11 Copyright (C) 2009-2011 ZTEX GmbH. http://www.ztex.de This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/. !*/ import java.io.*; import java.util.*; import ch.ntb.usb.*; import ztex.*; // ***************************************************************************** // ******* ParameterException ************************************************** // ***************************************************************************** // Exception the prints a help message class ParameterException extends Exception { public final static String helpMsg = new String ( "Parameters:\n"+ " -d Device Number (default: 0)\n" + " -s Number of sectors to be tested, -1 means all (default: 10000)\n" + " -f Force uploads\n" + " -p Print bus info\n" + " -w Enable certain workarounds which may be required for vmware + windows\n"+ " -h This help" ); public ParameterException (String msg) { super( msg + "\n" + helpMsg ); } } // ***************************************************************************** // ******* Test0 *************************************************************** // ***************************************************************************** class FlashBench extends Ztex1v1 { // ******* FlashBench ********************************************************** // constructor public FlashBench ( ZtexDevice1 pDev ) throws UsbException { super ( pDev ); } // ******* testRW ************************************************************** // measures read + write performance public double testRW ( int num ) throws UsbException, InvalidFirmwareException, CapabilityException { int secNum = 2048 / flashSectorSize(); byte[] buf1 = new byte[flashSectorSize() * secNum]; byte[] buf2 = new byte[flashSectorSize() * secNum]; int errors = 0; long t0 = new Date().getTime(); for ( int i=0; i=args.length) throw new Exception(); devNum = Integer.parseInt( args[i] ); } catch (Exception e) { throw new ParameterException("Device number expected after -d"); } } if ( args[i].equals("-s") ) { i++; try { if (i>=args.length) throw new Exception(); sectors = Integer.parseInt( args[i] ); } catch (Exception e) { throw new ParameterException("Number of sectors expected after -s"); } } else if ( args[i].equals("-f") ) { force = true; } else if ( args[i].equals("-p") ) { bus.printBus(System.out); System.exit(0); } else if ( args[i].equals("-p") ) { bus.printBus(System.out); System.exit(0); } else if ( args[i].equals("-w") ) { workarounds = true; } else if ( args[i].equals("-h") ) { System.err.println(ParameterException.helpMsg); System.exit(0); } else throw new ParameterException("Invalid Parameter: "+args[i]); } // create the main class FlashBench ztex = new FlashBench ( bus.device(devNum) ); ztex.certainWorkarounds = workarounds; // upload the firmware if necessary if ( force || ! ztex.valid() || ! ztex.dev().productString().equals("flashbench for UFM 1.11") ) { System.out.println("Firmware upload time: " + ztex.uploadFirmware( "flashbench.ihx", force ) + " ms"); } // print some information System.out.println("Capabilities: " + ztex.capabilityInfo(", ")); System.out.println("Enabled: " + ztex.flashEnabled()); System.out.println("Size: " + ztex.flashSize()+" Bytes"); // ztex.printMmcState(); if ( sectors<1 || sectors>ztex.flashSectors() ) sectors = ztex.flashSectors(); System.out.println("Read + Write Performance: " + ztex.testRW(sectors) + "kb/s \n"); int seed = (int) Math.round(65535*Math.random()); System.out.println("Write Performance: " + ztex.testW(sectors, seed) + "kb/s "); System.out.println("Read Performance: " + ztex.testR(sectors, seed) + "kb/s \n"); } catch (Exception e) { System.out.println("Error: "+e.getLocalizedMessage() ); } } }

Error running this command: diff -w -U 5 "" "/tmp/1aVaj3"

diff: : No such file or directory