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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_1_x/] [or1ksim/] [sim-config.c] - Diff between revs 970 and 997

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

Rev 970 Rev 997
Line 321... Line 321...
 
 
void print_config()
void print_config()
{
{
  if (config.sim.verbose) {
  if (config.sim.verbose) {
    char temp[20];
    char temp[20];
    printf("Verbose on, ");
    PRINTF("Verbose on, ");
    if (config.sim.debug)
    if (config.sim.debug)
      printf("simdebug on, ");
      PRINTF("simdebug on, ");
    else
    else
      printf("simdebug off, ");
      PRINTF("simdebug off, ");
    if (runtime.sim.iprompt)
    if (runtime.sim.iprompt)
      printf("interactive prompt on\n");
      PRINTF("interactive prompt on\n");
    else
    else
      printf("interactive prompt off\n");
      PRINTF("interactive prompt off\n");
 
 
    printf("Machine initialization...\n");
    PRINTF("Machine initialization...\n");
    generate_time_pretty (temp, config.sim.clkcycle_ps);
    generate_time_pretty (temp, config.sim.clkcycle_ps);
    printf("Clock cycle: %s\n", temp);
    PRINTF("Clock cycle: %s\n", temp);
    if (testsprbits(SPR_UPR, SPR_UPR_DCP))
    if (testsprbits(SPR_UPR, SPR_UPR_DCP))
      printf("Data cache present.\n");
      PRINTF("Data cache present.\n");
    else
    else
      printf("No data cache.\n");
      PRINTF("No data cache.\n");
    if (testsprbits(SPR_UPR, SPR_UPR_ICP))
    if (testsprbits(SPR_UPR, SPR_UPR_ICP))
      printf("Insn cache tag present.\n");
      PRINTF("Insn cache tag present.\n");
    else
    else
      printf("No instruction cache.\n");
      PRINTF("No instruction cache.\n");
    if (config.bpb.enabled)
    if (config.bpb.enabled)
      printf("BPB simulation on.\n");
      PRINTF("BPB simulation on.\n");
    else
    else
      printf("BPB simulation off.\n");
      PRINTF("BPB simulation off.\n");
    if (config.bpb.btic)
    if (config.bpb.btic)
      printf("BTIC simulation on.\n");
      PRINTF("BTIC simulation on.\n");
    else
    else
      printf("BTIC simulation off.\n");
      PRINTF("BTIC simulation off.\n");
  }
  }
}
}
 
 
#if !FAST_SIM
#if !FAST_SIM
/* Forward declarations of functions */
/* Forward declarations of functions */
Line 1317... Line 1317...
    unsigned long start, length;
    unsigned long start, length;
    char type[STR_SIZE];
    char type[STR_SIZE];
    int nparam;
    int nparam;
    int rd, wd;
    int rd, wd;
    if (config.sim.verbose && !runtime.sim.output_cfg)
    if (config.sim.verbose && !runtime.sim.output_cfg)
      printf ("Reading script file from '%s'...\n", local ? filename : ctmp);
      PRINTF ("Reading script file from '%s'...\n", local ? filename : ctmp);
    strcpy (runtime.sim.script_fn, local ? filename : ctmp);
    strcpy (runtime.sim.script_fn, local ? filename : ctmp);
 
 
    while (!feof(f)) {
    while (!feof(f)) {
      char param[STR_SIZE];
      char param[STR_SIZE];
      if (fscanf(f, "%s ", &param) != 1) break;
      if (fscanf(f, "%s ", &param) != 1) break;
Line 1394... Line 1394...
{
{
  char *sec, *item, *params;
  char *sec, *item, *params;
  int noparams = 0, i, noitem = 0;
  int noparams = 0, i, noitem = 0;
  while (*s && isspace (*s)) s++;
  while (*s && isspace (*s)) s++;
  sec = s;
  sec = s;
  printf ("s:%s\n", s);
  PRINTF ("s:%s\n", s);
  while (*s && *s != ' ') s++;
  while (*s && *s != ' ') s++;
  if (!(*s)) noitem = 1;
  if (!(*s)) noitem = 1;
  *s = 0;
  *s = 0;
  printf ("sec:%s\n", sec);
  PRINTF ("sec:%s\n", sec);
  section = 0;
  section = 0;
  for (i = 1; i < sizeof(sections) / sizeof(struct section); i++)
  for (i = 1; i < sizeof(sections) / sizeof(struct section); i++)
    if (strcmp (sections[i].name, sec) == 0) {
    if (strcmp (sections[i].name, sec) == 0) {
      section = i;
      section = i;
      break;
      break;
Line 1418... Line 1418...
    noparams = 1;
    noparams = 1;
    params = "";
    params = "";
  } else
  } else
    params = s + 1;
    params = s + 1;
  *s = 0;
  *s = 0;
  printf ("item:%s\n", item);
  PRINTF ("item:%s\n", item);
  printf ("params:%s\n", params);
  PRINTF ("params:%s\n", params);
  {
  {
    int i, found = -1;
    int i, found = -1;
    for (i = 0; i < sizeof(config_params)/sizeof(struct config_params); i++)
    for (i = 0; i < sizeof(config_params)/sizeof(struct config_params); i++)
      if (config_params[i].section == section && strcmp (config_params[i].name, item) == 0) {
      if (config_params[i].section == section && strcmp (config_params[i].name, item) == 0) {
        found = i;
        found = i;
Line 1445... Line 1445...
void set_config_command(char *s)
void set_config_command(char *s)
{
{
  int i;
  int i;
  switch (set_config (s)) {
  switch (set_config (s)) {
    case 1:
    case 1:
      printf ("Invalid or missing section name.  One of valid sections must be specified:\n");
      PRINTF ("Invalid or missing section name.  One of valid sections must be specified:\n");
      for (i = 1; i < sizeof(sections) / sizeof(struct section); i++)
      for (i = 1; i < sizeof(sections) / sizeof(struct section); i++)
        printf ("%s ", sections[i].name);
        PRINTF ("%s ", sections[i].name);
      printf ("\n");
      PRINTF ("\n");
      break;
      break;
    case 2:
    case 2:
      printf ("Invalid or missing item name.  One of valid items must be specified:\n");
      PRINTF ("Invalid or missing item name.  One of valid items must be specified:\n");
      for (i = 0; i < sizeof(config_params)/sizeof(struct config_params); i++)
      for (i = 0; i < sizeof(config_params)/sizeof(struct config_params); i++)
        if (config_params[i].section == section)
        if (config_params[i].section == section)
          printf ("%s ", config_params[i].name);
          PRINTF ("%s ", config_params[i].name);
      printf ("\n");
      PRINTF ("\n");
      break;
      break;
    case 3:
    case 3:
      printf ("Invalid parameters specified.\n");
      PRINTF ("Invalid parameters specified.\n");
      break;
      break;
  }
  }
}
}
#endif /* !FAST_SIM */
#endif /* !FAST_SIM */
 
 

powered by: WebSVN 2.1.0

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