URL
https://opencores.org/ocsvn/csa/csa/trunk
Subversion Repositories csa
Compare Revisions
- This comparison shows the changes necessary to convert path
/csa
- from Rev 51 to Rev 52
- ↔ Reverse comparison
Rev 51 → Rev 52
/trunk/sw_sim/misc.h
1,45 → 1,27
#define READ_DATA(a,n) \ |
do{ \ |
memset(a ,0,sizeof a); \ |
fread(a,1,n,stdin); \ |
}while(0) |
|
#if 0 |
#define READ_DATA(a,n) \ |
do{ \ |
int i; \ |
int c; \ |
memset(a ,0,sizeof a); \ |
for (i=n-1 ;i>=0;i--) \ |
{ \ |
c=getchar(); \ |
if(c=='1') \ |
{ \ |
a [i/8]|=(1<<(i%8));\ |
} \ |
} \ |
}while(0) |
#else |
#define READ_DATA(a,n) \ |
do{ \ |
memset(a ,0,sizeof a); \ |
fread(a,1,n,stdin); \ |
}while(0) |
#endif |
#define WRITE_DATA(a,n) \ |
fwrite(a,1,n,stdout) |
|
#define WRITE_DATA(a,n) \ |
do { \ |
fwrite(a,1,n,stdout); \ |
}while(0) |
#define DEBUG_OUTPUT(fmt,args... ) \ |
fprintf(stderr,"%d:" fmt "\n",__LINE__,##args) |
|
#define DEBUG_OUTPUT_ARR( a , n ) \ |
do{ \ |
int i; \ |
fprintf(stderr,"%s:\n",#a); \ |
for(i=n-1;i>=0;i--) \ |
{ \ |
fprintf(stderr,"%02x ",(a)[i]);\ |
} \ |
fprintf(stderr,"\n"); \ |
}while(0) |
#define DEBUG_OUTPUT_ARR( a , n ) \ |
do \ |
{ \ |
int i; \ |
fprintf(stderr,"%d:%s:\n",__LINE__,#a); \ |
for(i=n-1;i>=0;i--) \ |
{ \ |
fprintf(stderr,"%02x ",(a)[i]); \ |
} \ |
fprintf(stderr,"\n"); \ |
}while(0) |
|
#define DEBUG_OUTPUT_VAL( a ) \ |
do{ \ |
fprintf(stderr," %s=%x ",#a,a); \ |
fprintf(stderr,"\n"); \ |
}while(0) |
#define DEBUG_OUTPUT_VAL( a ) \ |
DEBUG_OUTPUT(#a"=%02x",a ) |
|