Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 #ifndef __LLCONTROL_H__
00096 #define __LLCONTROL_H__
00097
00098 extern int verbose;
00099 extern int G_quit;
00100
00101 #define MAXTEST 12
00102
00103
00104 struct Card {
00105 int slot;
00106 struct MU* mbx;
00107 struct DmaBuffer* buf;
00108
00109 unsigned tlatch;
00110 unsigned sync_2v_offset_status_hsbt;
00111 };
00112
00113
00114 struct TimingStats {
00115 int iter;
00116 u32 tlatch;
00117 u32 tinst;
00118 u32 tprocess;
00119 int hb_poll;
00120
00121
00122
00123 int target_poll;
00124
00125 u32 test_points[MAXTEST];
00126 };
00127
00128
00129
00130 #define ACQ196_BIGBUF_AREA 0x1000000
00131 #define MAXCARDS 16
00132 #define MAXAO32 6
00133
00134
00135 struct TestDescription {
00136 enum Mode {
00137 M_NULL,
00138 M_SCM,
00139 M_ECS,
00140 M_ECM,
00141 M_SYNC_ECM,
00142 M_SYNC_2V,
00143 M_SYNC_2VAO32,
00144 M_MEASURE_BRIDGE,
00145 M_SYNC_2VRFM
00146 } mode;
00147
00148 struct ARG {
00149 int interval;
00150 int divisor;
00151 }
00152 arg;
00153 int iter;
00154
00155 int iterations;
00156 int decimation;
00157 int overwrite;
00158 const char*outfname;
00159 int do_work;
00160 int clkpos;
00161 int trpos;
00162 int internal_loopback;
00163 int min_latency_test;
00164
00165 int mask_ints;
00166 int mask_ints_mask;
00167
00168 int ncards;
00169 struct Card cards[MAXCARDS];
00170
00171 struct TimingStats* stats_buf[MAXCARDS];
00172
00173 void* work_buf[MAXCARDS];
00174
00175 int channels;
00176 int samples;
00177 int sample_size;
00178 int hb_polling;
00179
00180 int update_dacs;
00181 char* dac_data_file;
00182 char* dac_data;
00183 int dac_data_samples;
00184 int dac_cursor;
00185
00186 int feedback;
00187 int feedback_channel;
00188
00189 int tlog;
00190 const char* tlog_binfile;
00191 int sample_offset;
00192
00193 int hardware_gate_off;
00194
00195 u32 V2_BUFS[8];
00196
00197 int ao32_count;
00198 int ao32_ids[MAXAO32];
00199
00200 struct LLC200_INIT *llc200_init;
00201 int llc200_init_count;
00202 int acq216hs_ch12ch34_bonding;
00203 };
00204
00205 #define LLC200_INIT_SZ sizeof(struct LLC200_INIT)
00206
00207 #define V2_NOBUF 1
00208
00209 #define IS_SYNC_2V(mode) \
00210 ((mode) == M_SYNC_2V || (mode) == M_SYNC_2VAO32 || \
00211 (mode) == M_SYNC_2VRFM)
00212
00213
00214
00215
00216
00217
00218
00219
00220 #define EACHCARD_INIT int icard
00221
00222 #define EACHCARD(td) (&(td)->cards[icard])
00223 #define EACHMBX(td) ((td)->cards[icard].mbx)
00224 #define EACHBUF(td) ((td)->cards[icard].buf)
00225 #define EACHSLOT(td) ((td)->cards[icard].slot)
00226
00227
00228
00229
00230 #define FOREACHCARD for (icard = 0; icard != td->ncards; ++icard)
00231
00232 #define FIRSTCARD(td) (&(td)->cards[0])
00233 #define FIRSTMBX(td) ((td)->cards[0].mbx)
00234 #define FIRSTBUF(td) ((td)->cards[0].buf)
00235 #define FIRSTSLOT(td) ((td)->cards[0].slot)
00236
00237 #define THIS_CARD icard
00238 #define MASTER (icard == 0)
00239
00240
00241
00242
00243
00244 int runTest( struct TestDescription* td );
00245 void setupAbortHandler( struct TestDescription* td );
00246 void setupMonitor( int millisec );
00247 void initCardResource(struct Card* card);
00248
00249
00250
00251
00252
00253
00254
00255
00256 static inline int td_sample_size(struct TestDescription* td)
00257 {
00258 return td->sample_size;
00259
00260 }
00261 static inline int td_dss(struct TestDescription* td)
00262 {
00263 return td_sample_size(td) * td->iterations;
00264 }
00265
00266
00267 static inline int isAcq216(void) {
00268 return getenv("ACQ216") != 0 || getenv("ACQ216HS") != 0;
00269 }
00270 static inline int isAcq216HS(void) {
00271 return getenv("ACQ216HS") != 0;
00272 }
00273
00274
00275 void updateTimingStats(
00276 struct TimingStats* buffer, int iter, struct TimingStats* stats);
00277 #endif