JAVA GUI <==> Linux C/C++ DRIVER INTERFACE

PLATFORM
========
The files in this directory are for building a Linux shared library (.so) that
can be dynamically loaded by the Java run-time, on Linux, and allow the GUI to
drive the demo APIs.
RedHat Linux Fedora Core5 2.6.15 kernel


PURPOSE
=======
This directory provides the necessary files (library) to allow a Java GUI program to invoke
C functions.  The C functions are the methods that light LEDs, read memory and run the tests.
They are the APIs of the demo.  Two important files need to be generated in order for Java
to call a C function.  The first file is a .so library that contains the C functions Java
will invoke.  JVM loads the library like a class.  The Second file is the .h header file that
is generated by javah to define the signatures of the methods Java expects to invoke.  This
header file must be generated by javah and used by the C/CPP file(s) when building the library.

The header file is created using the Java tool javah in the DemoUI project so that the
interface between Java and this library can be defined.  This file is also included by Cpp_Jni.cpp

Once the .so library is built, it is placed with the Java GUI .jar file for execution.

In this application, the library forms the basis for the entire C driver run-time.  On load and
initialization, the library creates the Platform and classes that connect to the PCIe driver and
instantiate all the Devices and APIs for access to the FPGA.  This is main() of the C world.


JAVA GUI DEVELOPMENT
====================
Currently the GUI is developed and maintained using NetBeans on a Windows
platform.  The resulting class files are used by javah in the Linux world.


BUILDING
========
(Make sure PLATFORM_DIR is defined and points to Linux2.6 build env)

make clean
make


Currently the required interface spec header file is produced from the Windows
NetBeans tool and is placed here manually.  The file is: com_latticesemi_lpa_apps_pcie_DemoUI.h
To produce it locally on a Linux system requires the Java 1.5.0 javah tool
(this version is not installed by default with Fedora Core5, so just using the
output from Windows tools)

Compiling to a shared lib is done with the Makefile.  All normal Fedora/GNU build tools
are used.  The tool

The Java JDK path is specified in the Makefile for the include files needed by
the JNI interface.  Luckily the default Java 1.4 files (included in Fedora
Core5) are valid to build the header file (from Java 1.5.0 NetBeans on
Windows) against.  This could be a problem in the future and may require yet
another env var to point to the user's desired Java JDK install.


