tab2sim.h 1.68 KB
/*
 *  tab2sim.h 
 */

#ifndef TAB2SIM_INCLD
#define TAB2SIM_INCLD

#define MAX_SIGNALS	1024
#define MAX_CLOCKS	50
#define MAX_SIG_NAME	100
#define MAX_CLK_PHASES  10


typedef enum {
  QSIM_INPUT,
  QSIM_OUTPUT,
  QSIM_BIDIR,
  QSIM_VALID
} SignalNodeType;


typedef struct {
  char			sig_name[MAX_SIG_NAME];
  char			val_sig_name[MAX_SIG_NAME]; /* data valid */
  char			en_sig_name[MAX_SIG_NAME]; /* output enable sig name */
  char			clk_sig_name[MAX_SIG_NAME]; /* output enable sig name */
  int			msb;
  int			lsb;
  int			size;    /* bits */
  int			hex_dig; /* nibbles */
  float			edge;    /* nanoseconds */
  int			edgev;   /* edge time / fastest clock period */
  float			strobe;  /* nanoseconds */
  int			strobev; /* strobe time / fastest clock period */
  int 			multiple; /* multiple of vector rate this signal changes at */
  SignalNodeType	type;
  int			valid;   /* valid signal present */
  int			val_sig_indx;   /* valid signal index */
  int			oe_sig_indx;   /* output enable signal index */
  int			polarity;/* polarity of output enable sig, 0 = active low */
} SigDef;


typedef struct {
  char			sig_name[MAX_SIG_NAME];
  int                   val[MAX_CLK_PHASES];
  float                 time[MAX_CLK_PHASES];
  int                   phases;   /* how many transitions in a period */
  float                 period;	  /* period of clock */
  int                   multiple; /* multiple of fastest clock */
  int			dummy;    /* dummy clock, not echoed to sim file */
} ClockDef;


typedef struct {
  int 			indx;  /* original index of signal in vector */
  float			time;  /* edge or strobe time */
  int			bidir; /* 1 is input entry, 0 is output entry */
} SortTable;

#endif /* TAB2SIM_INCLD */