vudefs.h 2.93 KB

#define TAB_SIZE   (sizeof (tab)   / sizeof (tab[0])  )
#define OPTAB_SIZE (sizeof (optab) / sizeof (optab[0]))
#define ELTAB_SIZE (sizeof (eltab) / sizeof (eltab[0]))
#define REGTAB_SIZE (sizeof (regtab) / sizeof (regtab[0]))
#define RIDX_SIZE (sizeof (reg_index) / sizeof (reg_index[0]))


typedef signed char     i8;             /* signed */
typedef short int       i16;
typedef long int        i32;
typedef long long int   i64;

typedef unsigned char           u8;     /* unsigned */
typedef unsigned short int      u16;
typedef unsigned long int       u32;
typedef unsigned long long int  u64;
typedef enum
 {
 SRC =0,
 TRG =1,
 DST =2,
 ACCL=3,
 ACCM =4,
 ACCH =5,
 DST_EXP =6,
 ACCL_EXP =7,
 ACCM_EXP =8,
 ACCH_EXP =9,
 TEMP =10,
 V4000 =11,
 V0001 =12,
 VTH =13,
 VTL =14,
 VDH =15,
 VDL =16,
 VDH_Exp =17,
 VDL_Exp =18,
 VSH =19,
 VSL =20
 } REG_TYPE;


typedef enum
  {
   V_SRC,
   V_TRG,
   V_DDATA,
   V_ACCL,
   V_ACCM,
   V_ACCH,
   INVCO,
   INVCE,
   INVCO_H,
   INVCO_L,
   INVCC,
   V_ELM,
   OPER,
   START,
   END,
   COMMENT,
   C_RETURN,
   PROG_NAME,
   R_ASSIGN,
   VSH_OFF,
   ELH_OFF
  } LINE_TYPE;
   
typedef enum
  {
   /*ADD GROUP */
   VADD,
   VSUB,
   VSUT,
   VABS,
   VADDC,
   VSUBC,
   VADDB,
   VSUBB,
   VACCB,
   VSUCB,
   VSAD,
   VSAC,
   VSUM,
   VSAW,
   /*LOGIC GROUP */
   VAND,
   VNAND,
   VOR,
   VNOR,
   VXOR,
   VXNOR,
   /*MUL GROUP */
   VMULF,
   VMACF,
   VMULU,
   VMACU,
   VRNDP,
   VRNDN,
   VMULQ,
   VMACQ,
   VMUDL,
   VMADL,
   VMUDM,
   VMADM,
   VMUDN,
   VMADN,
   VMUDH,
   VMADH,
   /*SELECT GROUP */
   VLT,
   VEQ,
   VNE,
   VGE,
   VCH,
   VCL,
   VCR,
   VMRG,
   /* INS, EXTR  GROUP */
   VINS_T,
   VINS_Q,
   VINS_N,
   VEXT_T,
   VEXT_Q,
   VEXT_N,
   /*DIV GROUP */
   SP_RECP,
   SP_SQRT,
   DP_RECP,
   DP_SQRT,
   DP_RECP_CHAIN,
   DP_SQRT_CHAIN,
   INIT_DIV,
   VMOV,
   DP_MUL
   /*LOAD GROUP */
   /*STORE GROUP */
  } OP_TYPE;

typedef struct 
  {
  char *name;
  int enu_name;
  } TABLE;

typedef struct 
  {
  char *name;
  int enu_name;
  int rnum;
  } RTABLE;

typedef struct 
  {
  char *name;
  int enu_name;
  char *op_tmplt;
  } OP_TABLE;

typedef struct 
  {
  char *name;
  int el_value;
  char *sub_field;
  } EL_TABLE;

extern TABLE  tab[], reg_index[];
extern OP_TABLE optab[];
extern RTABLE regtab[];
extern EL_TABLE eltab[];

extern u16 vs[8], vt[8], vd[8], in_vco, el, out_vco, in_vcc, out_vcc;
extern u8  in_vce, out_vce;
extern u16 data[2048];
extern int data_pntr;
extern int test_num;
extern int index, opindex, elindex, rtabindex, ridx;
extern char el_sf[10];
extern u16  out_vaccl[8], out_vaccm[8], out_vacch[8];
extern u16  in_vaccl[8], in_vaccm[8], in_vacch[8];
extern char prog_name[];
extern i64  vacc[8], vacc_B[8],dp_res[8];
extern u32 div_in[8],div_out[8];
extern u32 dp_vs[8],dp_vt[8];
extern u16 vdh[8],vdl[8],vth[8],vtl[8],vsh[8],vsl[8];
extern int div_in_cnt;
extern int div_vsh[8],div_vsl[8],div_elh[8],div_ell[8];
extern u16 rom[1024];
extern int div_vsh_offset,div_elh_offset;