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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cpu/] [common/] [parse.c] - Diff between revs 819 and 848

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

Rev 819 Rev 848
Line 102... Line 102...
  r = (char *)malloc (strlen (s) + 1);
  r = (char *)malloc (strlen (s) + 1);
  strcpy (r, s);
  strcpy (r, s);
  return (r);
  return (r);
}
}
 
 
 
/* Parses string line and puts up to maxparam parameters into argv[]; number of parameters is returned */
 
int tokenize_line (char *str, char *argv[], int maxparam)
 
{
 
  int i, param = 0;
 
  str = stripwhite (str);
 
  while (*str) {
 
    char *p;
 
    argv[param] = str;
 
    while (*str && !isblank (*str)) str++;
 
    param++;
 
    p = str;
 
    if (param >= maxparam) break;
 
    while (*str && isblank (*str)) str++;
 
    *p = 0;
 
  }
 
  for (i = 0; i < param; i++) argv[i] = stripwhite (argv[i]);
 
  return param;
 
}
 
 
/* Used only by the simulator loader to translate logical addresses into physical.
/* Used only by the simulator loader to translate logical addresses into physical.
   If loadcode() is called with valid virtphy_transl pointer to a table of
   If loadcode() is called with valid virtphy_transl pointer to a table of
   translations then translate() performs translation otherwise phy address is
   translations then translate() performs translation otherwise phy address is
   equal to logical. */
   equal to logical. */
static unsigned int translate(unsigned int laddr,int* breakpoint)
static unsigned int translate(unsigned int laddr,int* breakpoint)

powered by: WebSVN 2.1.0

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