OpenCores
URL https://opencores.org/ocsvn/csa/csa/trunk

Subversion Repositories csa

[/] [csa/] [trunk/] [sw_sim/] [misc.h] - Blame information for rev 52

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 52 simon111
#define READ_DATA(a,n)            \
2
  do{                             \
3
    memset(a    ,0,sizeof     a); \
4
    fread(a,1,n,stdin);           \
5
  }while(0)
6 17 simon111
 
7 52 simon111
#define WRITE_DATA(a,n)           \
8
    fwrite(a,1,n,stdout)
9 17 simon111
 
10 52 simon111
#define DEBUG_OUTPUT(fmt,args... )     \
11
    fprintf(stderr,"%d:" fmt "\n",__LINE__,##args)
12 20 simon111
 
13 52 simon111
#define DEBUG_OUTPUT_ARR( a , n )           \
14
  do                                        \
15
  {                                         \
16
    int i;                                  \
17
    fprintf(stderr,"%d:%s:\n",__LINE__,#a); \
18
    for(i=n-1;i>=0;i--)                     \
19
    {                                       \
20
      fprintf(stderr,"%02x ",(a)[i]);       \
21
    }                                       \
22
    fprintf(stderr,"\n");                   \
23
  }while(0)
24 20 simon111
 
25 52 simon111
#define DEBUG_OUTPUT_VAL( a )               \
26
  DEBUG_OUTPUT(#a"=%02x",a )
27
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.