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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_61/] [or1ksim/] [mmu/] [immu.c] - Diff between revs 1358 and 1382

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

Rev 1358 Rev 1382
Line 249... Line 249...
  config.immu.enabled = val.int_val;
  config.immu.enabled = val.int_val;
}
}
 
 
void immu_nsets(union param_val val, void *dat)
void immu_nsets(union param_val val, void *dat)
{
{
  if (is_power2(val.int_val) && val.int_val <= 256)
  if (is_power2(val.int_val) && val.int_val <= 256) {
    config.immu.nsets = val.int_val;
    config.immu.nsets = val.int_val;
 
    setsprbits (SPR_IMMUCFGR, SPR_IMMUCFGR_NTS, log2(val.int_val));
 
  }
  else
  else
    CONFIG_ERROR("value of power of two and lower or equal than 256 expected.");
    CONFIG_ERROR("value of power of two and lower or equal than 256 expected.");
}
}
 
 
void immu_nways(union param_val val, void *dat)
void immu_nways(union param_val val, void *dat)
{
{
  if (val.int_val >= 1 && val.int_val <= 4)
  if (val.int_val >= 1 && val.int_val <= 4) {
    config.immu.nways = val.int_val;
    config.immu.nways = val.int_val;
 
    setsprbits (SPR_DMMUCFGR, SPR_DMMUCFGR_NTW, val.int_val-1);
 
  }
  else
  else
    CONFIG_ERROR("value 1, 2, 3 or 4 expected.");
    CONFIG_ERROR("value 1, 2, 3 or 4 expected.");
}
}
 
 
void immu_pagesize(union param_val val, void *dat)
void immu_pagesize(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.