GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCI / V6-1-0 > LCI_test / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

Functions
test_compiler.c File Reference

Test the LCI compiler. More...

#include <test_p.h>
#include <lci_host_p.h>
#include <compile_p.h>
#include <configure_p.h>
#include <LCI/LCI_msgs.h>
#include <LSEC/enums.h>
#include <LSEC/LSEC_ctx.h>
#include <MSG/MSG_pubdefs.h>

Functions

unsigned LCI_test_compiler (void)
 Perform a compiler test.
int compiler_acd (void)
 Test ACD compiler.
int compiler_cal (void)
 Test CAL compiler.
int compiler_tkr (void)
 Test TKR compiler.
int compare (const char *type, const char *filename, const char *fid)
 Compare the configuration data written directly to file with the product of compilation.
void setItemVar (LCI_cnfItem *itm, unsigned start, unsigned count, unsigned delta)
 Set the start, count and delta fields of the configuration item.
void setItemCst (LCI_cnfItem *itm, unsigned val)
 Fill the fields of the configuration item to produce a constant value.
void printACD (FILE *fp, LCI_cnfInput *inp)
 Append the XML form of an ACD configuration to the file.
void printCAL (FILE *fp, LCI_cnfInput *inp)
 Append the XML form of a CAL configuration to the file.
void printTKR (FILE *fp, LCI_cnfInput *inp)
 Append the XML form of a TKR configuration to the file.
void printItem (FILE *fp, LCI_cnfItem *itm, unsigned indent, const char *tag)
 Write out a configuration item as either the keyword LATC, the single tag "constant" or the set of tags "initial", "delta" and "count".
void printCol (FILE *fp, LCI_cnfItem *itm, unsigned indent)
 Write out the CAL column configuration item.
void printChnl (FILE *fp, LCI_cnfItem *itm, unsigned indent)
 Write out the TKR channel configuration item.
void printIndent (FILE *fp, unsigned indent)
 Print an indentation into a file.
void printStartACD (FILE *fp)
 Print the first lines of an ACD XML file.
void printEndACD (FILE *fp)
 Print the last line of an ACD XML file.
void printStartCAL (FILE *fp)
 Print the first three lines of a CAL XML file.
void printEndCAL (FILE *fp)
 Print the last line of a CAL XML file.
void printStartTKR (FILE *fp)
 Print the first three lines of a TKR XML file.
void printEndTKR (FILE *fp)
 Print the last line of a TKR XML file.

Detailed Description

Test the LCI compiler.

Author:
James Swain & Owen Saxton

$Id: test_compiler.c,v 1.15 2011/03/29 20:06:26 saxton Exp $


Function Documentation

int compare ( const char *  type,
const char *  filename,
const char *  fid 
)

Compare the configuration data written directly to file with the product of compilation.

Parameters:
filenameName of the XML file to compile
fidID of the binary configuration file to compare with product of compilation
typeOne of ACD, CAL or TKR
Return values:
0No errors
1Errors

References _LCI_configuration::inp, and _LCI_configuration::val.

Referenced by compiler_acd(), compiler_cal(), and compiler_tkr().

int compiler_acd ( void  )
int compiler_cal ( void  )
int compiler_tkr ( void  )
unsigned LCI_test_compiler ( void  )

Perform a compiler test.

Returns:
Line number of first failure

References compiler_acd(), compiler_cal(), and compiler_tkr().

void printACD ( FILE *  fp,
LCI_cnfInput inp 
)

Append the XML form of an ACD configuration to the file.

Parameters:
fpPointer to file to write the XML into
inpPointer to the configuration data to write

References LCI_cnfInput::acd, LCI_gemInput::delay, LCI_cnfInput::gem, LCI_acdInput::hld, LCI_acdInput::inj, LCI_gemInput::nev, LCI_gemInput::period, LCI_acdInput::pha, printItem(), LCI_gemInput::strobe, LCI_acdInput::vern, LCI_acdInput::veto, and LCI_gemInput::zero_suppress.

Referenced by compiler_acd().

void printCAL ( FILE *  fp,
LCI_cnfInput inp 
)

Append the XML form of a CAL configuration to the file.

Parameters:
fpPointer to file to write the XML into
inpPointer to the configuration data to write

References LCI_calInput::acc, LCI_cnfInput::cal, LCI_calInput::col, LCI_gemInput::delay, LCI_calInput::firstRng, LCI_cnfInput::gem, LCI_calInput::he, LCI_calInput::inj, LCI_calInput::le, LCI_gemInput::nev, LCI_gemInput::period, printCol(), printItem(), LCI_gemInput::strobe, LCI_calInput::tack, LCI_calInput::uld, and LCI_gemInput::zero_suppress.

Referenced by compiler_cal().

void printChnl ( FILE *  fp,
LCI_cnfItem itm,
unsigned  indent 
)

Write out the TKR channel configuration item.

Parameters:
fpPointer to file to write XML into
itmConfiguration item to write
indentCurrent depth of the indent

References LCI_cnfItem::count, LCI_cnfItem::delta, printIndent(), printItem(), and LCI_cnfItem::start.

Referenced by printTKR().

void printCol ( FILE *  fp,
LCI_cnfItem itm,
unsigned  indent 
)

Write out the CAL column configuration item.

Parameters:
fpPointer to file to write XML into
itmConfiguration item to write
indentCurrent depth of the indent

References LCI_cnfItem::count, LCI_cnfItem::delta, printIndent(), printItem(), and LCI_cnfItem::start.

Referenced by printCAL().

void printEndACD ( FILE *  fp)

Print the last line of an ACD XML file.

Parameters:
fpPointer to file to write XML into

Referenced by compiler_acd().

void printEndCAL ( FILE *  fp)

Print the last line of a CAL XML file.

Parameters:
fpPointer to file to write XML into

Referenced by compiler_cal().

void printEndTKR ( FILE *  fp)

Print the last line of a TKR XML file.

Parameters:
fpPointer to file to write XML into

Referenced by compiler_tkr().

void printIndent ( FILE *  fp,
unsigned  indent 
)

Print an indentation into a file.

Parameters:
fpPointer to file to write indent into
indentSize of the indentation

Referenced by printChnl(), printCol(), and printItem().

void printItem ( FILE *  fp,
LCI_cnfItem itm,
unsigned  indent,
const char *  tag 
)

Write out a configuration item as either the keyword LATC, the single tag "constant" or the set of tags "initial", "delta" and "count".

Parameters:
fpPointer to file to write XML into
itmConfiguration item to write
indentCurrent depth of the indent
tagString for the XML tag containing the item

References LCI_cnfItem::count, LCI_cnfItem::delta, printIndent(), and LCI_cnfItem::start.

Referenced by printACD(), printCAL(), printChnl(), printCol(), and printTKR().

void printStartACD ( FILE *  fp)

Print the first lines of an ACD XML file.

Parameters:
fpPointer to file to write XML into

Referenced by compiler_acd().

void printStartCAL ( FILE *  fp)

Print the first three lines of a CAL XML file.

Parameters:
fpPointer to file to write XML into

Referenced by compiler_cal().

void printStartTKR ( FILE *  fp)

Print the first three lines of a TKR XML file.

Parameters:
fpPointer to file to write XML into

Referenced by compiler_tkr().

void printTKR ( FILE *  fp,
LCI_cnfInput inp 
)

Append the XML form of a TKR configuration to the file.

Parameters:
fpPointer to file to write the XML into
inpPointer to the configuration data to write

References LCI_tkrInput::chnl, LCI_gemInput::delay, LCI_cnfInput::gem, LCI_tkrInput::inj, LCI_gemInput::nev, LCI_gemInput::period, printChnl(), printItem(), LCI_gemInput::strobe, LCI_tkrInput::tack, LCI_tkrInput::thr, LCI_cnfInput::tkr, and LCI_gemInput::zero_suppress.

Referenced by compiler_tkr().

void setItemCst ( LCI_cnfItem itm,
unsigned  val 
)

Fill the fields of the configuration item to produce a constant value.

Parameters:
itmPointer to the configuration item to fill
valConstant value to set the configuration item to

References LCI_cnfItem::count, LCI_cnfItem::delta, and LCI_cnfItem::start.

Referenced by compiler_acd(), compiler_cal(), and compiler_tkr().

void setItemVar ( LCI_cnfItem itm,
unsigned  start,
unsigned  count,
unsigned  delta 
)

Set the start, count and delta fields of the configuration item.

Parameters:
itmPointer to the configuration item to fill
startStart value for the configuration item
countCount value for the configuration item
deltaDelta value for the configuration item

References LCI_cnfItem::count, LCI_cnfItem::delta, and LCI_cnfItem::start.

Referenced by compiler_acd(), compiler_cal(), and compiler_tkr().