Esempio n. 1
0
/* register simulator-specific options */
void
sim_reg_options(struct opt_odb_t *odb)
{
  opt_reg_header(odb, 
"sim-eio: This simulator implements simulator support for generating\n"
"external event traces (EIO traces) and checkpoint files.  External\n"
"event traces capture one execution of a program, and allow it to be\n"
"packaged into a single file for later re-execution.  EIO trace executions\n"
"are 100% reproducible between subsequent executions (on the same platform.\n"
"This simulator also provides functionality to generate checkpoints at\n"
"arbitrary points within an external event trace (EIO) execution.  The\n"
"checkpoint file (along with the EIO trace) can be used to start any\n"
"SimpleScalar simulator in the middle of a program execution.\n"
		 );

  /* instruction limit */
  opt_reg_uint(odb, "-max:inst", "maximum number of inst's to execute",
	       &max_insts, /* default */0,
	       /* print */TRUE, /* format */NULL);

  opt_reg_int(odb, "-fastfwd", "number of insts skipped before tracing starts",
	      &fastfwd_count, /* default */0,
	      /* print */TRUE, /* format */NULL);

  opt_reg_string(odb, "-trace", "EIO trace file output file name",
		 &trace_fname, /* default */NULL,
		 /* print */TRUE, NULL);

  opt_reg_string_list(odb, "-perdump",
		      "periodic checkpoint every n instructions: "
		      "<base fname> <interval>",
		      per_chkpt_opts, /* sz */2, &per_chkpt_nelt,
		      /* default */NULL,
		      /* !print */FALSE, /* format */NULL, /* !accrue */FALSE);

  opt_reg_string_list(odb, "-dump",
		      "specify checkpoint file and trigger: <fname> <range>",
		      chkpt_opts, /* sz */2, &chkpt_nelt, /* default */NULL,
		      /* !print */FALSE, /* format */NULL, /* !accrue */FALSE);

  opt_reg_note(odb,
"  Checkpoint range triggers are formatted as follows:\n"
"\n"
"    {{@|#}<start>}:{{@|#|+}<end>}\n"
"\n"
"  Both ends of the range are optional, if neither are specified, the range\n"
"  triggers immediately.  Ranges that start with a `@' designate an address\n"
"  range to trigger on, those that start with an `#' designate a cycle count\n"
"  trigger.  All other ranges represent an instruction count range.  The\n"
"  second argument, if specified with a `+', indicates a value relative\n"
"  to the first argument, e.g., 1000:+100 == 1000:1100.\n"
"\n"
"    Examples:   -ptrace FOO.trc #0:#1000\n"
"                -ptrace BAR.trc @2000:\n"
"                -ptrace BLAH.trc :1500\n"
"                -ptrace UXXE.trc :\n"
	       );
}
Esempio n. 2
0
/* register simulator-specific options */
void
sim_reg_options(struct opt_odb_t *odb)
{
  opt_reg_header(odb, 
"sim-profile: This simulator implements a functional simulator with\n"
"profiling support.  Run with the `-h' flag to see profiling options\n"
"available.\n"
		 );

  /* instruction limit */
  opt_reg_uint(odb, "-max:inst", "maximum number of inst's to execute",
	       &max_insts, /* default */0,
	       /* print */TRUE, /* format */NULL);

  opt_reg_flag(odb, "-all", "enable all profile options",
	       &prof_all, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-iclass", "enable instruction class profiling",
	       &prof_ic, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-iprof", "enable instruction profiling",
	       &prof_inst, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-brprof", "enable branch instruction profiling",
	       &prof_bc, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-amprof", "enable address mode profiling",
	       &prof_am, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-segprof", "enable load/store address segment profiling",
	       &prof_seg, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-tsymprof", "enable text symbol profiling",
	       &prof_tsyms, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-taddrprof", "enable text address profiling",
	       &prof_taddr, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-dsymprof", "enable data symbol profiling",
	       &prof_dsyms, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_flag(odb, "-internal",
	       "include compiler-internal symbols during symbol profiling",
	       &load_locals, /* default */FALSE, /* print */TRUE, NULL);

  opt_reg_string_list(odb, "-pcstat",
		      "profile stat(s) against text addr's (mult uses ok)",
		      pcstat_vars, MAX_PCSTAT_VARS, &pcstat_nelt, NULL,
		      /* !print */FALSE, /* format */NULL, /* accrue */TRUE);
}
Esempio n. 3
0
void fetch_reg_options(struct opt_odb_t * odb, struct core_knobs_t * knobs)
{
  /* branch prediction */
  opt_reg_string_list(odb, "-bpred", "bpred configuration string(s) [DS]",
      knobs->fetch.bpred_opt_str, MAX_HYBRID_BPRED, &knobs->fetch.num_bpred_components, knobs->fetch.bpred_opt_str, /* print */true, /* format */NULL, /* !accrue */false);

  opt_reg_string(odb, "-bpred:fusion","fusion/meta-prediction algorithm configurations string [DS]",
      &knobs->fetch.fusion_opt_str, /*default*/ "none", /*print*/true,/*format*/NULL);

  opt_reg_string(odb, "-bpred:btb","branch target buffer configuration configuration string [DS]",
      &knobs->fetch.dirjmpbtb_opt_str, /*default*/ "btac:BTB:512:4:8:l", /*print*/true,/*format*/NULL);

  opt_reg_string(odb, "-bpred:ibtb","indirect branch target buffer configuration string [DS]",
      &knobs->fetch.indirjmpbtb_opt_str, /*default*/ "2levbtac:iBTB:1:8:1:128:4:8:l", /*print*/true,/*format*/NULL);

  opt_reg_string(odb, "-bpred:ras","return address stack predictor configuration string [DS]",
      &knobs->fetch.ras_opt_str, /*default*/ "stack:RAS:16", /*print*/true,/*format*/NULL);

  opt_reg_int(odb, "-jeclear:delay","additional latency from branch-exec to jeclear [D]",
      &knobs->fetch.jeclear_delay, /*default*/ 1, /*print*/true,/*format*/NULL);

  opt_reg_int(odb, "-byteQ:size","number of entries in byteQ [DS]",
      &knobs->fetch.byteQ_size, /*default*/ knobs->fetch.byteQ_size, /*print*/true,/*format*/NULL);
  opt_reg_int(odb, "-byteQ:linesize","linesize of byteQ (bytes) [DS]",
      &knobs->fetch.byteQ_linesize, /*default*/ knobs->fetch.byteQ_linesize, /*print*/true,/*format*/NULL);

  opt_reg_int(odb, "-predecode:depth","number of stages in predecode pipe [D]",
      &knobs->fetch.depth, /*default*/ knobs->fetch.depth, /*print*/true,/*format*/NULL);
  opt_reg_int(odb, "-predecode:width","width of predecode pipe (Macro-ops) [D]",
      &knobs->fetch.width, /*default*/ knobs->fetch.width, /*print*/true,/*format*/NULL);

  opt_reg_int(odb, "-IQ:size","size of instruction queue (Macro-ops - placed between predecode and decode) [D]",
      &knobs->fetch.IQ_size, /*default*/ knobs->fetch.IQ_size, /*print*/true,/*format*/NULL);

  opt_reg_flag(odb, "-warm:bpred","warm branch predictors during functional fast-forwarding [DS]",
      &knobs->fetch.warm_bpred, /*default*/ false, /*print*/true,/*format*/NULL);
}
Esempio n. 4
0
/* Registe simulator-specific options */
void
sim_reg_options(struct opt_odb_t *odb)	/* options database */
{
  opt_reg_header(odb,
"sim-cache: This simulator implements a functional cache simulator.  Cache\n"
"statistics are generated for a user-selected cache and TLB configuration,\n"
"which may include up to two levels of instruction and data cache (with any\n"
"levels unified), and one level of instruction and data TLBs.  No timing\n"
"information is generated.\n"
		 );

  /* instruction limit */
  opt_reg_uint(odb, "-max:inst", "maximum number of inst's to execute",
	       &max_insts, /* default */0,
	       /* print */TRUE, /* format */NULL);

  opt_reg_string(odb, "-cache:dl1",
		 "l1 data cache config, i.e., {<config>|none}",
		 &cache_dl1_opt, "dl1:256:32:1:l:0", /* print */TRUE, NULL);
  opt_reg_note(odb,
"  The cache config parameter <config> has the following format:\n"
"\n"
"    <name>:<nsets>:<bsize>:<assoc>:<repl>:<pref>\n"
"\n"
"    <name>   - name of the cache being defined\n"
"    <nsets>  - number of sets in the cache\n"
"    <bsize>  - block size of the cache\n"
"    <assoc>  - associativity of the cache\n"
"    <repl>   - block replacement strategy, 'l'-LRU, 'f'-FIFO, 'r'-random, 'n'-NRU\n"
"    <pref>   - prefetcher type, 0 - no prefetcher, 1 - next line prefetcher,\n"
"	       2 - open-ended prefetcher, \n"
"	       any other number num - stride prefetcher with num entries in the Reference Prediction Table (RPT)\n"
"\n"
"    Examples:   -cache:dl1 dl1:4096:32:1:l:1\n"
"                -dtlb dtlb:128:4096:32:r:0\n"
	       );
  opt_reg_string(odb, "-cache:dl2",
		 "l2 data cache config, i.e., {<config>|none}",
		 &cache_dl2_opt, "ul2:1024:64:4:l:0", /* print */TRUE, NULL);
  opt_reg_string(odb, "-cache:il1",
		 "l1 inst cache config, i.e., {<config>|dl1|dl2|none}",
		 &cache_il1_opt, "il1:256:32:1:l:0", /* print */TRUE, NULL);
  opt_reg_note(odb,
"  Cache levels can be unified by pointing a level of the instruction cache\n"
"  hierarchy at the data cache hiearchy using the \"dl1\" and \"dl2\" cache\n"
"  configuration arguments.  Most sensible combinations are supported, e.g.,\n"
"\n"
"    A unified l2 cache (il2 is pointed at dl2):\n"
"      -cache:il1 il1:128:64:1:l:0 -cache:il2 dl2\n"
"      -cache:dl1 dl1:256:32:1:l:0 -cache:dl2 ul2:1024:64:2:l:0\n"
"\n"
"    Or, a fully unified cache hierarchy (il1 pointed at dl1):\n"
"      -cache:il1 dl1\n"
"      -cache:dl1 ul1:256:32:1:l:0 -cache:dl2 ul2:1024:64:2:l:0\n"
	       );
  opt_reg_string(odb, "-cache:il2",
		 "l2 instruction cache config, i.e., {<config>|dl2|none}",
		 &cache_il2_opt, "dl2", /* print */TRUE, NULL);
  opt_reg_string(odb, "-tlb:itlb",
		 "instruction TLB config, i.e., {<config>|none}",
		 &itlb_opt, "itlb:16:4096:4:l:0", /* print */TRUE, NULL);
  opt_reg_string(odb, "-tlb:dtlb",
		 "data TLB config, i.e., {<config>|none}",
		 &dtlb_opt, "dtlb:32:4096:4:l:0", /* print */TRUE, NULL);
  opt_reg_flag(odb, "-flush", "flush caches on system calls",
	       &flush_on_syscalls, /* default */FALSE, /* print */TRUE, NULL);
  opt_reg_flag(odb, "-cache:icompress",
	       "convert 64-bit inst addresses to 32-bit inst equivalents",
	       &compress_icache_addrs, /* default */FALSE,
	       /* print */TRUE, NULL);

  opt_reg_string_list(odb, "-pcstat",
		      "profile stat(s) against text addr's (mult uses ok)",
		      pcstat_vars, MAX_PCSTAT_VARS, &pcstat_nelt, NULL,
		      /* !print */FALSE, /* format */NULL, /* accrue */TRUE);

}
Esempio n. 5
0
void
main(int argc, char **argv)
{
  struct opt_odb_t *odb;

  int n_int_vars, n_uint_vars, n_float_vars, n_double_vars;
  int n_enum_vars, n_enum_eval_vars, n_flag_vars, n_string_vars;
  int int_var, int_vars[MAX_VARS];
  unsigned int uint_var, uint_vars[MAX_VARS];
  float float_var, float_vars[MAX_VARS];
  double double_var, double_vars[MAX_VARS];
  int flag_var, flag_vars[MAX_VARS];
  char *string_var, *string_vars[MAX_VARS];

  enum etest_t { enum_a, enum_b, enum_c, enum_d, enum_NUM };
  static char *enum_emap[enum_NUM] =
    { "enum_a", "enum_b", "enum_c", "enum_d" };
  static int enum_eval[enum_NUM] =
    { enum_d, enum_c, enum_b, enum_a };
  int enum_var, enum_vars[MAX_VARS];
  int enum_eval_var, enum_eval_vars[MAX_VARS];

  /* get an options processor */
  odb = opt_new(f_orphan_fn);


  opt_reg_int(odb, "-opt:int", "This is an integer option.",
	      &int_var, 1, /* print */TRUE, /* default format */NULL);
  opt_reg_int_list(odb, "-opt:int:list", "This is an integer list option.",
		   int_vars, MAX_VARS, &n_int_vars, 2,
		   /* print */TRUE, /* default format */NULL);
  opt_reg_uint(odb, "-opt:uint", "This is an unsigned integer option.",
	       &uint_var, 3, /* print */TRUE, /* default format */NULL);
  opt_reg_uint_list(odb, "-opt:uint:list",
		    "This is an unsigned integer list option.",
		    uint_vars, MAX_VARS, &n_uint_vars, 4,
		    /* print */TRUE, /* default format */NULL);
  opt_reg_float(odb, "-opt:float", "This is a float option.",
		&float_var, 5.0, /* print */TRUE, /* default format */NULL);
  opt_reg_float_list(odb, "-opt:float:list", "This is a float list option.",
		     float_vars, MAX_VARS, &n_float_vars, 6.0,
		     /* print */TRUE, /* default format */NULL);
  opt_reg_double(odb, "-opt:double", "This is a double option.",
		 &double_var, 7.0, /* print */TRUE, /* default format */NULL);
  opt_reg_double_list(odb, "-opt:double:list", "This is a double list option.",
		      double_vars, MAX_VARS, &n_double_vars, 8.0,
		      /* print */TRUE, /* default format */NULL);
  opt_reg_enum(odb, "-opt:enum", "This is an enumeration option.",
	       &enum_var, "enum_a", enum_emap, /* index map */NULL, enum_NUM,
	       /* print */TRUE, /* default format */NULL);
  opt_reg_enum_list(odb, "-opt:enum:list", "This is a enum list option.",
		    enum_vars, MAX_VARS, &n_enum_vars, "enum_b",
		    enum_emap, /* index map */NULL, enum_NUM,
		    /* print */TRUE, /* default format */NULL);
  opt_reg_enum(odb, "-opt:enum:eval", "This is an enumeration option w/eval.",
	       &enum_eval_var, "enum_b", enum_emap, enum_eval, enum_NUM,
	       /* print */TRUE, /* default format */NULL);
  opt_reg_enum_list(odb, "-opt:enum:eval:list",
		    "This is a enum list option w/eval.",
		    enum_eval_vars, MAX_VARS, &n_enum_eval_vars, "enum_a",
		    enum_emap, enum_eval, enum_NUM,
		    /* print */TRUE, /* default format */NULL);
  opt_reg_flag(odb, "-opt:flag", "This is a boolean flag option.",
	       &flag_var, FALSE, /* print */TRUE, /* default format */NULL);
  opt_reg_flag_list(odb, "-opt:flag:list",
		    "This is a boolean flag list option.",
		    flag_vars, MAX_VARS, &n_flag_vars, TRUE,
		    /* print */TRUE, /* default format */NULL);
  opt_reg_string(odb, "-opt:string", "This is a string option.",
		 &string_var, "a:string",
		 /* print */TRUE, /* default format */NULL);
  opt_reg_string_list(odb, "-opt:string:list", "This is a string list option.",
		    string_vars, MAX_VARS, &n_string_vars, "another:string",
		    /* print */TRUE, /* default format */NULL);

  /* parse options */
  opt_process_options(odb, argc, argv);

  /* print options */
  fprintf(stdout, "## Current Option Values ##\n");
  opt_print_options(odb, stdout, /* long */FALSE, /* notes */TRUE);

  /* all done */
  opt_delete(odb);
  exit(0);
}