示例#1
0
void simulator_main(int argc, char** argv) 
{
  init_knobs(argc, argv);

  // trace driven simulation 
  read_trace_file();
  init_structures();
  run_a_cycle();

}
void simulator_main(int argc, char** argv) 
{
  init_knobs(argc, argv);

  // trace driven simulation 
  read_trace_file();
   /** NEW-LAB2 */ /* just note: passing main memory pointers is hack to mix up c++ objects and c-style code */  /* Not recommended at all */ 
  memory_c *main_memory = new memory_c();  // /** NEW-LAB2 */ 


  init_structures(main_memory);  // please modify run_a_cycle function argument  /** NEW-LAB2 */ 
  run_a_cycle(main_memory); // please modify run_a_cycle function argument  /** NEW-LAB2 */ 

}
void simulator_main(int argc, char** argv) 
{
  init_knobs(argc, argv);

  // trace driven simulation 
  read_trace_file();

  /** NEW-LAB2 */ /* just note: passing main memory pointers is hack to mix up c++ objects and c-style code */  /* Not recommended at all */ 
  memory_c *main_memory = new memory_c();  // /** NEW-LAB2 */ 


  init_structures(main_memory);  // please modify run_a_cycle function argument  /** NEW-LAB2 */ 
  
  /*LAB 3*/
  if(KNOB(KNOB_USE_BPRED)->getValue())
  {
	  use_bpred=true;
	  bpred_type type=(bpred_type) KNOB(KNOB_BPRED_TYPE)->getValue();
	  unsigned int bhr_len;
	  if(type == BPRED_TAKEN || type == BPRED_NOTTAKEN || type == BPRED_BIMODAL)
		  bhr_len=0;
	  else if(type == BPRED_GSHARE)
		  bhr_len=KNOB(KNOB_BPRED_HIST_LEN)->getValue();
	  branchpred=bpred_new(type,bhr_len);
  }
  /*LAB 3*/
  if(KNOB(KNOB_ENABLE_VMEM)->getValue())
  {
	  vmem_enabled=true;
	  dtlb = tlb_new(KNOB(KNOB_TLB_ENTRIES)->getValue());
	  vmem_page_size=KNOB(KNOB_VMEM_PAGE_SIZE)->getValue();
  }
  run_a_cycle(main_memory); // please modify run_a_cycle function argument  /** NEW-LAB2 */ 


}