Line 1... |
Line 1... |
/*!
|
/*!
|
flashbench -- Flash memory benchmark for ZTEX USB-FPGA Module 1.15
|
flashbench -- Flash memory benchmark for ZTEX USB-FPGA Modules 1.15
|
Copyright (C) 2009-2011 ZTEX GmbH.
|
Copyright (C) 2009-2014 ZTEX GmbH.
|
http://www.ztex.de
|
http://www.ztex.de
|
|
|
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License version 3 as
|
published by the Free Software Foundation.
|
published by the Free Software Foundation.
|
Line 85... |
Line 85... |
if ( diffs!=0 )
|
if ( diffs!=0 )
|
errors+=1;
|
errors+=1;
|
}
|
}
|
System.out.println("testRW: " + errors +" errors detected");
|
System.out.println("testRW: " + errors +" errors detected");
|
|
|
return num*512.0/(new Date().getTime() - t0);
|
return num*flashSectorSize()*1.0/(new Date().getTime() - t0);
|
}
|
}
|
|
|
// ******* testW **************************************************************
|
// ******* testW **************************************************************
|
// measures write performance
|
// measures write performance
|
public double testW ( int num, int seed ) throws UsbException, InvalidFirmwareException, CapabilityException {
|
public double testW ( int num, int seed ) throws UsbException, InvalidFirmwareException, CapabilityException {
|
Line 103... |
Line 103... |
buf[k] = (byte) (seed & 255);
|
buf[k] = (byte) (seed & 255);
|
seed+=79;
|
seed+=79;
|
}
|
}
|
flashWriteSector(i,j,buf);
|
flashWriteSector(i,j,buf);
|
}
|
}
|
return num*512.0/(new Date().getTime() - t0);
|
return num*flashSectorSize()*1.0/(new Date().getTime() - t0);
|
}
|
}
|
|
|
// ******* testR **************************************************************
|
// ******* testR **************************************************************
|
// measures read performance
|
// measures read performance
|
public double testR ( int num, int seed ) throws UsbException, InvalidFirmwareException, CapabilityException {
|
public double testR ( int num, int seed ) throws UsbException, InvalidFirmwareException, CapabilityException {
|
Line 130... |
Line 130... |
}
|
}
|
if ( diffs!=0 )
|
if ( diffs!=0 )
|
errors+=1;
|
errors+=1;
|
}
|
}
|
System.out.println("testR: " + errors +" errors detected");
|
System.out.println("testR: " + errors +" errors detected");
|
return num*512.0/(new Date().getTime() - t0);
|
return num*flashSectorSize()*1.0/(new Date().getTime() - t0);
|
}
|
}
|
|
|
// ******* main ****************************************************************
|
// ******* main ****************************************************************
|
public static void main (String args[]) {
|
public static void main (String args[]) {
|
|
|