nxm.ice.lib
Class HPCore

java.lang.Object
  extended by nxm.ice.lib.HPCore
All Implemented Interfaces:
nxm.sys.inc.Constants, nxm.sys.inc.DataTypes
Direct Known Subclasses:
BOT, Demod, FFT, FIR, HPCoreNative, Noop, R2C, Tuner

public class HPCore
extends java.lang.Object
implements nxm.sys.inc.Constants, nxm.sys.inc.DataTypes

Structure for a Code-Once-Run-Everywhere library function This function may have implementations in more than one language. The NeXtMidas policy is to code HPCore functions in C or Fortran to allow code sharing with other versions of Midas. All other framework and GUI code is in Java for portability and deployment options. Typically, math functions needed by GUIs are included in the SYS tree. Some functions are coded here in Java and in C for performance comparisons. The Java code for each function library exposes methods for setting and getting each of the library's properties. If native code is used, the Java wrapper loads the native code and calls the standard library interface routines as appropriate. This class implements a factory for instantiating alternate native implementations. Library names should adhere to the following naming conventions: Foo.java - the java implementation of the function Foo and/or native wrapper stubs Foo$CPU.c - the CPU native implementation of Foo (C) Foo$GPU.c - the GPU implementation of Foo (CUDA) Foo$VHS.c - the Verilator Hardware Simulator implementation of Foo (C++) Foo$ICE.c - the ICE FPGA implementation of Foo (FPGA)

Author:
Jeff Schoen

Field Summary
static int CPU
           
static java.lang.String factoryList
           
static int GPU
           
static int ICE
           
 int implementation
           
static int JDK
           
static int VHS
           
 
Fields inherited from interface nxm.sys.inc.Constants
ANGULAR_VELOCITY_PRECESSING_COR, B1G, B1K, B1M, B1T, B64K, CYC2RAD, DEF_EARTH_ANGULAR_VELOCITY, DEG2METERS, DEG2RAD, E, EARTH_ANGULAR_VELOCITY, EARTH_ECCENTRICITY, EARTH_EQUATORIAL_RADIUS, EARTH_FLATTENING_FACTOR, EARTH_GRAV_CONSTANT_W_ATMOS, EARTH_GRAV_CONSTANT_W_ATMOS_ORIG, EARTH_GRAV_CONSTANT_WO_ATMOS, EARTH_GRAV_CONSTANT_WO_ATMOS_ORIG, FEET2METERS, HALFPI, IAU_EARTH_ANGULAR_VELOCITY, LN2DB, LN2LOG, LNTEN, MASS_OF_EARTH_W_ATMOS, METERS2DEG, METERS2FEET, METERS2NM, METERS2SM, NM2FEET, NM2METERS, PI, POLAR_RADIUS_IN_METERS, POLAR_RADIUS_OF_CURVATURE, RAD2CYC, RAD2DEG, SECOND_EARTH_ECCENTRICITY, SM2FEET, SM2METERS, SPEED_OF_LIGHT, TWOPI
 
Fields inherited from interface nxm.sys.inc.DataTypes
ALAW, ASCII, BMAX, BMIN, BOOL, BYTE, COMPLEX, CONVERT_TYPE_LIST, CRAY, DATA_MODE_LIST, DATA_TYPE_LIST, DMAX, DMIN, DOUBLE, EEEI, falseStates, FLOAT, FMAX, FMIN, IEEE, IMAX, IMIN, INT, LMAX, LMIN, LONG, MATRIX, modeList, MULT_DATA_MODE_LIST, NIBBLE, NMAX, NMIN, NONHOMOGENEOUS, NUMBER, NUMERIC_DATA_TYPE_LIST, numericTypeList, OBJECT, PACKED, QUAD, repList, RESULT_TYPE_LIST, SCALAR, STRING, TABLE, TRANSMATRIX, trueStates, typeList, ULAW, VAX, VECTOR, XLONG, XMAX, XMIN, XMODE, XMVALUE, XMVALUE_KVLIST, XMVALUE_LIST, XMVALUE_TABLE
 
Constructor Summary
HPCore()
           
 
Method Summary
 int close()
           
static HPCore forName(java.lang.String className)
          Create an instance of the function specified by full class name
static HPCore forName(java.lang.String name, nxm.sys.lib.Args args)
          Create an instance of the function specified by name and parsing of the Args class
static HPCore forName(java.lang.String path, java.lang.String name, int impl)
          Create an instance of the function specified by path, name, and implementation
 nxm.sys.lib.Data get(java.lang.String key, byte type)
          GetKey for generic parameter.
 double getD(java.lang.String key)
          GetKey helper for double parameter
 byte getDataType()
          get the natural data format type
 float getF(java.lang.String key)
          GetKey helper for float parameter
 int getL(java.lang.String key)
          GetKey helper for int parameter
 java.lang.String getS(java.lang.String key)
          GetKey helper for String parameter
 boolean getState(java.lang.String key)
          GetKey helper for state parameter
 boolean isSet(java.lang.String list, java.lang.String key, int mask)
          Helper for testing options bits
 int open()
          Initialize this engine with current parameters
 int process(byte[] buf1, int n1)
           
 int process(byte[] buf1, int n1, byte[] buf2, int n2)
           
 int process(byte[] buf1, int n1, byte[] buf2, int n2, byte[] buf3, int n3)
           
 int process(int n)
           
 void set(java.lang.String key, boolean value)
          SetKey helper for state parameter
 void set(java.lang.String key, nxm.sys.lib.Data value)
          SetKey for generic parameter.
 void set(java.lang.String key, double value)
          SetKey helper for double parameter
 void set(java.lang.String key, float value)
          SetKey helper for float parameter
 void set(java.lang.String key, int value)
          SetKey helper for int parameter
 void set(java.lang.String key, java.lang.String value)
          SetKey helper for String parameter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factoryList

public static java.lang.String factoryList

JDK

public static int JDK

CPU

public static int CPU

GPU

public static int GPU

VHS

public static int VHS

ICE

public static int ICE

implementation

public int implementation
Constructor Detail

HPCore

public HPCore()
Method Detail

forName

public static HPCore forName(java.lang.String name,
                             nxm.sys.lib.Args args)
Create an instance of the function specified by name and parsing of the Args class


forName

public static HPCore forName(java.lang.String path,
                             java.lang.String name,
                             int impl)
Create an instance of the function specified by path, name, and implementation


forName

public static HPCore forName(java.lang.String className)
Create an instance of the function specified by full class name


open

public int open()
Initialize this engine with current parameters


process

public int process(int n)

process

public int process(byte[] buf1,
                   int n1)

process

public int process(byte[] buf1,
                   int n1,
                   byte[] buf2,
                   int n2)

process

public int process(byte[] buf1,
                   int n1,
                   byte[] buf2,
                   int n2,
                   byte[] buf3,
                   int n3)

close

public int close()

set

public void set(java.lang.String key,
                nxm.sys.lib.Data value)
SetKey for generic parameter. Override this method and call super if not handled


set

public void set(java.lang.String key,
                java.lang.String value)
SetKey helper for String parameter


set

public void set(java.lang.String key,
                double value)
SetKey helper for double parameter


set

public void set(java.lang.String key,
                float value)
SetKey helper for float parameter


set

public void set(java.lang.String key,
                int value)
SetKey helper for int parameter


set

public void set(java.lang.String key,
                boolean value)
SetKey helper for state parameter


get

public nxm.sys.lib.Data get(java.lang.String key,
                            byte type)
GetKey for generic parameter. Override this method and call super if not handled


getS

public java.lang.String getS(java.lang.String key)
GetKey helper for String parameter


getD

public double getD(java.lang.String key)
GetKey helper for double parameter


getF

public float getF(java.lang.String key)
GetKey helper for float parameter


getL

public int getL(java.lang.String key)
GetKey helper for int parameter


getState

public boolean getState(java.lang.String key)
GetKey helper for state parameter


isSet

public boolean isSet(java.lang.String list,
                     java.lang.String key,
                     int mask)
Helper for testing options bits


getDataType

public byte getDataType()
get the natural data format type