Defines | Functions | Variables

llcontrol.c File Reference

MAIN llcontrol top level and "UI". More...

#include "local.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <popt.h>
#include "acq32ioctl.h"
#include "acq32busprot.h"
#include "llif.h"
#include "llprotocol.h"
#include "llcontrol.h"

Go to the source code of this file.

Defines

#define FLAVOR   "ACQ32"
#define VERID   "llcontrol $Revision: 1.30.2.43 $ B1051 " FLAVOR "\n"
#define HELP
#define CLIP(t)   ((t) < 0? -1: (t) > CLIP_LIMIT? (-1): (t))
 CLIP bogus times - not to try hide anything - big number spoils display.
#define HFMT   "%8s, %10s, %10s, %8s, %8s, %6s, %4s, "
#define DFMT   "%8d, %10d, %10d, %8d, %8d, %6d, %4d, "

Functions

static void setDefaults (struct TestDescription *td)
static void loadPramfile (struct TestDescription *td, const char *pram_file)
 ACQ216 ONLY: pram_file contains binary array of struct LLC200_INIT.
static u32 makeChannelMask (struct TestDescription *td)
static void initPrams (struct TestDescription *td)
 force channel mask if not already set in prams data.
static int make_output_file (struct TestDescription *td, int slot, const char *class)
void updateTimingStats (struct TimingStats *buffer, int iter, struct TimingStats *tstats)
static int extractTprocess (struct TimingStats *ts)
 if TP is available, USE IT, else calculate from tlatch, tinst this is valid because either it is accurate IOP calc, or worst case Host calc
static void dumpTimingStats (struct TestDescription *td, FILE *fp)
static void dumpTimingStatsBin (struct TestDescription *td, const char *bfile)
static void td_allocate_dac_data (struct TestDescription *td, int nsamples)
static void td_load_dac_data_impulse (struct TestDescription *td)
static int get_file_size (const char *fname)
static void td_load_dac_data_file (struct TestDescription *td, const char *fname)
static void td_load_dac_data (struct TestDescription *td)
static void setEdge (int *flag, const char *arg)
static void selectBoards (struct TestDescription *td, const char *board_def)
static void doWorkBufDataOutput (struct TestDescription *td)
static void doDmaBufDataOutput (struct TestDescription *td)
static void doPostShotAnalysis (struct TestDescription *td)
static void initWorkBuf (struct TestDescription *td)
void initV2Stats (struct TestDescription *td)
static void initV2 (struct TestDescription *td)
 LLC V2 initialization - pick up prams from config file.
int main (int argc, const char *argv[])

Variables

const char * core_ident
int verbose = 0
int G_quit
static int CLIP_LIMIT = 100000
static int is_v2 = 0
unsigned llcv2_hb_offset = LLCV2_HB_OFFSET
 but for future, simpler host side drivers, we'd like a single 4K buf, no offset.

Detailed Description

MAIN llcontrol top level and "UI".

llcontrol -

Definition in file llcontrol.c.


Define Documentation

#define CLIP (   t  )     ((t) < 0? -1: (t) > CLIP_LIMIT? (-1): (t))

CLIP bogus times - not to try hide anything - big number spoils display.

Definition at line 574 of file llcontrol.c.

Referenced by dumpTimingStats(), and extractTprocess().

#define DFMT   "%8d, %10d, %10d, %8d, %8d, %6d, %4d, "

Referenced by dumpTimingStats().

#define FLAVOR   "ACQ32"

Definition at line 348 of file llcontrol.c.

#define HELP

Definition at line 353 of file llcontrol.c.

Referenced by main().

#define HFMT   "%8s, %10s, %10s, %8s, %8s, %6s, %4s, "

Referenced by dumpTimingStats().

#define VERID   "llcontrol $Revision: 1.30.2.43 $ B1051 " FLAVOR "\n"

Definition at line 351 of file llcontrol.c.

Referenced by main().


Function Documentation

static void doDmaBufDataOutput ( struct TestDescription td  )  [static]
static void doPostShotAnalysis ( struct TestDescription td  )  [static]
static void doWorkBufDataOutput ( struct TestDescription td  )  [static]
static void dumpTimingStats ( struct TestDescription td,
FILE *  fp 
) [static]
static void dumpTimingStatsBin ( struct TestDescription td,
const char *  bfile 
) [static]
static int extractTprocess ( struct TimingStats ts  )  [inline, static]

if TP is available, USE IT, else calculate from tlatch, tinst this is valid because either it is accurate IOP calc, or worst case Host calc

Definition at line 576 of file llcontrol.c.

References CLIP, isAcq216(), TimingStats::tinst, TimingStats::tlatch, and TimingStats::tprocess.

Referenced by dumpTimingStats().

static int get_file_size ( const char *  fname  )  [static]

Definition at line 704 of file llcontrol.c.

Referenced by td_load_dac_data_file().

static void initPrams ( struct TestDescription td  )  [static]

force channel mask if not already set in prams data.

Definition at line 519 of file llcontrol.c.

References LLC200_INIT::channel_mask, TestDescription::channels, isAcq216HS(), TestDescription::llc200_init, LLC200_INIT_MASK_CHANNEL, makeChannelMask(), and LLC200_INIT::mask.

Referenced by main().

static void initV2 ( struct TestDescription td  )  [static]

LLC V2 initialization - pick up prams from config file.

WORKTODO V2

Definition at line 855 of file llcontrol.c.

References TestDescription::hb_polling, initV2Stats(), and TestDescription::V2_BUFS.

Referenced by main().

void initV2Stats ( struct TestDescription td  ) 
static void initWorkBuf ( struct TestDescription td  )  [static]
static void loadPramfile ( struct TestDescription td,
const char *  pram_file 
) [static]

ACQ216 ONLY: pram_file contains binary array of struct LLC200_INIT.

Definition at line 445 of file llcontrol.c.

References fclose(), isAcq216(), TestDescription::llc200_init, TestDescription::llc200_init_count, and LLC200_INIT_SZ.

Referenced by main().

int main ( int  argc,
const char *  argv[] 
)
static int make_output_file ( struct TestDescription td,
int  slot,
const char *  class 
) [static]

Definition at line 536 of file llcontrol.c.

References fd_out, and TestDescription::outfname.

Referenced by doDmaBufDataOutput(), and doWorkBufDataOutput().

static u32 makeChannelMask ( struct TestDescription td  )  [inline, static]
static void selectBoards ( struct TestDescription td,
const char *  board_def 
) [static]

Definition at line 758 of file llcontrol.c.

References TestDescription::cards, EACHSLOT, FOREACHCARD, TestDescription::ncards, and Card::slot.

Referenced by main().

static void setDefaults ( struct TestDescription td  )  [static]
static void setEdge ( int *  flag,
const char *  arg 
) [static]

Definition at line 751 of file llcontrol.c.

Referenced by main().

static void td_allocate_dac_data ( struct TestDescription td,
int  nsamples 
) [static]
static void td_load_dac_data ( struct TestDescription td  )  [static]
static void td_load_dac_data_file ( struct TestDescription td,
const char *  fname 
) [static]
static void td_load_dac_data_impulse ( struct TestDescription td  )  [static]

Definition at line 695 of file llcontrol.c.

References TestDescription::dac_data, DAC_SAMPLE_SIZE, and td_allocate_dac_data().

Referenced by td_load_dac_data().

void updateTimingStats ( struct TimingStats buffer,
int  iter,
struct TimingStats tstats 
)

Definition at line 561 of file llcontrol.c.

References TimingStats::iter.

Referenced by do_run(), runSCM216(), runSYNC_2V(), runSYNC_2VAO32(), runSYNC_2VRFM(), and runSYNC_ECM().


Variable Documentation

int CLIP_LIMIT = 100000 [static]

Definition at line 571 of file llcontrol.c.

Referenced by dumpTimingStats(), and main().

const char* core_ident

Definition at line 232 of file llcontrol-core.c.

Referenced by main().

int G_quit
int is_v2 = 0 [static]

Definition at line 870 of file llcontrol.c.

Referenced by main().

unsigned llcv2_hb_offset = LLCV2_HB_OFFSET

but for future, simpler host side drivers, we'd like a single 4K buf, no offset.

=> use a variable and set as appropriate

Definition at line 1113 of file llcontrol.c.

Referenced by appEnterLLC_SYNC_2V(), appEnterLLC_SYNC_2VAO32(), and appEnterLLC_SYNC_ECM().

int verbose = 0

Definition at line 400 of file llcontrol.c.

Referenced by main(), and monitor_handler().