fprintf(stderr,"wrnc-smem -D 0x<hex-number> -a 0x<number> [options] [value]\n\n");
fprintf(stderr,"mockturtle-smem -D 0x<hex-number> -a 0x<number> [options] [value]\n\n");
fprintf(stderr,"This program reads/write to/from the white-rabbit node-core shared memory. If you privide data, it will write these data into the shared memory. Then, it dumps the content after the write operation (if any). If you do not provide any data, it will simply read the current content of the shared memory\n\n");
fprintf(stderr,"-D WRNC device identificator in hexadecimal format\n");
fprintf(stderr,"-D device identificator in hexadecimal format\n");
fprintf(stderr,"-a address where start operation\n");
fprintf(stderr,"-n number of word (32bit) to read/write. The default is 1\n");
fprintf(stderr,"-m write operation mode. The default is 0\n");
...
...
@@ -57,10 +57,10 @@ int main(int argc, char *argv[])
unsignedinti,n=1,mod=0;
uint32_taddr,*val,dev_id;
interr,do_write;
structwrnc_dev*wrnc;
structtrtl_dev*trtl;
charc;
atexit(wrnc_exit);
atexit(trtl_exit);
while((c=getopt(argc,argv,"hD:a:n:m:v"))!=-1){
switch(c){
...
...
@@ -77,8 +77,8 @@ int main(int argc, char *argv[])
sscanf(optarg,"%d",&n);
break;
case'm':
sscanf(optarg,"%d",&mod);
if(mod>WRNC_SMEM_ADD){
sscanf(optarg,"%d",&mod);
if(mod>TRTL_SMEM_ADD){
fprintf(stderr,"Invalid operation mode\n");
help();
exit(1);
...
...
@@ -89,16 +89,16 @@ int main(int argc, char *argv[])