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

Subversion Repositories or1k

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

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

Rev 1350 Rev 1358
Line 263... Line 263...
    }
    }
  }
  }
  if (start_set < end_set) PRINTF("\n");
  if (start_set < end_set) PRINTF("\n");
}
}
 
 
 No newline at end of file
 No newline at end of file
 
/*---------------------------------------------------[ DMMU configuration ]---*/
 
void dmmu_enabled(union param_val val, void *dat)
 
{
 
  setsprbits (SPR_UPR, SPR_UPR_DMP, val.int_val ? 1 : 0);
 
  config.dmmu.enabled = val.int_val;
 
}
 
 
 
void dmmu_nsets(union param_val val, void *dat)
 
{
 
  if (is_power2(val.int_val) && val.int_val <= 256)
 
    config.dmmu.nsets = val.int_val;
 
  else
 
    CONFIG_ERROR("value of power of two and lower or equal than 256 expected.");
 
}
 
 
 
void dmmu_nways(union param_val val, void *dat)
 
{
 
  if (val.int_val >= 1 && val.int_val <= 4)
 
    config.dmmu.nways = val.int_val;
 
  else
 
    CONFIG_ERROR("value 1, 2, 3 or 4 expected.");
 
}
 
 
 
void dmmu_pagesize(union param_val val, void *dat)
 
{
 
  if (is_power2(val.int_val))
 
    config.dmmu.pagesize = val.int_val;
 
  else
 
    CONFIG_ERROR("value of power of two expected.");
 
}
 
 
 
void dmmu_entrysize(union param_val val, void *dat)
 
{
 
  if (is_power2(val.int_val))
 
    config.dmmu.entrysize = val.int_val;
 
  else
 
    CONFIG_ERROR("value of power of two expected.");
 
}
 
 
 
void dmmu_ustates(union param_val val, void *dat)
 
{
 
  if (val.int_val >= 2 && val.int_val <= 4)
 
    config.dmmu.ustates = val.int_val;
 
  else
 
    CONFIG_ERROR("invalid USTATE.");
 
}
 
 
 
void dmmu_missdelay(union param_val val, void *dat)
 
{
 
  config.dmmu.missdelay = val.int_val;
 
}
 
 
 
void dmmu_hitdelay(union param_val val, void *dat)
 
{
 
  config.immu.hitdelay = val.int_val;
 
}
 
 
 
void reg_dmmu_sec(void)
 
{
 
  struct config_section *sec = reg_config_sec("dmmu", NULL, NULL);
 
 
 
  reg_config_param(sec, "enabled", paramt_int, dmmu_enabled);
 
  reg_config_param(sec, "nsets", paramt_int, dmmu_nsets);
 
  reg_config_param(sec, "nways", paramt_int, dmmu_nways);
 
  reg_config_param(sec, "pagesize", paramt_int, dmmu_pagesize);
 
  reg_config_param(sec, "entrysize", paramt_int, dmmu_entrysize);
 
  reg_config_param(sec, "ustates", paramt_int, dmmu_ustates);
 
  reg_config_param(sec, "missdelay", paramt_int, dmmu_missdelay);
 
  reg_config_param(sec, "hitdelay", paramt_int, dmmu_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.