Beispiel #1
0
void init_structures(void)
{
  init_op_pool(); 
  init_op_latency();
  init_reg_file();
  /* please initialize other data stucturs */ 
  /* you must complete the function */
  init_latches();
}
void init_structures(memory_c *main_memory) // please modify init_structures function argument  /** NEW-LAB2 */ 
{
  init_op_pool(); 
  init_op_latency();
  init_latches();
  init_registers(); // initializing processor registers to TRUE since no data dependency when processor is powered on
  main_memory->init_mem(); // initializing DRAM and MSHR
  cache_init(data_cache, KNOB(KNOB_DCACHE_SIZE)->getValue(), KNOB(KNOB_BLOCK_SIZE)->getValue(), KNOB(KNOB_DCACHE_WAY)->getValue(), "L1 Cache"); // initializing cache
}
void init_structures(memory_c *main_memory) // please modify init_structures function argument  /** NEW-LAB2 */ 
{
  init_op_pool(); 
  init_op_latency();
  /* please initialize other data stucturs */ 
  /* you must complete the function */
  init_latches();
	init_register_file();	//fn added by apkarande
	main_memory->init_mem();	//initialize main memory
	cache_init(data_cache,KNOB(KNOB_DCACHE_SIZE)->getValue(),KNOB(KNOB_BLOCK_SIZE)->getValue(),KNOB(KNOB_DCACHE_WAY)->getValue(),"L1 dcache");	//initialize data cache
}
Beispiel #4
0
void init_structures(memory_c *main_memory) // please modify init_structures function argument  /** NEW-LAB2 */ 
{
  init_op_pool(); 
  init_op_latency();
  init_reg_file();
  /* please initialize other data stucturs */ 
  /* you must complete the function */
  init_latches();
  cache_size = KNOB(KNOB_DCACHE_SIZE)->getValue();
  block_size = KNOB(KNOB_BLOCK_SIZE)->getValue();
  assoc = KNOB(KNOB_DCACHE_WAY)->getValue();
  dcache_latency = KNOB(KNOB_DCACHE_LATENCY)->getValue();
  mshr_size = KNOB(KNOB_MSHR_SIZE)->getValue();
  use_bpred = KNOB(KNOB_USE_BPRED)->getValue();
  type_bpred = (bpred_type) KNOB(KNOB_BPRED_TYPE)->getValue();
  hist_len = KNOB(KNOB_BPRED_HIST_LEN)->getValue();
  vmem_enabled = KNOB(KNOB_ENABLE_VMEM)->getValue();
  tlb_size = KNOB(KNOB_TLB_ENTRIES)->getValue();
  vmem_page_size = KNOB(KNOB_VMEM_PAGE_SIZE)->getValue();
  thread_count = KNOB(KNOB_RUN_THREAD_NUM)->getValue();

  for(int i = 0 ; i < HW_MAX_THREAD ; i++)
	  end_of_stream[i] = false;

  data_cache = (Cache *) malloc(sizeof(Cache));
  cache_init(data_cache,cache_size,block_size,assoc,"dcache");
  main_memory->init_mem();

  if(use_bpred)
	  branchpred = bpred_new(type_bpred,hist_len);
  else
	  branchpred = NULL;

  if(vmem_enabled)
	  dtlb = tlb_new(tlb_size);
  else
	  dtlb = NULL;
}