Defines | Functions

llcontrol-acq216-core.c File Reference

demonstrates ACQ216 useage. 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"
#include "x86timer.h"
#include "llcontrol-core.h"

Go to the source code of this file.

Defines

#define FLAVOR   "ACQ32"
#define PRAMS_OFFSET   0x100000
#define EACHBBB   bbb[icard]
#define POLLOFF(td)   (offset + (td->samples-1) * td_sample_size(td))

Functions

void setAcq216Parameters (struct TestDescription *td, struct LLC200_INIT *buffer, int card, int iter)
 configure card parameters for iteration iter
static void doApplicationWork216 (struct TestDescription *td, u32 offset)
int runSCM216 (struct TestDescription *td)

Detailed Description

demonstrates ACQ216 useage.

Definition in file llcontrol-acq216-core.c.


Define Documentation

#define EACHBBB   bbb[icard]
#define FLAVOR   "ACQ32"

Definition at line 58 of file llcontrol-acq216-core.c.

#define POLLOFF (   td  )     (offset + (td->samples-1) * td_sample_size(td))

Referenced by runSCM216().

#define PRAMS_OFFSET   0x100000

Definition at line 79 of file llcontrol-acq216-core.c.

Referenced by runSCM216().


Function Documentation

static void doApplicationWork216 ( struct TestDescription td,
u32  offset 
) [static]
int runSCM216 ( struct TestDescription td  ) 

runs the test SCM mode, ACQ216 only. PSEUDO-CODE:

  • (1) Clear the latch timer
  • (2) Set a local memory target address and arm the capture
  • (3) Poll for counter running (hardware counter starts on external gate)
  • (4) Iterate for required number of samples:
  • (5) [optionally send a soft clock command] trigger an acquisition
  • (6) Wait for DMA Done - at this point data is available in target mem. A "real" control application is probably getting most of its calcs done here rather than simply polling
  • (7) [Get the latch (sample) and current uSec counters from the boards - only if interested]
  • (8) Check the process has not stopped (external gate high)
  • (9) [optionally update the target address - else it gets overwritten]

Definition at line 100 of file llcontrol-acq216-core.c.

References BP_MB_A4, TestDescription::decimation, TestDescription::do_work, doApplicationWork216(), EACHBBB, EACHBUF, EACHCARD, EACHMBX, FIRSTMBX, FOREACHCARD, FOREACHCARD_MARK_TIME, G_quit, getBusAddr(), getMboxPollcount(), getVaddr(), TestDescription::hardware_gate_off, TimingStats::hb_poll, TestDescription::hb_polling, hbPoll(), hbPrimePoll(), icard, TestDescription::iter, TestDescription::iterations, TestDescription::llc200_init_count, LLC_CSR_M_ARM, LLC_CSR_M_SOFTCLOCK, LLC_MAKE_DECIM, llCounterRunning(), llSetCmd(), llSetTlatch(), MARK_TIME, TestDescription::min_latency_test, TestDescription::overwrite, POLLALERT, POLLOFF, PRAMS_OFFSET, TestDescription::sample_offset, setAcq216Parameters(), setMbox(), TestDescription::stats_buf, TimingStats::target_poll, td_sample_size(), THIS_CARD, TimingStats::tlatch, TestDescription::tlog, updateTargetAddr(), updateTimingStats(), updateTstats, user_abort, and waitDmaDone.

Referenced by runTest().

void setAcq216Parameters ( struct TestDescription td,
struct LLC200_INIT buffer,
int  card,
int  iter 
)

configure card parameters for iteration iter

Definition at line 63 of file llcontrol-acq216-core.c.

References TestDescription::llc200_init, and TestDescription::llc200_init_count.

Referenced by runSCM216().