OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [or1ksim/] [peripheral/] [mc.c] - Diff between revs 224 and 385

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

Rev 224 Rev 385
Line 352... Line 352...
mc_poc (union param_val  val,
mc_poc (union param_val  val,
        void            *dat)
        void            *dat)
{
{
  struct mc *mc = dat;
  struct mc *mc = dat;
 
 
  if (val.int_val > 0xf)
  if (val.int_val > MC_POC_VALID)
    {
    {
      fprintf (stderr, "Warning: memory controller PoC > 4 bits: truncated\n");
      fprintf (stderr, "Warning: memory controller PoC > 0x%lx: truncated\n",
 
               MC_POC_VALID);
    }
    }
 
 
  mc->poc = val.int_val & 0xf;
  mc->poc = val.int_val & MC_POC_VALID;
 
 
}       /* mc_poc() */
}       /* mc_poc() */
 
 
 
 
 
/*---------------------------------------------------------------------------*/
 
/*!Set the index of this memory controller.
 
 
 
   This identifies which chip enable value will select this memory
 
   controller. Truncate if the value is too large with a warning.
 
 
 
   @param[in] val  The value to use
 
   @param[in] dat  The config data structure                                 */
 
/*---------------------------------------------------------------------------*/
static void
static void
mc_index (union param_val val, void *dat)
mc_index (union param_val val, void *dat)
{
{
  struct mc *mc = dat;
  struct mc *mc = dat;
  mc->index = val.int_val;
 
 
  if (val.int_val > MC_CE_VALID)
 
    {
 
      fprintf (stderr, "Warning: memory controller index > 0x%x: truncated.\n",
 
               MC_CE_VALID);
 
    }
 
 
 
  mc->index = val.int_val & MC_CE_VALID;
}
}
 
 
 
 
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/*!Initialize a new memory controller configuration
/*!Initialize a new memory controller configuration
 
 
   ALL parameters are set explicitly to default values.                      */
   ALL parameters are set explicitly to default values.                      */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

powered by: WebSVN 2.1.0

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