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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cache/] [icache_model.c] - Diff between revs 1350 and 1358

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

Rev 1350 Rev 1358
Line 213... Line 213...
  if ((addr = mfspr(SPR_ICBLR))) {
  if ((addr = mfspr(SPR_ICBLR))) {
    mtspr(SPR_ICBLR, 0);
    mtspr(SPR_ICBLR, 0);
  }
  }
}
}
 
 
 No newline at end of file
 No newline at end of file
 
/*-----------------------------------------------------[ IC configuration ]---*/
 
void ic_enabled(union param_val val, void *dat)
 
{
 
  config.ic.enabled = val.int_val;
 
  setsprbits (SPR_UPR, SPR_UPR_ICP, val.int_val ? 1 : 0);
 
}
 
 
 
void ic_nsets(union param_val val, void *dat)
 
{
 
  if (is_power2(val.int_val) && val.int_val <= MAX_IC_SETS)
 
    config.ic.nsets = val.int_val;
 
  else {
 
    char tmp[200];
 
    sprintf (tmp, "value of power of two and lower or equal than %i expected.", MAX_IC_SETS);
 
    CONFIG_ERROR(tmp);
 
  }
 
}
 
 
 
void ic_nways(union param_val val, void *dat)
 
{
 
  if (val.int_val >= 1 && val.int_val <= MAX_IC_WAYS)
 
    config.ic.nways = val.int_val;
 
  else
 
    CONFIG_ERROR("value 1, 2, 3 or 4 expected.");
 
}
 
 
 
void ic_blocksize(union param_val val, void *dat)
 
{
 
  if (is_power2(val.int_val))
 
    config.ic.blocksize = val.int_val;
 
  else
 
    CONFIG_ERROR("value of power of two expected.");
 
}
 
 
 
void ic_ustates(union param_val val, void *dat)
 
{
 
  if (val.int_val >= 2 && val.int_val <= 4)
 
    config.ic.ustates = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid USTATE.");
 
}
 
 
 
void ic_missdelay(union param_val val, void *dat)
 
{
 
  config.ic.missdelay = val.int_val;
 
}
 
 
 
void ic_hitdelay(union param_val val, void *dat)
 
{
 
  config.ic.hitdelay = val.int_val;
 
}
 
 
 
void reg_ic_sec(void)
 
{
 
  struct config_sections *sec = reg_config_sec("ic", NULL, NULL);
 
 
 
  reg_config_param(sec, "enabled", paramt_int, ic_enabled);
 
  reg_config_param(sec, "nsets", paramt_int, ic_nsets);
 
  reg_config_param(sec, "nways", paramt_int, ic_nways);
 
  reg_config_param(sec, "blocksize", paramt_int, ic_blocksize);
 
  reg_config_param(sec, "ustates", paramt_int, ic_ustates);
 
  reg_config_param(sec, "missdelay", paramt_int, ic_missdelay);
 
  reg_config_param(sec, "hitdelay", paramt_int, ic_hitdelay);
 
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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