demonstrates SYNC_2V mode with AO32CPCI. 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 "ACQ196" |
#define | SAMPLE_SIZE (96*2) |
#define | BAR_FIFO 3 |
#define | EACHBBB (dac_buf[icard].bbb) |
#define | EACHDAC_BASE (EACHBBB + LLCV2_AO_HSBS) |
#define | EACHDAC_BASE16 ((u16*)EACHDAC_BASE) |
#define | BASE_AO32(ic) ((u32*)EACHDAC_BASE+INDEX_OF_LLC_SYNC2V_AO32(ic)) |
#define | V2SETDACS(src, icard) memcpy(EACHDAC_BASE, (src)+(icard)*32, DAC_SAMPLE_SIZE) |
#define | OFFSET 0 |
Functions | |
static void | sync_2v_updateTstats (u32 cmd, struct Card *card, struct TimingStats *tstats) |
updates timing stats from embedded host buffer data | |
static u32 | card_sync_2v_WaitDmaDone (struct Card *card) |
static u32 | getSlavePa (int slot) |
static void | setSlaveData (u32 *aovec, void *src) |
create some data for AO32CPCI. | |
void | appEnterLLC_SYNC_2VAO32 (int icard, struct MU *mu, struct TestDescription *td) |
set up LLCV2_INIT buffer and enter mode. | |
int | runSYNC_2VAO32 (struct TestDescription *td, int soft_clock) |
runs the test SYNC_2V mode. |
demonstrates SYNC_2V mode with AO32CPCI.
Definition in file llcontrol-sync2VAO32-core.c.
#define BAR_FIFO 3 |
Definition at line 113 of file llcontrol-sync2VAO32-core.c.
Referenced by getSlavePa().
#define BASE_AO32 | ( | ic | ) | ((u32*)EACHDAC_BASE+INDEX_OF_LLC_SYNC2V_AO32(ic)) |
Referenced by runSYNC_2VAO32().
#define EACHBBB (dac_buf[icard].bbb) |
#define EACHDAC_BASE (EACHBBB + LLCV2_AO_HSBS) |
#define EACHDAC_BASE16 ((u16*)EACHDAC_BASE) |
#define FLAVOR "ACQ196" |
Definition at line 78 of file llcontrol-sync2VAO32-core.c.
#define OFFSET 0 |
#define SAMPLE_SIZE (96*2) |
#define V2SETDACS | ( | src, | ||
icard | ||||
) | memcpy(EACHDAC_BASE, (src)+(icard)*32, DAC_SAMPLE_SIZE) |
void appEnterLLC_SYNC_2VAO32 | ( | int | icard, | |
struct MU * | mu, | |||
struct TestDescription * | td | |||
) |
set up LLCV2_INIT buffer and enter mode.
Buffer set up as 4K block at offset 0
set up for single 4K buffer
uses V2 synchronization
Definition at line 168 of file llcontrol-sync2VAO32-core.c.
References TestDescription::ao32_count, TestDescription::ao32_ids, TestDescription::arg, BP_FC_SET_LLCV2_INIT, TestDescription::cards, TestDescription::channels, TestDescription::clkpos, TestDescription::ARG::divisor, EACHBUF, enterLLC_SYNC_ECM(), getBusAddr(), getSlavePa(), getVaddr(), TestDescription::internal_loopback, LLCV2_AI_HSBT, llcv2_hb_offset, LLCV2_INIT_AO32PA0, MASTER, PRINTF, short, Card::sync_2v_offset_status_hsbt, Card::tlatch, TestDescription::trpos, updateTstats, and waitDmaDone.
Referenced by runTest().
Definition at line 93 of file llcontrol-sync2VAO32-core.c.
References Card::buf, getVaddr(), llv2WaitDmaDone_2v(), Card::mbx, Card::sync_2v_offset_status_hsbt, and Card::tlatch.
static u32 getSlavePa | ( | int | slot | ) | [static] |
Definition at line 115 of file llcontrol-sync2VAO32-core.c.
References BAR_FIFO, fclose(), fname, and len.
Referenced by appEnterLLC_SYNC_2VAO32().
int runSYNC_2VAO32 | ( | struct TestDescription * | td, | |
int | soft_clock | |||
) |
runs the test SYNC_2V mode.
PSEUDO-CODE:
(b.2)
AO32 update: apply to MASTER only
Definition at line 213 of file llcontrol-sync2VAO32-core.c.
References TestDescription::ao32_count, BASE_AO32, DAC_COUNT, TestDescription::decimation, TestDescription::do_work, doApplicationWork(), EACHBBB, EACHBUF, EACHCARD, EACHDAC_BASE, EACHDAC_BASE16, EACHMBX, TestDescription::feedback, TestDescription::feedback_channel, FIRSTBUF, FIRSTMBX, FOREACHCARD, FOREACHCARD_MARK_TIME, G_quit, getBusAddr(), getMboxPollcount(), getVaddr(), TestDescription::hardware_gate_off, icard, TestDescription::iter, TestDescription::iterations, LLC_CSR_M_ARM, LLC_CSR_M_SOFTCLOCK, LLC_MAKE_DECIM, llCounterRunning(), LLCV2_AO_HSBS, llSetCmd(), llSetTlatch(), llv2InitDmaDone(), MARK_TIME, memset32(), TestDescription::min_latency_test, OFFSET, POLLALERT, PRINTF, setSlaveData(), TestDescription::stats_buf, TimingStats::target_poll, td_get_next_dac_data(), THIS_CARD, TimingStats::tlatch, TestDescription::tlog, TestDescription::update_dacs, updateTargetAddr(), updateTimingStats(), updateTstats, V2SETDACS, and waitDmaDone.
Referenced by runTest().
static void setSlaveData | ( | u32 * | aovec, | |
void * | src | |||
) | [static] |
create some data for AO32CPCI.
AO32 gets AO16 data duplicated, DO64 gets a walking bit
Definition at line 150 of file llcontrol-sync2VAO32-core.c.
Referenced by runSYNC_2VAO32().
static void sync_2v_updateTstats | ( | u32 | cmd, | |
struct Card * | card, | |||
struct TimingStats * | tstats | |||
) | [static] |
updates timing stats from embedded host buffer data
Definition at line 82 of file llcontrol-sync2VAO32-core.c.
References Card::buf, getVaddr(), LLC_GET_TCYCLE, LLC_SYNC2V_IN_MBOX0, LLC_SYNC2V_IN_MBOX2, LLC_SYNC2V_IN_TINST, llv2_extend32(), Card::sync_2v_offset_status_hsbt, TimingStats::tinst, and TimingStats::tprocess.