ep.h 3.46 KB
/*
 *  ep.h: types, macros, etc. for Edge Walker Pipe
 *
 *  9/1/94  RJM
 */

#ifndef EWPIPE_UNIT_INCLD
#define EWPIPE_UNIT_INCLD

/* Total Pipe Depth for edge pipe */
#define EP_ST_SPAN_DLY		(22+5)
#define EP_DATA_DLY		(11+5)
#define EP_XOFFSET_DLY		(23+5)
#define EP_YOFFSET_DLY		(23+5)
#define EP_CVG_DLY		(22+5)
#define EP_MASK_DLY		(25+5)
#define EP_DITHER_DLY		32

/* Signal delays */
#define EP_RGB_DITHER_DLY	30
#define EP_A_DITHER_DLY		26

#define EP_ST_SPAN_W_DLY	4
#define EP_ST_SPAN_S_DLY	6
#define EP_ST_SPAN_T_DLY	6
#define EP_ST_SPAN_R_DLY	(17+5)
#define EP_ST_SPAN_G_DLY	(17+5)
#define EP_ST_SPAN_B_DLY	(17+5)
#define EP_ST_SPAN_A_DLY	(17+5)
#define EP_ST_SPAN_Z_DLY	(20+5)
#define EP_ST_SPAN_TC_DLY	5
#define EP_ST_SPAN_TF_DLY	(15+5)
#define EP_ST_SPAN_CC_DLY	(17+5)
#define EP_ST_SPAN_BL_DLY	(20+5)
#define EP_ST_SPAN_MS_DLY	(17+5)


#define EP_DATA_W_DLY		2
#define EP_DATA_S_DLY		2
#define EP_DATA_T_DLY		1
#define EP_DATA_R_DLY		(9+5)
#define EP_DATA_G_DLY		(8+5)
#define EP_DATA_B_DLY		(7+5)
#define EP_DATA_A_DLY		(6+5)
#define EP_DATA_Z_DLY		(8+5)

#define EP_XOFFSET_R_DLY	(18+5)
#define EP_XOFFSET_G_DLY	(18+5)
#define EP_XOFFSET_B_DLY	(18+5)
#define EP_XOFFSET_A_DLY	(18+5)
#define EP_XOFFSET_Z_DLY	(21+5)

#define EP_YOFFSET_R_DLY	(18+5)
#define EP_YOFFSET_G_DLY	(18+5)
#define EP_YOFFSET_B_DLY	(18+5)
#define EP_YOFFSET_A_DLY	(18+5)
#define EP_YOFFSET_Z_DLY	(21+5)

#define EP_CVG_CC_DLY		(20+5)
#define EP_MASK_BL_DLY		(23+5)

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

  /*    I n p u t    S i g n a l s    */

    int gclk;
    int tlut_en;
    int ew_st_span;
    int ew_d; 		/* [21:0] */
    int cv_x_offset;	/* [1:0]  */
    int cv_y_offset;	/* [1:0]  */
    int cv_cvg;		/* [3:0]  */
    int cv_mask;	/* */
    int tc_load;	/* */
    int cycle_type;	/* [1:0] */

    int dither_type;	/* flag */
    int x_dither;	/* [1:0] */
    int y_dither;	/* [1:0] */
  
  /*    O u t p u t    S i g n a l s    */

    int st_span_st_w;
    int st_span_st_s;
    int st_span_st_t;
    int st_span_st_r;
    int st_span_st_g;
    int st_span_st_b;
    int st_span_st_a;
    int st_span_st_z;
    int st_span_tc;
    int st_span_tf;
    int st_span_cc;
    int st_span_bl;
    int st_span_ms;
    int d_w;		/* [21:0], s,.21 */
    int d_s;		/* [21:0], s,10.11 */
    int d_t;		/* [21:0], s,10.11 */
    int d_r;		/* [15:0], s,9.6 */
    int d_g;		/* [15:0], s,9.6 */
    int d_b;		/* [15:0], s,9.6 */
    int d_a;		/* [15:0], s,9.6 */
    int d_z;		/* [21:0], s,15.6 */
    int x_offset_r;	/* [1:0] */
    int x_offset_g;	/* [1:0] */
    int x_offset_b;	/* [1:0] */
    int x_offset_a;	/* [1:0] */
    int x_offset_z;	/* [1:0] */
    int y_offset_r;	/* [1:0] */
    int y_offset_g;	/* [1:0] */
    int y_offset_b;	/* [1:0] */
    int y_offset_a;	/* [1:0] */
    int y_offset_z;	/* [1:0] */
    int cvg_cc;		/* [3:0] */
    int mask_bl;	/*  */

    /* dither output */
    int rgb_dither;	/* [2:0] */
    int alpha_dither;	/* [2:0] */

  /*    I n t e r n a l     R e g i s t e r s    */

    unsigned int st_span[EP_ST_SPAN_DLY];
    unsigned int d[EP_DATA_DLY];
    unsigned int x_offset[EP_XOFFSET_DLY];
    unsigned int y_offset[EP_YOFFSET_DLY];
    unsigned int cvg[EP_CVG_DLY];
    unsigned int mask[EP_MASK_DLY];
    unsigned int dither[EP_DITHER_DLY];

    unsigned int tc_load_1d: 1;

} ep_t;


/*
 *  Prototypes
 */

void ep(ep_t **pp0, ep_t **pp1);
void ep_init(ep_t *p0, ep_t *p1);


#endif /* EWPIPE_UNIT_INCLD */