csgclk.h 2.07 KB
/*
 *  csgclk.h: header file for Comand Shuffle Unit that uses the gclk
 *  (gated clock).
 *
 * 
 */

#ifndef CSGCLK_MODULE_INCLD
#define CSGCLK_MODULE_INCLD

#include "ints.h"


/*
 *  Comand Shuffle Unit Registers
 */
typedef struct
{
  /* required by C-sim */
    char *label;
    char **argv;
    int argc;
    int gclk_old;
    int clk_old;

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

    int   gclk;
    int   clk;
    int   ew_cs_busy;
    int   ms_busy;
    int   rel_sync_tile;
    int   rel_sync_pipe;
    int   rel_sync_full;
    int   rel_sync_load;
    int   texel_size;		/* [1:0], texture image size code */
    int   copy_fill;
    int   reset_l;

    int   wr_adrs;		/* write address, from csclk */

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

    int pre_req_dma;

    int    tile_addr;		/* [2:0] */
    int64  cs_tc_data;		/* [47:0] */
    int    we_tile_size;
    int    we_tile_attr;
    int64  cs_ew_data;		/* [63:0] */
    int    cs_ew_newprim;

    unsigned int cmd: 6;		/* RDP command code */
    int	   start_prim;
    int	   attr_valid;
    int	   cmd_busy;

  /*   I n t e r m e d i a t e    S i g n a l s    */

    unsigned int read_adrs: 6;		/* [5:0], read address counter */
    unsigned int shf_state: 5;  	/* [4:0] shuffle state machine state */
    unsigned int cmd_size: 5;		/* command size in 64-bit words */
    unsigned int delay_state: 5;	/* delayed shf_state */

    int64 fifo_data;			/* fifo data register */

    unsigned int sync_tile_state: 1;	/* synchronization state machine */
    unsigned int sync_pipe_state: 1;	/* synchronization state machine */
    unsigned int sync_full_state: 1;	/* synchronization state machine */
    unsigned int sync_load_state: 1;	/* synchronization state machine */

    unsigned int stop_wen: 1;

    int clk_count;
    int gclk_count;

  /*  KRUFT added to end of structure to avoid clobbering existing modules */
    int empty_delay;			/* empty signal, delayed by 1 gclk */
} csgclk_t;

/*
 *  Function Prototypes
 */
void csgclk(csgclk_t **pp0, csgclk_t **pp1);
void csgclk_init(csgclk_t *p0, csgclk_t *p1);

#endif /* CSGCLK_MODULE_INCLD */