GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCI / V6-1-0 > LCI_test / rhel6-32
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. |
Test the LCI compiler.
$Id: test_compiler.c,v 1.15 2011/03/29 20:06:26 saxton Exp $
int compare | ( | const char * | type, |
const char * | filename, | ||
const char * | fid | ||
) |
Compare the configuration data written directly to file with the product of compilation.
filename | Name of the XML file to compile |
fid | ID of the binary configuration file to compare with product of compilation |
type | One of ACD, CAL or TKR |
0 | No errors |
1 | Errors |
References _LCI_configuration::inp, and _LCI_configuration::val.
Referenced by compiler_acd(), compiler_cal(), and compiler_tkr().
int compiler_acd | ( | void | ) |
Test ACD compiler.
References LCI_cnfInput::acd, compare(), LCI_gemInput::delay, LCI_cnfInput::gem, LCI_acdInput::hld, LCI_acdInput::inj, _LCI_configuration::inp, LCI_gemInput::nev, LCI_gemInput::period, LCI_acdInput::pha, printACD(), printEndACD(), printStartACD(), setItemCst(), setItemVar(), LCI_acdInput::vern, and LCI_acdInput::veto.
Referenced by LCI_test_compiler().
int compiler_cal | ( | void | ) |
Test CAL compiler.
References LCI_calInput::acc, LCI_cnfInput::cal, LCI_calInput::col, compare(), LCI_gemInput::delay, LCI_cnfInput::gem, LCI_calInput::he, LCI_calInput::inj, _LCI_configuration::inp, LCI_gemInput::nev, LCI_gemInput::period, printCAL(), printEndCAL(), printStartCAL(), setItemCst(), setItemVar(), LCI_calInput::tack, and LCI_calInput::uld.
Referenced by LCI_test_compiler().
int compiler_tkr | ( | void | ) |
Test TKR compiler.
References LCI_tkrInput::chnl, compare(), LCI_gemInput::delay, LCI_cnfInput::gem, LCI_tkrInput::inj, _LCI_configuration::inp, LCI_gemInput::nev, LCI_gemInput::period, printEndTKR(), printStartTKR(), printTKR(), setItemCst(), setItemVar(), LCI_tkrInput::tack, LCI_tkrInput::thr, and LCI_cnfInput::tkr.
Referenced by LCI_test_compiler().
unsigned LCI_test_compiler | ( | void | ) |
Perform a compiler test.
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.
fp | Pointer to file to write the XML into |
inp | Pointer 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.
fp | Pointer to file to write the XML into |
inp | Pointer 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.
fp | Pointer to file to write XML into |
itm | Configuration item to write |
indent | Current 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.
fp | Pointer to file to write XML into |
itm | Configuration item to write |
indent | Current 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.
fp | Pointer to file to write XML into |
Referenced by compiler_acd().
void printEndCAL | ( | FILE * | fp | ) |
Print the last line of a CAL XML file.
fp | Pointer to file to write XML into |
Referenced by compiler_cal().
void printEndTKR | ( | FILE * | fp | ) |
Print the last line of a TKR XML file.
fp | Pointer to file to write XML into |
Referenced by compiler_tkr().
void printIndent | ( | FILE * | fp, |
unsigned | indent | ||
) |
Print an indentation into a file.
fp | Pointer to file to write indent into |
indent | Size 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".
fp | Pointer to file to write XML into |
itm | Configuration item to write |
indent | Current depth of the indent |
tag | String 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.
fp | Pointer to file to write XML into |
Referenced by compiler_acd().
void printStartCAL | ( | FILE * | fp | ) |
Print the first three lines of a CAL XML file.
fp | Pointer to file to write XML into |
Referenced by compiler_cal().
void printStartTKR | ( | FILE * | fp | ) |
Print the first three lines of a TKR XML file.
fp | Pointer 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.
fp | Pointer to file to write the XML into |
inp | Pointer 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.
itm | Pointer to the configuration item to fill |
val | Constant 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.
itm | Pointer to the configuration item to fill |
start | Start value for the configuration item |
count | Count value for the configuration item |
delta | Delta 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().