GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > THS / V1-5-2
Constituent: thstest     Tag: mv2304
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "PBS/PBS.h"
#include "PBS/WCT.h"
#include "PBS/TASK.h"
#include "PBS/TMR.h"
#include "PBS/QI.h"
#include "PBS/WUT.h"
#include "PBS/MBA.h"
#include "LEM/cli.h"
#include "LCBD/LCBD.h"
#include "LCBD/LCBD_pci.h"
#include "LEM/defs.h"
#include "LEM/decode.h"
#include "LEM/encode.h"
#include "LEM/encode_structs.h"
#include "LEM/LEM_msgs.h"
#include "THS/THS_sntpReader.h"
#include "THS/THS_test.h"
#include "THS_prvdefs.h"
Include dependency graph for THS_test.c:
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. |
The different cases handled are: mv2304
Inputs:
|
Test the CPU time hack.
Required setup: PPS - signal every second TimeTone - message every sec at 500-800 milliSec before PP |
|
Test the CPU time hack.
Required setup: PPS - signal every second TimeTone - message every sec at 500-800 milliSec before PP |
|
Test of gem hack. Sets up GEM to generate events.
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 |
|
Test of gem hack on EPU. GEM must be setup from SIU to generate events.
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. |
|
Inits the TimeHackService module.
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); |