GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > THS / V1-6-0

Constituent: thstest     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

THS_test.h File Reference

Public defs for Time Hack Services Tests. More...

This graph shows which files directly or indirectly include this file:


Functions

unsigned int THS_testInit (int optionMask, char *sntpServer)
 Inits the TimeHackService module.
int THS_cpuTest (int numSec)
 Test the CPU time hack.
void THS_cpuPollTest (int numSec)
 Test the CPU time hack.
int THS_gemTest (int numEvt, int howTrigMask, int expectedOffsetNanoSec, int windSize, int dumpEvt)
 Test of gem hack. Sets up GEM to generate events.
int THS_gemTestEpu (int numEvt, int expectedOffsetNanoSec, int dumpEvt)
 Test of gem hack on EPU. GEM must be setup from SIU to generate events.

Detailed Description

Public defs for Time Hack Services Tests.

Author:
Ed Bacho -- ebacho@slac.stanford.edu
These are test routines used with THS (Time Hack Services)

Function Documentation

void THS_cpuPollTest int  numSec  ) 
 

Test the CPU time hack.

Parameters:
numSec number of seconds to loop on till end, 0=60 sec
Returns:
status
Routine to test the time hack services for CPU clock by printing out the changes on every second.

Required setup: PPS - signal every second TimeTone - message every sec at 500-800 milliSec before PP

int THS_cpuTest int  numSec  ) 
 

Test the CPU time hack.

Parameters:
numSec number of seconds to loop on till end, 0=60 sec
Returns:
status 0=success, 1=failure (does not meet 10 uSec spec)
Routine to test the time hack services for CPU clock by starting a periodic WUT timer every second print absTime and deltaCpu

Required setup: PPS - signal every second TimeTone - message every sec at 500-800 milliSec before PP

THS_gemTest int  numEvt,
int  howTrigMask,
int  expectedOffsetNanoSec,
int  windSize,
int  dumpEvt
 

Test of gem hack. Sets up GEM to generate events.

Parameters:
numEvt number of events per test (1 per sec), if 0 defaults to 60
howTrigMask 1=solicit by CPU, 2=trigOnPps (will always trig on external)
expectedOffsetNanoSec expected offset of event from PPS, -1 uses first offset
windSize trigger window size in tics
dumpEvt 1=dump full event upon receit
Returns:
status 0=success, 1=failure (does not meet 10 uSec spec)
This test the GEM time hack by printing the event time calculated thru the time hack of all events received.

It can optionally setup events to trigger on the following howTrigMask = 0 Will trigger on an external trigger signal = 1 CPU will generate a EventSolicte signal every second (not very precise, usefull to force events) = 2 GEM setup to trigger event on PPS (accurate with gem clock, but not that useful for testing time hack calc since very near PPS)

The most useful trigger is one setup to go off at some N (say 800 nilliSec) after PPS (where PPS is feed into GASU). In this case, one can see how accurate the time calcualted for the event compares with actuak time of the event.

NOTE: Since this routine writes to the GASU, it can only be run from the SIU. It does, however, setup the event to be broadcast to all CPUs so one should see the same events on an EPU by using the THS_gemTestEpu() test.

NOTE: To run accurately, this must be run on a Rad750 with a PPS that is correlated with timetone messages received on the SIU. It will run on other HS (mv2304) and without correlated timetone, but the timing numbers will not be correct.

NOTES on expectedOffsetNanoSec This value is used to determine if within 10 uSec test criteria when events are triggered at one second intervals. The parameter (and the PASS/FAIL) message it generates are not useful in any other trigger case. The usefull cases are: trigger on PPS - expectedOffsetNanoSec should be set to 0 trigger on set delta from PPS - set expectedOffsetNanoSec to the delta from PPS triggrt every sec but not correlated with PPS - set expectedOffsetNanoSec=-1 to use the offset of first trigger as the basis for calculations

THS_gemTestEpu int  numEvt,
int  expectedOffsetNanoSec,
int  dumpEvt
 

Test of gem hack on EPU. GEM must be setup from SIU to generate events.

Parameters:
numEvt number of events per test (1 per sec), if 0 defaults to 60
expectedOffsetNanoSec expected offset of event from PPS
dumpEvt 1=dump full event upon receit
Returns:
status 0=success, 1=failure (does not meet 10 uSec spec)
This test requires one to first run THS_gemTest() on the SIU to start event generation. It sets up EPU to receive and print times of all events received on the EPU. It should match the events received on the SIU.

NOTE: To run accurately, this must be run on a Rad750 with a PPS that is correlated with timetone messages received on the SIU. It will run on other HS (mv2304) and without correlated timetone, but the timing numbers will not be correct.

unsigned int THS_testInit int  optionMask,
char *  sntpServer
 

Inits the TimeHackService module.

Parameters:
optionMask 0=both,2=cpuHack,1=gemHack
sntpServer string with sntp server name, if 0 no timetone server (expect from SC)
Returns:
status
This routine does basic init for THS cpu time hack and requires a few modules to be init. It should only be used when starting a limited system, otherwise LCP will do most of it. Note that is does start up a task to emulate Timetones on the embedded CPU, not SC.

Then using this the following sequence would suffice: PBS_initialize (0,0); FSW_MSG_start(0); THS_testInit (3, NULL); THS_cpuTest (0); THS_gemTest (0,2);


Generated on Wed Jun 13 05:28:28 2007 by  doxygen 1.4.4