Software Tools for the UNET-Discrete Module for Linux

1] OVERVIEW OF THE PACKAGE

This package contains the following items.  

- A set of user mode functions for working with the board (these functions comprise the Software Tools for UNET-Discrete API).

- Sample programs which demonstrate functionality of the board, via the Software Tools API.

The function of each item is described below.

2] THE EXCALIBUR Software Tools for UNET-Discrete

  To compile the Software Tools, type 'make' in the main directory of the Discrete Software Tools.
  To use the Software Tools API, include the header file
  "Proto_discr.h" and link to the libexcdiscr.a library (see the Makefile in the Demos directory for examples.)
  Fully functional examples are enclosed, described in the next section.

  In general, the functions in the UNET-Discrete Software Tools for Linux follow
  follow the same specifications as the UNET-Discrete Software Tools for Windows,
  which are elucidated in the UNET-Discrete Programmer's Reference. The exceptions
  are as follows:

  A] Init_Module_DISCR

  See the file README-UNET-linux.txt in the root directory of this package for
  an explanation of how to configure UNET device numbers under Linux.

  B] Interrupt functions
  The interrupt handling functions are somewhat different under Linux than under Windows.
  The functions available are as follows.  Note that since these functions relate to a card as a whole,
  and not to any specific module on the card, the expected input for the first parameter ("device")
  is the ID of the desired card, from 0-15 (or EXC_4000PCI for default), as detailed above, rather than the handle
  of a particular module within the card.

	int Wait_For_Interrupt_DISCR(int device);
	int Get_Interrupt_Count_DISCR(int device, unsigned long *Sys_Interrupts_Ptr);
	int Get_Module_Interrupt_Count_DISCR(int device, unsigned int module, unsigned long *Sys_Interrupts_Ptr);
	int Get_Interrupt_Modules_DISCR(int device, BYTE *ShadowByteBuffer);

  The first function suspends the current thread until an interrupt is received.
  The next two functions retrieve the total number of interrupts, either for the card as
  a whole, or for a given module.
  Finally, the last function retrieves a bitfield indicating which modules have interrupted
  (since the last call to the function).

4] THE DEMO PROGRAMS 

  Fully functional demo programs are included in the Excalibur package.
  1] The Demo_discr program demos the the functionality of the discrete module.
  2] The Demo_int program demos the module with interrupts. 
  A loop back cable is needed to test these.
  
  To build the demos, use the Makefile in the Demos directory.
  
5] PLATFORM CONSIDERATIONS

  Pthread library

  The Demo_int program makes use of the pthread library in order to 
  process interrupts asynchronously in user mode.  Most recent Linux 
  installations include this library.  However, older versions of Linux
  may require separate installation of the pthread library (for instance,
  from LinuxThreads).

6] DEBUG OPTIONS

  Phex Utility

  The included Phex utility scans the onboard memory of the Excalibur board
  and provides an output file containing data of interest.  If errors are
  encountered while using the Excalibur board, it will be instructive to generate
  these phex output files and to send them to Excalibur's tech support staff.

  In general, it will be most helpful if the phex output is generated and saved both
  upon bootup of the linux system, as well as after running the problematic application.
  Additionally, if relevant, the phex utility can be run simultaneously with the
  problematic application, as a parallel task, to provide us with a real time view
  of the system's memory during execution.

  The phex directory includes the phex executable, as well as the header, source, and
  make files needed to recompile the utility.

  For the UNET, this is implemented in the UNetPhex utility.  See the README-UNET-linux.txt file.
