use of com.jopdesign.io.SysDevice in project jop by jop-devel.
the class MatrixBenchCMP method main.
public static void main(String[] args) {
// Initialization for benchmarking
int start = 0;
int stop = 0;
int time = 0;
System.out.println("Matrix Benchmark:");
System.out.println("Initializing data...");
long seed = 13;
initializeMultiplication(seed);
SysDevice sys = IOFactory.getFactory().getSysDevice();
for (int i = 0; i < sys.nrCpu - 1; i++) {
Runnable r = new MatrixBenchCMP(i + 1);
Startup.setRunnable(r, i);
}
System.out.println("Start benchmark!");
// Start of measurement
start = LowLevel.timeMillis();
// Start of all other CPUs
sys.signal = 1;
// Start of CPU0
int test0 = processCalculation();
while (true) {
synchronized (lock) {
if (endCalculation == N)
break;
}
}
// End of measurement
stop = LowLevel.timeMillis();
System.out.println("StartTime: " + start);
System.out.println("StopTime: " + stop);
time = stop - start;
System.out.println("TimeSpent: " + time);
}
use of com.jopdesign.io.SysDevice in project jop by jop-devel.
the class MatrixBenchCMP_RamCounter method main.
public static void main(String[] args) {
// Initialization for Ram access counter
int count0 = 0;
int count1 = 0;
int us0 = 0;
int us1 = 0;
int count_result = 0;
int us_result = 0;
System.out.println("Bandwidth:");
long seed = 13;
initializeMultiplication(seed);
SysDevice sys = IOFactory.getFactory().getSysDevice();
for (int i = 0; i < sys.nrCpu - 1; i++) {
Runnable r = new MatrixBenchCMP_RamCounter(i + 1);
Startup.setRunnable(r, i);
}
// Startpoint of measuring
count0 = sys.deadLine;
//us0 = sys.uscntTimer;
// Clockcycles
us0 = Native.rdMem(Const.IO_CNT);
// Start of all other CPUs
sys.signal = 1;
// Start of CPU0
int test0 = processCalculation();
while (true) {
synchronized (lock) {
if (endCalculation == N)
break;
}
}
// End of measurement
// Clockcycles
us1 = Native.rdMem(Const.IO_CNT);
count1 = sys.deadLine;
count_result = count1 - count0;
us_result = us1 - us0;
LowLevel.msg("RAM Accesses:", count_result);
LowLevel.lf();
LowLevel.msg("Time us:", us_result);
LowLevel.lf();
LowLevel.msg("in %:", count_result / (us_result / 100));
LowLevel.lf();
}
use of com.jopdesign.io.SysDevice in project jop by jop-devel.
the class CMPBuffer method main.
/**
* @param args
*/
public static void main(String[] args) {
msg = new Vector();
System.out.println("Buffer test start");
SysDevice sys = IOFactory.getFactory().getSysDevice();
if (sys.nrCpu < 3) {
System.out.println("Not enough CPUs for this test");
System.exit(-1);
}
Startup.setRunnable(new CMPBuffer(true), 1);
Startup.setRunnable(new CMPBuffer(false), 0);
// start the other CPUs
sys.signal = 1;
// print their messages
for (; ; ) {
int size = msg.size();
if (size != 0) {
StringBuffer sb = (StringBuffer) msg.remove(0);
System.out.println(sb);
}
}
}
use of com.jopdesign.io.SysDevice in project jop by jop-devel.
the class IncDecTest method main.
public static void main(String[] args) {
SysDevice sys = IOFactory.getFactory().getSysDevice();
for (int i = 1; i < sys.nrCpu; i++) {
Runnable r = new IncDecTest();
Startup.setRunnable(r, i - 1);
}
sys.signal = 1;
new IncDecTest().run();
System.out.println(cnt);
System.out.println(cnt);
Diagnostics.stat();
System.out.println(cnt);
}
use of com.jopdesign.io.SysDevice in project jop by jop-devel.
the class RunReferenceTransaction method main.
/**
* @param args
*/
public static void main(String[] args) {
SysDevice sys = IOFactory.getFactory().getSysDevice();
Runnable r = new RunReferenceTransaction();
Startup.setRunnable(r, 0);
sys.signal = 1;
while (true) {
int result = -1;
try {
result = Transaction.atomicMethod(1);
} catch (RetryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AbortException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(result);
}
}
Aggregations