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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc2/] [or1ksim/] [cache/] [icache_model.c] - Diff between revs 1506 and 1555

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

Rev 1506 Rev 1555
Line 44... Line 44...
#include "execute.h"
#include "execute.h"
#include "stats.h"
#include "stats.h"
#include "sim-config.h"
#include "sim-config.h"
#include "sprs.h"
#include "sprs.h"
#include "sim-config.h"
#include "sim-config.h"
 
#include "misc.h"
 
 
extern struct dev_memarea *cur_area;
extern struct dev_memarea *cur_area;
struct ic_set {
struct ic_set {
  struct {
  struct {
    uint32_t line[MAX_IC_BLOCK_SIZE];
    uint32_t line[MAX_IC_BLOCK_SIZE];
Line 205... Line 206...
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;
    cpu_state.sprs[SPR_ICCFGR] &= ~SPR_ICCFGR_NCS;
    cpu_state.sprs[SPR_ICCFGR] &= ~SPR_ICCFGR_NCS;
    cpu_state.sprs[SPR_ICCFGR] |= log2(val.int_val) << 3;
    cpu_state.sprs[SPR_ICCFGR] |= log2_int(val.int_val) << 3;
  }
  }
  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);
Line 219... Line 220...
void ic_nways(union param_val val, void *dat)
void ic_nways(union param_val val, void *dat)
{
{
  if (is_power2(val.int_val) && 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;
    cpu_state.sprs[SPR_ICCFGR] &= ~SPR_ICCFGR_NCW;
    cpu_state.sprs[SPR_ICCFGR] &= ~SPR_ICCFGR_NCW;
    cpu_state.sprs[SPR_ICCFGR] |= log2(val.int_val);
    cpu_state.sprs[SPR_ICCFGR] |= log2_int(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.",
    sprintf (tmp, "value of power of two and lower or equal than %i expected.",
    MAX_IC_WAYS);
    MAX_IC_WAYS);
Line 234... Line 235...
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;
    cpu_state.sprs[SPR_ICCFGR] &= ~SPR_ICCFGR_CBS;
    cpu_state.sprs[SPR_ICCFGR] &= ~SPR_ICCFGR_CBS;
    cpu_state.sprs[SPR_ICCFGR] |= log2(val.int_val) << 7;
    cpu_state.sprs[SPR_ICCFGR] |= log2_int(val.int_val) << 7;
  } else
  } 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.