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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_61/] [or1ksim/] [sim-config.c] - Diff between revs 889 and 897

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

Rev 889 Rev 897
Line 30... Line 30...
#include "icache_model.h"
#include "icache_model.h"
#include "dcache_model.h"
#include "dcache_model.h"
 
 
#include "profiler.h"
#include "profiler.h"
#include "mprofiler.h"
#include "mprofiler.h"
 
#include "cuc.h"
 
 
#define WARNING(s) fprintf (stderr, "WARNING: config.%s: %s\n", sections[section].name, (s))
#define WARNING(s) fprintf (stderr, "WARNING: config.%s: %s\n", sections[section].name, (s))
#define ERROR(s) {fprintf (stderr, "ERROR: config.%s:%s\n", sections[section].name, s); if (runtime.sim.init) exit (1);}
#define ERROR(s) {fprintf (stderr, "ERROR: config.%s:%s\n", sections[section].name, s); if (runtime.sim.init) exit (1);}
#define MERROR(s) {fprintf (stderr, "ERROR: %s\n", s); if (runtime.sim.init) exit (1);}
#define MERROR(s) {fprintf (stderr, "ERROR: %s\n", s); if (runtime.sim.init) exit (1);}
 
 
Line 148... Line 149...
  /* GPIO */
  /* GPIO */
  config.ngpios = 0;
  config.ngpios = 0;
 
 
  /* PM */
  /* PM */
  config.pm.enabled = 0;
  config.pm.enabled = 0;
 
 
 
  /* CUC */
 
  strcpy (config.cuc.timings_fn, "virtex.tim");
 
  config.cuc.memory_order = MO_STRONG;
 
  config.cuc.calling_convention = 1;
 
  config.cuc.enable_bursts = 1;
 
  config.cuc.no_multicycle = 1;
#endif
#endif
 
 
  /* Configure runtime */
  /* Configure runtime */
  memset(&runtime, 0, sizeof(runtime));
  memset(&runtime, 0, sizeof(runtime));
 
 
Line 427... Line 435...
void dc_enabled ();
void dc_enabled ();
void dc_nsets ();
void dc_nsets ();
void dc_nways ();
void dc_nways ();
void dc_blocksize ();
void dc_blocksize ();
void dc_ustates ();
void dc_ustates ();
 
void cuc_memory_order ();
 
 
unsigned long tempL;
unsigned long tempL;
unsigned long tempUL;
unsigned long tempUL;
char tempS[STR_SIZE];
char tempS[STR_SIZE];
 
 
Line 458... Line 467...
  {"bpb",     0},
  {"bpb",     0},
  {"pm",      0},
  {"pm",      0},
  {"vga",     0},
  {"vga",     0},
  {"fb",      0},
  {"fb",      0},
  {"kbd",     0},   /* 20 */
  {"kbd",     0},   /* 20 */
  {"ata",     0}
  {"ata",     0},
 
  {"cuc",     0}
};
};
 
 
/* *INDENT-OFF* */
/* *INDENT-OFF* */
 
 
/* Parameter definitions */
/* Parameter definitions */
Line 645... Line 655...
{21, "dev_type1",         "=%i",         ata_dev_type1, (void *)(&tempL ), 0},
{21, "dev_type1",         "=%i",         ata_dev_type1, (void *)(&tempL ), 0},
{21, "dev_file1",         "=\"%s\"",     ata_dev_file1, (void *)(&tempS ), 0},
{21, "dev_file1",         "=\"%s\"",     ata_dev_file1, (void *)(&tempS ), 0},
{21, "dev_size1",         "=%i",         ata_dev_size1, (void *)(&tempUL), 0},
{21, "dev_size1",         "=%i",         ata_dev_size1, (void *)(&tempUL), 0},
{21, "dev_packet1",       "=%i",         ata_dev_packet1, (void *)(&tempL ), 0},
{21, "dev_packet1",       "=%i",         ata_dev_packet1, (void *)(&tempL ), 0},
{21, "enddevice",         "",            end_device,    NULL, 0},
{21, "enddevice",         "",            end_device,    NULL, 0},
 
 
 
{22, "calling_convention","=%i",         NULL,          (void *)&config.cuc.calling_convention, 0},
 
{22, "enable_bursts",     "=%i",         NULL,          (void *)&config.cuc.enable_bursts, 0},
 
{22, "no_multicycle",     "=%i",         NULL,          (void *)&config.cuc.no_multicycle, 0},
 
{22, "memory_order",      "=%s ",        cuc_memory_order, (void *)&tempS, 0},
 
{22, "timings_fn",        "=\"%s\"",     NULL,          (void *)config.cuc.timings_fn}
};
};
 
 
/* *INDENT-ON* */
/* *INDENT-ON* */
 
 
int current_device = -1;
int current_device = -1;
Line 1243... Line 1259...
    config.atas[current_device].dev_packet1 = tempL;
    config.atas[current_device].dev_packet1 = tempL;
  else
  else
    ERROR("invalid device number.");
    ERROR("invalid device number.");
}
}
 
 
 
void cuc_memory_order () {
 
  if (strcmp (tempS, "none") == 0)
 
    config.cuc.memory_order = MO_NONE;
 
  else if (strcmp (tempS, "weak") == 0)
 
    config.cuc.memory_order = MO_WEAK;
 
  else if (strcmp (tempS, "strong") == 0)
 
    config.cuc.memory_order = MO_STRONG;
 
  else if (strcmp (tempS, "exact") == 0) {
 
    config.cuc.memory_order = MO_EXACT;
 
  } else {
 
    char tmp[200];
 
    sprintf (tmp, "invalid memory order '%s'.\n", tempS);
 
    ERROR(tmp);
 
  }
 
}
 
 
/* Read environment from a script file. Does not fail - assumes default configuration instead.
/* Read environment from a script file. Does not fail - assumes default configuration instead.
   The syntax of script file is:
   The syntax of script file is:
   param = value
   param = value
   section x
   section x

powered by: WebSVN 2.1.0

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