GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > RAD750 / V1-3-1
Constituent: rad750_unit_test     Tag: rad750
#include <vxWorks.h>
#include <stdio.h>
#include <tickLib.h>
#include <logLib.h>
#include <semLib.h>
#include <sysLib.h>
#include <errnoLib.h>
#include "RAD750_unit_test.h"
#include "drv/ppci/ppciRegs.h"
#include "drv/ppci/ppciPid.h"
Include dependency graph for RAD750_unit_test_pid.c:
Data Structures | |
struct | _rad750_PUTPidInfo |
struct | _rad750_PUTRegisterSet |
Defines | |
#define | rad750_PUT_SWAP(__i__) |
#define | rad750_PUT_BAD_PID_COUNT (sizeof(rad750_PUTBadPids)/sizeof(*rad750_PUTBadPids)) |
#define | rad750_PUT_BAD_PID_TYPE_COUNT (sizeof(rad750_PUTBadPidTypes)/sizeof(*rad750_PUTBadPidTypes)) |
#define | rad750_PUT_BAD_PID_VALUE_COUNT (sizeof(rad750_PUTBadPidValues)/sizeof(*rad750_PUTBadPidValues)) |
#define | rad750_PUT_BAD_PID_INPUT_TYPE_COUNT (sizeof(rad750_PUTBadPidInputTypes)/sizeof(*rad750_PUTBadPidInputTypes)) |
#define | rad750_PUT_BAD_PID_OUTPUT_TYPE_COUNT (sizeof(rad750_PUTBadPidOutputTypes)/sizeof(*rad750_PUTBadPidOutputTypes)) |
#define | rad750_PUT_PID_COUNT (sizeof(rad750_PUTData)/sizeof(*rad750_PUTData)) |
#define | rad750_PUT_TEST_ITERATIONS (1000) |
Typedefs | |
typedef _rad750_PUTPidInfo | rad750_PUTPidInfo |
typedef _rad750_PUTRegisterSet | rad750_PUTRegisterSet |
typedef enum _rad750_PUTRegisterMaskType | rad750_PUTRegisterMaskType |
Enumerations | |
enum | _rad750_PUTRegisterMaskType { rad750_PUT_MASK_OUTPUT_ENABLE = 0x00000001, rad750_PUT_MASK_OUTPUT_SELECT = 0x00000002, rad750_PUT_MASK_OUTPUT = 0x00000004, rad750_PUT_MASK_INPUT_ENABLE = 0x00000008, rad750_PUT_MASK_INPUT_SELECT = 0x00000010, rad750_PUT_MASK_INT_ENABLE = 0x00000020, rad750_PUT_MASK_VEC_ENABLE = 0x00000040, rad750_PUT_MASK_INPUT = 0x00000080, rad750_PUT_MASK_ALL = 0xFFFFFFFF } |
Functions | |
void | rad750_PUTSaveRegs (rad750_PUTRegisterSet *regs) |
Save PID registers to register set. | |
void | rad750_PUTRestoreRegs (rad750_PUTRegisterSet *regs) |
Restore PID registers to to contents of a register set. | |
int | rad750_PUTCheckValueChange (unsigned long oldValue, unsigned long newValue, const char *regName, unsigned long cmpMask) |
Determine if a PID register value has changed. | |
int | rad750_PUTCheckPidChanges (const rad750_PUTRegisterSet *oldRegValues, rad750_PUTRegisterMaskType registerMask, unsigned long pidMaskValue) |
Determine if any PID registers have changed. | |
rad750_PUTPidInfo * | rad750_PUTGetInfo (int pidNum) |
Return a PID INFO structure for a PID number. | |
int | rad750_PUTSetup () |
Setup PID Unit Tests. | |
int | rad750_PUTCnfRange () |
Run pidCnf() argument range tests. | |
int | rad750_PUTCnfInLevel (const rad750_PUTPidInfo *pidInfo) |
Run pidCnf() input level tests. | |
int | rad750_PUTCnfInEdge (const rad750_PUTPidInfo *pidInfo) |
Run pidCnf() input edge detect tests. | |
int | rad750_PUTCnfOutReg (const rad750_PUTPidInfo *pidInfo) |
Run pidCnf() output register tests. | |
int | rad750_PUTCnfOutTimer (const rad750_PUTPidInfo *pidInfo) |
Run pidCnf() output timer tests. | |
int | rad750_PUTCnf () |
Run pidCnf() tests. | |
int | rad750_PUTIORange () |
Run pidSet() and pidGet() input range tests. | |
int | rad750_PUTIOVerify (const rad750_PUTPidInfo *pidInfo, const rad750_PUTRegisterSet *regSave, int setValue, int expectedGet) |
Verify PID I/O test results. | |
int | rad750_PUTIOLevel (const rad750_PUTPidInfo *pidInfo) |
Run pidSet() and pidGet() tests for level input. | |
int | rad750_PUTIOEdge (const rad750_PUTPidInfo *pidInfo) |
Run pidSet() and pidGet() tests for edge input. | |
int | rad750_PUTIO () |
Run pidSet() and pidGet() tests. | |
void | rad750_PUTIsr (int pidNum) |
PID unit test ISR. | |
int | rad750_PUTIntRange () |
Run PID interrupt functions range tests. | |
int | rad750_PUTIntDriver (const rad750_PUTPidInfo *pidInfo, int mustWork) |
Run PID interrupt must tests. | |
int | rad750_PUTInt () |
Run PID interrupt tests. | |
int | rad750_PidUnitTest () |
RAD750 PID library unit test. | |
Variables | |
LOCAL int | rad750_PUTBadPids [] = {-2, -1, 32, 256} |
LOCAL int | rad750_PUTBadPidTypes [] = {-2, -1, 4, 257} |
LOCAL int | rad750_PUTBadPidValues [] = {-1, 2, 4, 257} |
LOCAL int | rad750_PUTBadPidInputTypes [] = {-2, -1, 2, 3, 256} |
LOCAL int | rad750_PUTBadPidOutputTypes [] = {-2, -1, 2, 3, 257} |
LOCAL rad750_PUTPidInfo | rad750_PUTData [] |
LOCAL int | rad750_PUTSpuriousIsrCount = 0 |
LOCAL SEM_ID | rad750_PUTSem |
Revision 1.1 2003/12/02 21:16:33 dwood Moved unit test source code from src directory to ptd directory.
Revision 1.2 2003/09/03 19:38:40 ray fix documentation to appease doxygen, fix ISR synchronization, change id pidCnf arguments
Revision 1.1 2003/05/20 20:14:02 dwood Added in unit test for RAD750; just starts testing PID interface.
|
Number of bad PIDs in bad PID list. |
|
Number of bad PID input types in bad PID input type list. |
|
Number of bad PID output types in bad PID output type list. |
|
Number of bad PID types in bad PID type list. |
|
Number of bad PID values in bad PID value list. |
|
Number of PID entry in rad750_PUTData list. |
|
Value: ((((__i__) >> 24) & 0x000000ff) | \ (((__i__) >> 8) & 0x0000ff00) | \ (((__i__) << 8) & 0x00ff0000) | \ (((__i__) << 24) & 0xff000000))
|
|
Number of interations to execute I/O and interrupt tests. |
|
Typedef for struct _rad750_PUTPidInfo |
|
Typedef for enum _rad750_PUTRegisterMaskType |
|
Typedef for struct _rad750_PUTRegisterSet |
|
Set of masks for defining a collection of PID registers. Used to drive the function rad750_PUTCheckRegs() |
|
RAD750 PID library unit test. Run RAD750 PID library unit tests.
|
Here is the call graph for this function:
|
Determine if any PID registers have changed. This function is used to confirm that a selected PID registers have not unexpectedly changed. The original value of the PID registers are stored at oldRegValues. registerMask is a bit mask defining the set of registers that should be compared.
|
Here is the call graph for this function:
|
Determine if a PID register value has changed. This function is used to confirm that a PID register has not change unexpectedly. The arguments oldValue and newValue are the register values (not a register address) to be compared. cmpMask is a bit mask used to exclude from bits in oldValue and newValue from the comparison. regName is a text string to be put in the error messages.
|
|
Run pidCnf() tests. Run pidCnf() range and register configuration tests.
|
Here is the call graph for this function:
|
Run pidCnf() input edge detect tests. Check that pidCnf() configures the ppci PID registers properly for IN / IN_EDGE configurations.
|
Here is the call graph for this function:
|
Run pidCnf() input level tests. Check that pidCnf() configures the ppci PID registers properly for IN / IN_LEVEL configurations.
|
Here is the call graph for this function:
|
Run pidCnf() output register tests. Check that pidCnf() configures the ppci PID registers properly for OUT / OUT_REG configurations.
|
Here is the call graph for this function:
|
Run pidCnf() output timer tests. Check that pidCnf() configures the ppci PID registers properly for OUT / OUT_TIMER configurations.
|
Here is the call graph for this function:
|
Run pidCnf() argument range tests. Check that pidCnf() returns ERROR if any arguments violate the vlaid input ranges.
|
|
Return a PID INFO structure for a PID number. Lookup an entry in rad750_PUTData for an entry that had a pid number of pidNum. Return a pointer to that entry, or return NULL if not found.
|
|
Run PID interrupt tests. Run PID interrupt tests. Test PID interrupt functionality as well as pidIntEnable(), pidIntDisable() and pidIntConnect().
|
Here is the call graph for this function:
|
Run PID interrupt must tests. Driver to PID interrupt tests.
|
Here is the call graph for this function:
|
Run PID interrupt functions range tests. Range check for PID functions pidIntConnect(), pidIntEnable(), pidIntDisable(), pidIntEmcEnable(), and pidIntEmcDisable().
|
Here is the call graph for this function:
|
Run pidSet() and pidGet() tests. Run pidPut(), pidGet() range, register configuration and functionality tests.
|
Here is the call graph for this function:
|
Run pidSet() and pidGet() tests for edge input. from the test plan... 1) Configure as in/out, input edge, output reg. 2) Use pidSet() to test edge detect. Use pidGet() and register peeking to and check values. This function test pidSet()/pidGet() for negative edge inputs. It runs through a sequence of calls to pidSet() and rad750_PUTIOVerify(). A sequence of high and low values for the PID I/O is driven by the array setValues[]. This generates a "stream" of high or low values that may or may not generate a negative edge. rad750_PUTIOVerify() is called after each call to pidSet() to make sure the right result has occurred. The array getValues[] drives the expected results. This function will bail out on first sign of trouble. This function runs calls pidSet() many times, it probably is not really needed, but I want run it a fair number of times to coax out any mutual exclusion or H/W syncrhonization problems.
|
Here is the call graph for this function:
|
Run pidSet() and pidGet() tests for level input. From the test plan... 1) Configure as in/out, input level, output reg. 2) Use pidSet() to test input level. Use pidGet() and register peeking to and check values. This function test pidSet()/pidGet() for level inputs. It runs through a sequence of calls to pidSet() and rad750_PUTIOVerify(). pidSet() sets the registers to the desired value, then rad750_PUTIOVerify() checks that all the pidGet() works and all of the registers are in the proper state. This function will bail out on first sign of trouble. This function runs calls pidSet() many times, it probably is not really needed, but I want run it a fair number of times to coax out any mutual exclusion or H/W syncrhonization problems.
|
Here is the call graph for this function:
|
Run pidSet() and pidGet() input range tests. Range check pidSet() pidGet() and pidEdgeClear(). All are range checked for bad PID numbers.
|
|
Verify PID I/O test results. This function does the grunt work of verifying the results of a PID I/O tests. The function verfies that pidGet() returns the expected value. The function verifies the input and output registers for the PID under test are in the expected state. The function also verifies that other registers are not affected by the testing. This function does not bail out on the first error, it attempts to verify everything it can before returning.
|
Here is the call graph for this function:
|
PID unit test ISR. This is the ISR that is connected to PID interrupts during PID unit testing.
|
Here is the call graph for this function:
|
Restore PID registers to to contents of a register set. This function copies the values in the register set at location regs to the the RAD750 PPCI PID registers.
|
|
Save PID registers to register set. This function copies the current values in the RAD750 PPCI PID registers to the location at regs.
|
|
Setup PID Unit Tests. To be called before PID unit tests are executed. Sets up any data needed to driver the PID tests.
|
|
List of PID input type values for PID input type range checking. None of the PID input types are valid. |
|
List of PID output type values for PID output type range checking. None of the PID output types are valid. |
|
List of PID values for PID range checking. None of the PID numbers are valid. |
|
List of PID type values for PID type range checking. None of the PID types are valid. |
|
List of PID values to be passed to pidSet() range checking. None of the PID values are valid. |
|
Initial value: {{1, 1, 0, 0}, {2, 1, 0, 0}, {5, 0, 0, 0}, {6, 0, 0, 0}, {7, 0, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0}, {21, 0, 0, 0}, {22, 0, 0, 0}, {23, 0, 0, 0}, {24, 0, 0, 0}, {25, 0, 0, 0}, } |
|
Binary semaphore used to sychronize between test code running at task level and the ISR. |
|
A count of the number of times rad750_PUTIsr() is called for a PID that this test has not registered for. |