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

Subversion Repositories or1k

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

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

Rev 1358 Rev 1382
Line 222... Line 222...
  setsprbits (SPR_UPR, SPR_UPR_ICP, val.int_val ? 1 : 0);
  setsprbits (SPR_UPR, SPR_UPR_ICP, val.int_val ? 1 : 0);
}
}
 
 
void ic_nsets(union param_val val, void *dat)
void ic_nsets(union param_val val, void *dat)
{
{
  if (is_power2(val.int_val) && val.int_val <= MAX_IC_SETS)
  if (is_power2(val.int_val) && val.int_val <= MAX_IC_SETS){
    config.ic.nsets = val.int_val;
    config.ic.nsets = val.int_val;
 
    setsprbits (SPR_ICCFGR, SPR_ICCFGR_NCS,log2(val.int_val));
 
  }
  else {
  else {
    char tmp[200];
    char tmp[200];
    sprintf (tmp, "value of power of two and lower or equal than %i expected.", MAX_IC_SETS);
    sprintf (tmp, "value of power of two and lower or equal than %i expected.", MAX_IC_SETS);
    CONFIG_ERROR(tmp);
    CONFIG_ERROR(tmp);
  }
  }
}
}
 
 
void ic_nways(union param_val val, void *dat)
void ic_nways(union param_val val, void *dat)
{
{
  if (val.int_val >= 1 && val.int_val <= MAX_IC_WAYS)
  if (is_power2(val.int_val) && val.int_val <= MAX_IC_WAYS) {
    config.ic.nways = val.int_val;
    config.ic.nways = val.int_val;
  else
    setsprbits (SPR_ICCFGR, SPR_ICCFGR_NCW, log2(val.int_val));
    CONFIG_ERROR("value 1, 2, 3 or 4 expected.");
  }
 
  else {
 
    char tmp[200];
 
    sprintf (tmp, "value of power of two and lower or equal than %i expected.",
 
    MAX_IC_WAYS);
 
    CONFIG_ERROR(tmp);
 
  }
}
}
 
 
void ic_blocksize(union param_val val, void *dat)
void ic_blocksize(union param_val val, void *dat)
{
{
  if (is_power2(val.int_val))
  if (is_power2(val.int_val)){
    config.ic.blocksize = val.int_val;
    config.ic.blocksize = val.int_val;
  else
    setsprbits (SPR_ICCFGR, SPR_ICCFGR_CBS,log2(val.int_val));
 
  } else
    CONFIG_ERROR("value of power of two expected.");
    CONFIG_ERROR("value of power of two expected.");
}
}
 
 
void ic_ustates(union param_val val, void *dat)
void ic_ustates(union param_val val, void *dat)
{
{

powered by: WebSVN 2.1.0

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