00001
00002
00003
00004 #ifndef CL_LOGIC_LIB_H
00005 #define CL_LOGIC_LIB_H
00006
00007 #define FV_MASK 0x4000
00008 #define LV_MASK 0x2000
00009 #define DV_MASK 0x1000
00010 #define CLOCK_MASK 0xfff
00011
00012 #define CL_LOGIC_MAXLINES 0x8000
00013
00014 #define CL_LOGIC_DEFAULT_BUFSIZE 4096
00015
00016 #include "edtinc.h"
00017
00018 void pdv_cl_logic_set_bufsize(int new_nbuffers, int new_bufsize);
00019
00020 typedef struct line_delta
00021 {
00022 int newval;
00023 int delta;
00024 int n;
00025 } ClLineDelta;
00026
00027 typedef struct
00028 {
00029 int low, high, mean;
00030 uint64_t sum;
00031 unsigned int n;
00032 } ClLogicStat;
00033
00034
00035
00036 typedef struct frame_summary {
00037 int frame_blank, line_blank, width, height;
00038 } ClFrameSummary;
00039
00040
00041
00042 typedef struct cl_logic_summary
00043 {
00044 ClLogicStat
00045 frameclocks,
00046 width,
00047 totallineclocks,
00048 height,
00049 frame_gap,
00050 totalframeclocks,
00051 hblank,
00052 start_hblank,
00053 end_hblank,
00054 current_width,
00055
00056 hblank_frame;
00057 int nLines;
00058 ClLogicStat line_stats[CL_LOGIC_MAXLINES];
00059
00060 double pixel_clock;
00061
00062 int numbufs;
00063 int bufsize;
00064 int testmask;
00065 int timeout;
00066
00067
00068
00069 int nframesallocated;
00070 int nframes;
00071 int current_frame;
00072 ClFrameSummary *frames;
00073
00074 } ClLogicSummary;
00075
00076
00077
00078 EDTAPI void
00079 cl_logic_stat_print(char *label, ClLogicStat * clp, double clockspeed, int verbose);
00080
00081 EDTAPI int
00082 cl_logic_stats_neq(ClLogicStat * clp1, ClLogicStat * clp2);
00083
00084
00085
00086 EDTAPI int
00087 pdv_cl_logic_sample(PdvDev *pdv_p,
00088 FILE *f,
00089 ClLogicSummary *clsp,
00090 int verbose,
00091 int quiet,
00092 int load,
00093 char *outfilename,
00094 unsigned int loops,
00095 int timeouts,
00096 int max_timeouts);
00097
00098 EDTAPI void
00099 cl_logic_summary_init(ClLogicSummary * cls_p,
00100 int testmask,
00101 int numbufs,
00102 int bufsize,
00103 int timeout,
00104 double pixel_clock);
00105
00106
00107 #endif