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

Subversion Repositories or2k

[/] [or2k/] [trunk/] [analysis-bin/] [insnanalysis/] [insnanalysis.c] - Diff between revs 21 and 22

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 21 Rev 22
Line 66... Line 66...
    }
    }
 
 
  filesize_bytes = ftell(fp);
  filesize_bytes = ftell(fp);
  filesize_insns = filesize_bytes / INSN_SIZE_BYTES;
  filesize_insns = filesize_bytes / INSN_SIZE_BYTES;
 
 
 
#ifdef DISPLAY_STRING  
 
  printf("\nAnalysing file:\t%s\tSize: %d MB\n",
 
         argv[1],((filesize_bytes/1024)/1024));
 
#endif
 
 
  // Reset pointer
  // Reset pointer
  rewind(fp);
  rewind(fp);
 
 
 
 
 
 
  instruction * insn = (instruction *)insn_buff;
  instruction * insn = (instruction *)insn_buff;
 
 
  instruction_properties insn_props;
  instruction_properties insn_props;
 
 
  // Go through the file, collect stats about instructions
  // Go through the file, collect stats about instructions
 
 
  // What is one-percent of instructions
  // What is one-percent of instructions
  float file_one_percent = ((float)filesize_insns / 100.0f );
  float file_one_percent = ((float)filesize_insns / 100.0f );
  float percent_of_percent=0; int percent;
  float percent_of_percent=0; int percent=0;
 
 
  insn_lists_init();
  insn_lists_init();
 
 
  while(!feof(fp)) {
  while(!feof(fp)) {
 
 
Line 127... Line 130...
 
 
  }
  }
 
 
  fclose(fp);
  fclose(fp);
 
 
 
  fprintf(stderr, "\rDone\n", percent);
 
#ifdef DISPLAY_STRING
  printf("\rSaw %d instructions\n", insns_seen_total);
  printf("\rSaw %d instructions\n", insns_seen_total);
 
#endif
  generate_stats(stdout);
  generate_stats(stdout);
 
 
  insn_lists_free();
  insn_lists_free();
 
 
  return 0;
  return 0;

powered by: WebSVN 2.1.0

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