driver.h 6.63 KB
/*
 *  driver.h, memory structure for ST driver
 *
 *
 *
 */

#ifndef DRIVER_INCLUDE
#define DRIVER_INCLUDE

#define AT_ST_DXR_DLYS      1
#define AT_ST_DXG_DLYS      1
#define AT_ST_DXB_DLYS      1
#define AT_ST_DXA_DLYS      1
#define AT_ST_DXZ_DLYS      1
#define AT_ST_DXS_DLYS      1
#define AT_ST_DXT_DLYS      1
#define AT_ST_DXW_DLYS      1
#define AT_ST_DXL_DLYS      1

#define AT_ST_DYR_DLYS      1
#define AT_ST_DYG_DLYS      1
#define AT_ST_DYB_DLYS      1
#define AT_ST_DYA_DLYS      1
#define AT_ST_DYZ_DLYS      1

#define X_OFFSETR_DLYS      1
#define X_OFFSETG_DLYS      1
#define X_OFFSETB_DLYS      1
#define X_OFFSETA_DLYS      1
#define X_OFFSETZ_DLYS      1

#define Y_OFFSETR_DLYS      1
#define Y_OFFSETG_DLYS      1
#define Y_OFFSETB_DLYS      1
#define Y_OFFSETA_DLYS      1
#define Y_OFFSETZ_DLYS      1

#define LEFT_R_DLYS         1
#define LEFT_G_DLYS         1
#define LEFT_B_DLYS         1
#define LEFT_A_DLYS         1
#define LEFT_Z_DLYS         1
#define LEFT_S_DLYS         1
#define LEFT_T_DLYS         1
#define LEFT_W_DLYS         1
#define LEFT_L_DLYS         1

#define DV_DLYS             2

#define DELAY_ONE
#define DELAY_TWO

#define DUMPALL     1
#define DUMPCOMP    2

typedef struct {
  /* required */
  char *label;  /* label must be first */
  int gclk_old;
  int argc;
  char **argv;

  /* input */

  int gclk;

  /* output */

  int ew_d;           /* Temporary for stand alone testing */
  int tlut_en;        /* Temporary for stand alone testing */

  int startspan_r;    /* */
  int startspan_g;    /* */
  int startspan_b;    /* */
  int startspan_a;    /* */
  int startspan_z;    /* */
  int startspan_s;    /* */
  int startspan_t;    /* */
  int startspan_w;    /* */
  int startspan_l;    /* */
  
  int ep_st_r;        /* [20:0], change in x, s,10.10 */
  int ep_st_g;        /* [20:0], change in x, s,10.10 */
  int ep_st_b;        /* [20:0], change in x, s,10.10 */
  int ep_st_a;        /* [20:0], change in x, s,10.10 */
  int ep_st_z;        /* [31:0], change in y, s,15.16 */
  int ep_st_s;        /* [31:0], change in y, s,15.16 */
  int ep_st_t;        /* [31:0], change in y, s,15.16 */
  int ep_st_w;        /* [31:0], change in y, s,15.16 */
  int ep_st_l;        /* [31:0], change in y, s,15.16 */
  
  int at_st_dxr;      /* [21:0], change in x, s,10.11 */
  int at_st_dxg;      /* [21:0], change in x, s,10.11 */
  int at_st_dxb;      /* [21:0], change in x, s,10.11 */
  int at_st_dxa;      /* [21:0], change in x, s,10.11 */
  int at_st_dxz;      /* [31:0], change in x, s,15.16 */
  int at_st_dxs;      /* [31:0], change in x, s,15.16 */
  int at_st_dxt;      /* [31:0], change in x, s,15.16 */
  int at_st_dxw;      /* [31:0], change in x, s,15.16 */
  int at_st_dxl;      /* [31:0], change in x, s,15.16 */
  
  int at_st_dyr;      /* [12:0], change in y, s,10.2 */
  int at_st_dyg;      /* [12:0], change in y, s,10.2 */
  int at_st_dyb;      /* [12:0], change in y, s,10.2 */
  int at_st_dya;      /* [12:0], change in y, s,10.2 */
  int at_st_dyz;      /* [21:0], change in y, s,10.11 */
  
  int x_offsetr;      /* [1:0], subpixel offset in x, 0.2 */
  int x_offsetg;      /* [1:0], subpixel offset in x, 0.2 */
  int x_offsetb;      /* [1:0], subpixel offset in x, 0.2 */
  int x_offseta;      /* [1:0], subpixel offset in x, 0.2 */
  int x_offsetz;      /* [1:0], subpixel offset in x, 0.2 */
  
  int y_offsetr;      /* [1:0], subpixel offset in y, 0.2 */
  int y_offsetg;      /* [1:0], subpixel offset in y, 0.2 */
  int y_offsetb;      /* [1:0], subpixel offset in y, 0.2 */
  int y_offseta;      /* [1:0], subpixel offset in y, 0.2 */
  int y_offsetz;      /* [1:0], subpixel offset in y, 0.2 */
  
  int ncyc_r;         /* */
  int ncyc_g;         /* */
  int ncyc_b;         /* */
  int ncyc_a;         /* */
  int ncyc_z;         /* */
  int ncyc_s;         /* */
  int ncyc_t;         /* */
  int ncyc_w;         /* */
  int ncyc_l;         /* */
  
  int left_r;         /* */
  int left_g;         /* */
  int left_b;         /* */
  int left_a;         /* */
  int left_z;         /* */
  int left_s;         /* */
  int left_t;         /* */
  int left_w;         /* */
  int left_l;         /* */
  int dv;             /* */

  int exit;           /* simulator exit */

  /*  Intermediate signals */

  int at_st_dxr_dly[AT_ST_DXR_DLYS];      /* [21:0], change in x, s,10.11 */
  int at_st_dxg_dly[AT_ST_DXG_DLYS];      /* [21:0], change in x, s,10.11 */
  int at_st_dxb_dly[AT_ST_DXB_DLYS];      /* [21:0], change in x, s,10.11 */
  int at_st_dxa_dly[AT_ST_DXA_DLYS];      /* [21:0], change in x, s,10.11 */
  int at_st_dxz_dly[AT_ST_DXZ_DLYS];      /* [31:0], change in x, s,15.16 */
  int at_st_dxs_dly[AT_ST_DXS_DLYS];      /* [31:0], change in x, s,15.16 */
  int at_st_dxt_dly[AT_ST_DXT_DLYS];      /* [31:0], change in x, s,15.16 */
  int at_st_dxw_dly[AT_ST_DXW_DLYS];      /* [31:0], change in x, s,15.16 */
  int at_st_dxl_dly[AT_ST_DXL_DLYS];      /* [31:0], change in x, s,15.16 */
  
  int at_st_dyr_dly[AT_ST_DYR_DLYS];      /* [12:0], change in y, s,10.2 */
  int at_st_dyg_dly[AT_ST_DYG_DLYS];      /* [12:0], change in y, s,10.2 */
  int at_st_dyb_dly[AT_ST_DYB_DLYS];      /* [12:0], change in y, s,10.2 */
  int at_st_dya_dly[AT_ST_DYA_DLYS];      /* [12:0], change in y, s,10.2 */
  int at_st_dyz_dly[AT_ST_DYZ_DLYS];      /* [21:0], change in y, s,10.11 */
  
  int x_offsetr_dly[X_OFFSETR_DLYS];      /* [1:0], subpixel offset in x, 0.2 */
  int x_offsetg_dly[X_OFFSETG_DLYS];      /* [1:0], subpixel offset in x, 0.2 */
  int x_offsetb_dly[X_OFFSETB_DLYS];      /* [1:0], subpixel offset in x, 0.2 */
  int x_offseta_dly[X_OFFSETA_DLYS];      /* [1:0], subpixel offset in x, 0.2 */
  int x_offsetz_dly[X_OFFSETZ_DLYS];      /* [1:0], subpixel offset in x, 0.2 */
  
  int y_offsetr_dly[Y_OFFSETR_DLYS];      /* [1:0], subpixel offset in y, 0.2 */
  int y_offsetg_dly[Y_OFFSETG_DLYS];      /* [1:0], subpixel offset in y, 0.2 */
  int y_offsetb_dly[Y_OFFSETB_DLYS];      /* [1:0], subpixel offset in y, 0.2 */
  int y_offseta_dly[Y_OFFSETA_DLYS];      /* [1:0], subpixel offset in y, 0.2 */
  int y_offsetz_dly[Y_OFFSETZ_DLYS];      /* [1:0], subpixel offset in y, 0.2 */

  int left_r_dly[LEFT_R_DLYS];         /* */
  int left_g_dly[LEFT_G_DLYS];         /* */
  int left_b_dly[LEFT_B_DLYS];         /* */
  int left_a_dly[LEFT_A_DLYS];         /* */
  int left_z_dly[LEFT_Z_DLYS];         /* */
  int left_s_dly[LEFT_S_DLYS];         /* */
  int left_t_dly[LEFT_T_DLYS];         /* */
  int left_w_dly[LEFT_W_DLYS];         /* */
  int left_l_dly[LEFT_L_DLYS];         /* */

  unsigned int dv_dly[DV_DLYS];  
} driver_t;


/*
 *  Prototypes
 */
void driver(driver_t **pp0, driver_t **pp1);
void driver_init(driver_t *p0, driver_t *p1);

#endif /* DRIVER_INCLUDE */