History log of /gem5/util/m5/jni_gem5Op.c
Revision Date Author Comments
# 11358:cd41493e8b7e 29-Feb-2016 Prakash Ramrakhyani <prakash.ramrakhyani@arm.com>

util: update Java JNI interface to m5ops

Synchronize with
ab19693da "pseudo inst,util: Add optional key to initparam pseudo instruction"


# 8547:5979b029bbb4 13-Sep-2011 Prakash Ramrakhyani <prakash.ramrakhyani@arm.com>

gem5ops: Implement Java JNI for gem5Ops

These ops allow gem5 ops to be called from within java programs like the following:
import jni.gem5Op;

public class HelloWorld {

public static void main(String[] args) {
gem5Op gem5 = new gem5Op();
System.out.println("Rpns0:" + gem5.rpns());
System.out.println("Rpns1:" + gem5.rpns());
}

static {
System.loadLibrary("gem5OpJni");
}
}

When building you need to make sure classpath include gem5OpJni.jar:
javac -classpath $CLASSPATH:/path/to/gem5OpJni.jar HelloWorld.java

and when running you need to make sure both the java and library path are set:
java -classpath $CLASSPATH:/path/to/gem5OpJni.jar -Djava.library.path=/path/to/libgem5OpJni.so HelloWorld