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 #ifndef __LLCONTROL_CORE_H__
00035 #define __LLCONTROL_CORE_H__
00036
00037
00038 #define HOST_TIMING 1
00039 #define IGNORE_COUNTER_STOP 0
00040
00041 #define POLLALERT(ipoll, message) \
00042 if ( (++ipoll&0xfffff) == 0 ) fprintf( stderr, message )
00043
00044 #if HOST_TIMING > 1
00045 #define INIT_TIMER get_elapsed_microseconds(1)
00046 #define MARK_TIME(t, ident) do { \
00047 tstats[icard].test_points[t] = get_elapsed_microseconds(0);\
00048 fprintf(stderr, "MARK_TIME %s\n", ident); \
00049 } while(0)
00050 #define FOREACHCARD_MARK_TIME(t, ident) FOREACHCARD{ MARK_TIME(t, ident); }
00051 #define TIMER_CHECK_OVERFLOW \
00052 if (get_elapsed_microseconds(0) > 99000) INIT_TIMER
00053 #warning HOST_TIMING enabled
00054 #elif HOST_TIMING
00055 #define INIT_TIMER get_elapsed_microseconds(1)
00056 #define MARK_TIME(t, ident) do { \
00057 tstats[icard].test_points[t] = get_elapsed_microseconds(0);\
00058 } while(0)
00059 #define FOREACHCARD_MARK_TIME(t, ident) FOREACHCARD{ MARK_TIME(t, ident); }
00060 #define TIMER_CHECK_OVERFLOW \
00061 if (get_elapsed_microseconds(0) > 99000) INIT_TIMER
00062 #warning HOST_TIMING enabled
00063 #else
00064 #define INIT_TIMER
00065 #define MARK_TIME(t, ident)
00066 #define FOREACHCARD_MARK_TIME(t, ident)
00067 #define TIMER_CHECK_OVERFLOW
00068 #endif
00069
00070
00071 void appEnterLLC_SYNC_ECM(
00072 int icard, struct MU *mu, struct TestDescription *td);
00073 int runSYNC_ECM(struct TestDescription *td, int soft_clock);
00074
00075
00076
00077 void appEnterLLC_SYNC_2V(
00078 int icard, struct MU *mu, struct TestDescription *td);
00079
00080 int runSYNC_2V(struct TestDescription *td, int soft_clock);
00081
00082 void appEnterLLC_SYNC_2VAO32(
00083 int icard, struct MU *mu, struct TestDescription *td);
00084
00085 void appEnterLLC_SYNC_2VRFM(void);
00086
00087 int runSYNC_2VAO32(struct TestDescription *td, int soft_clock);
00088
00089 int runSYNC_2VRFM(struct TestDescription *td, int soft_clock);
00090
00091
00092 int runSCM216(struct TestDescription* td);
00093
00094
00095 extern void (*updateTstats)(
00096 u32 cmd, struct Card* card, struct TimingStats* tstats);
00097
00098
00099
00100
00101 extern u32 (*waitDmaDone)(struct Card *c);
00102
00103
00104
00105
00106 u32 commandModifiers(struct TestDescription *td);
00107
00108
00109 static inline void updateTargetAddr(
00110 u32 cmd, struct Card* card, unsigned offset)
00111 {
00112 u32 baddr = getBusAddr(card->buf, offset);
00113 llSetAddr(card->mbx, baddr, cmd );
00114 PRINTF(2)("llSetAddr [%d] 0x%08x\n", card->slot, baddr);
00115 }
00116
00117
00118 static inline void* td_get_next_dac_data(struct TestDescription* td)
00119 {
00120 void* dac_data = td->dac_data + td->dac_cursor;
00121
00122 int new_cursor = td->dac_cursor + DAC_SAMPLE_SIZE;
00123
00124 if (new_cursor+DAC_SAMPLE_SIZE > td->dac_data_samples*DAC_SAMPLE_SIZE){
00125 td->dac_cursor = 0;
00126 }else{
00127 td->dac_cursor = new_cursor;
00128 }
00129 return dac_data;
00130 }
00131
00132 extern void doApplicationWork(struct TestDescription* td, u32 offset);
00133
00134
00135 extern int user_abort;
00136
00137
00138 extern void initV2Stats(struct TestDescription* td);
00139
00140 extern void v2_updateTstats(
00141 u32 cmd, struct Card* card, struct TimingStats* tstats);
00142
00143
00144
00145 extern u32 card_v2_WaitDmaDone(struct Card* card);
00146 #endif // __LLCONTROL_CORE_H__