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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [cpu/] [common/] [abstract.c] - Diff between revs 101 and 220

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

Rev 101 Rev 220
Line 397... Line 397...
      return mem->ops.readfunc32 (memaddr & mem->size_mask,
      return mem->ops.readfunc32 (memaddr & mem->size_mask,
                                  mem->ops.read_dat32);
                                  mem->ops.read_dat32);
    }
    }
  else
  else
    {
    {
 
      if (config.sim.report_mem_errs)
 
        {
      PRINTF ("EXCEPTION: read out of memory (32-bit access to %" PRIxADDR
      PRINTF ("EXCEPTION: read out of memory (32-bit access to %" PRIxADDR
              ")\n", memaddr);
              ")\n", memaddr);
 
        }
 
 
      except_handle (EXCEPT_BUSERR, vaddr);
      except_handle (EXCEPT_BUSERR, vaddr);
    }
    }
 
 
  return 0;
  return 0;
}
}
Line 423... Line 427...
      return mem->ops.readfunc16 (memaddr & mem->size_mask,
      return mem->ops.readfunc16 (memaddr & mem->size_mask,
                                  mem->ops.read_dat16);
                                  mem->ops.read_dat16);
    }
    }
  else
  else
    {
    {
 
      if (config.sim.report_mem_errs)
 
        {
      PRINTF ("EXCEPTION: read out of memory (16-bit access to %" PRIxADDR
      PRINTF ("EXCEPTION: read out of memory (16-bit access to %" PRIxADDR
              ")\n", memaddr);
              ")\n", memaddr);
 
        }
 
 
      except_handle (EXCEPT_BUSERR, vaddr);
      except_handle (EXCEPT_BUSERR, vaddr);
    }
    }
 
 
  return 0;
  return 0;
}
}
Line 449... Line 457...
      return mem->ops.readfunc8 (memaddr & mem->size_mask,
      return mem->ops.readfunc8 (memaddr & mem->size_mask,
                                 mem->ops.read_dat8);
                                 mem->ops.read_dat8);
    }
    }
  else
  else
    {
    {
 
      if (config.sim.report_mem_errs)
 
        {
      PRINTF ("EXCEPTION: read out of memory (8-bit access to %" PRIxADDR
      PRINTF ("EXCEPTION: read out of memory (8-bit access to %" PRIxADDR
              ")\n", memaddr);
              ")\n", memaddr);
 
        }
 
 
      except_handle (EXCEPT_BUSERR, vaddr);
      except_handle (EXCEPT_BUSERR, vaddr);
    }
    }
 
 
  return 0;
  return 0;
}
}
Line 524... Line 536...
    {
    {
      if ((mem = verify_memoryarea (phys_memaddr)))
      if ((mem = verify_memoryarea (phys_memaddr)))
        return mem->direct_ops.readfunc32 (phys_memaddr & mem->size_mask,
        return mem->direct_ops.readfunc32 (phys_memaddr & mem->size_mask,
                                           mem->direct_ops.read_dat32);
                                           mem->direct_ops.read_dat32);
      else
      else
        PRINTF ("ERR: 32-bit read out of memory area: %" PRIxADDR
        fprintf (stderr, "ERR: 32-bit read out of memory area: %" PRIxADDR
                " (physical: %" PRIxADDR ")\n", memaddr, phys_memaddr);
                " (physical: %" PRIxADDR ")\n", memaddr, phys_memaddr);
    }
    }
 
 
  return 0;
  return 0;
}
}
Line 633... Line 645...
    {
    {
      if ((mem = verify_memoryarea (phys_memaddr)))
      if ((mem = verify_memoryarea (phys_memaddr)))
        return mem->direct_ops.readfunc16 (phys_memaddr & mem->size_mask,
        return mem->direct_ops.readfunc16 (phys_memaddr & mem->size_mask,
                                           mem->direct_ops.read_dat16);
                                           mem->direct_ops.read_dat16);
      else
      else
        PRINTF ("ERR: 16-bit read out of memory area: %" PRIxADDR
        fprintf (stderr, "ERR: 16-bit read out of memory area: %" PRIxADDR
                " (physical: %" PRIxADDR "\n", memaddr, phys_memaddr);
                " (physical: %" PRIxADDR "\n", memaddr, phys_memaddr);
    }
    }
 
 
  return 0;
  return 0;
}
}
Line 693... Line 705...
    {
    {
      if ((mem = verify_memoryarea (phys_memaddr)))
      if ((mem = verify_memoryarea (phys_memaddr)))
        return mem->direct_ops.readfunc8 (phys_memaddr & mem->size_mask,
        return mem->direct_ops.readfunc8 (phys_memaddr & mem->size_mask,
                                          mem->direct_ops.read_dat8);
                                          mem->direct_ops.read_dat8);
      else
      else
        PRINTF ("ERR: 8-bit read out of memory area: %" PRIxADDR
        fprintf (stderr, "ERR: 8-bit read out of memory area: %" PRIxADDR
                " (physical: %" PRIxADDR "\n", memaddr, phys_memaddr);
                " (physical: %" PRIxADDR "\n", memaddr, phys_memaddr);
    }
    }
 
 
  return 0;
  return 0;
}
}
Line 722... Line 734...
      dyn_checkwrite (memaddr);
      dyn_checkwrite (memaddr);
#endif
#endif
    }
    }
  else
  else
    {
    {
 
      if (config.sim.report_mem_errs)
 
        {
      PRINTF ("EXCEPTION: write out of memory (32-bit access to %" PRIxADDR
      PRINTF ("EXCEPTION: write out of memory (32-bit access to %" PRIxADDR
              ")\n", memaddr);
              ")\n", memaddr);
 
        }
 
 
      except_handle (EXCEPT_BUSERR, vaddr);
      except_handle (EXCEPT_BUSERR, vaddr);
    }
    }
}
}
 
 
/* For cpu accesses
/* For cpu accesses
Line 750... Line 766...
      dyn_checkwrite (memaddr);
      dyn_checkwrite (memaddr);
#endif
#endif
    }
    }
  else
  else
    {
    {
 
      if (config.sim.report_mem_errs)
 
        {
      PRINTF ("EXCEPTION: write out of memory (16-bit access to %" PRIxADDR
      PRINTF ("EXCEPTION: write out of memory (16-bit access to %" PRIxADDR
              ")\n", memaddr);
              ")\n", memaddr);
 
        }
 
 
      except_handle (EXCEPT_BUSERR, vaddr);
      except_handle (EXCEPT_BUSERR, vaddr);
    }
    }
}
}
 
 
/* For cpu accesses
/* For cpu accesses
Line 778... Line 798...
      dyn_checkwrite (memaddr);
      dyn_checkwrite (memaddr);
#endif
#endif
    }
    }
  else
  else
    {
    {
 
      if (config.sim.report_mem_errs)
 
        {
      PRINTF ("EXCEPTION: write out of memory (8-bit access to %" PRIxADDR
      PRINTF ("EXCEPTION: write out of memory (8-bit access to %" PRIxADDR
              ")\n", memaddr);
              ")\n", memaddr);
 
        }
 
 
      except_handle (EXCEPT_BUSERR, vaddr);
      except_handle (EXCEPT_BUSERR, vaddr);
    }
    }
}
}
 
 
/* Set mem, 32-bit. Big endian version.
/* Set mem, 32-bit. Big endian version.
Line 860... Line 884...
    {
    {
      if ((mem = verify_memoryarea (phys_memaddr)))
      if ((mem = verify_memoryarea (phys_memaddr)))
        mem->direct_ops.writefunc32 (phys_memaddr & mem->size_mask, value,
        mem->direct_ops.writefunc32 (phys_memaddr & mem->size_mask, value,
                                     mem->direct_ops.write_dat32);
                                     mem->direct_ops.write_dat32);
      else
      else
        PRINTF ("ERR: 32-bit write out of memory area: %" PRIxADDR
        fprintf (stderr, "ERR: 32-bit write out of memory area: %" PRIxADDR
                " (physical: %" PRIxADDR ")\n", memaddr, phys_memaddr);
                " (physical: %" PRIxADDR ")\n", memaddr, phys_memaddr);
    }
    }
 
 
  if (cur_area && cur_area->log)
  if (cur_area && cur_area->log)
    fprintf (cur_area->log, "[%" PRIxADDR "] -> DIRECT write %08" PRIx32 "\n",
    fprintf (cur_area->log, "[%" PRIxADDR "] -> DIRECT write %08" PRIx32 "\n",
Line 941... Line 965...
    {
    {
      if ((mem = verify_memoryarea (phys_memaddr)))
      if ((mem = verify_memoryarea (phys_memaddr)))
        mem->direct_ops.writefunc16 (phys_memaddr & mem->size_mask, value,
        mem->direct_ops.writefunc16 (phys_memaddr & mem->size_mask, value,
                                     mem->direct_ops.write_dat16);
                                     mem->direct_ops.write_dat16);
      else
      else
        PRINTF ("ERR: 16-bit write out of memory area: %" PRIxADDR
        fprintf (stderr, "ERR: 16-bit write out of memory area: %" PRIxADDR
                " (physical: %" PRIxADDR "\n", memaddr, phys_memaddr);
                " (physical: %" PRIxADDR "\n", memaddr, phys_memaddr);
    }
    }
 
 
  if (cur_area && cur_area->log)
  if (cur_area && cur_area->log)
    fprintf (cur_area->log, "[%" PRIxADDR "] -> DIRECT write %04" PRIx16 "\n",
    fprintf (cur_area->log, "[%" PRIxADDR "] -> DIRECT write %04" PRIx16 "\n",
Line 1008... Line 1032...
    {
    {
      if ((mem = verify_memoryarea (phys_memaddr)))
      if ((mem = verify_memoryarea (phys_memaddr)))
        mem->direct_ops.writefunc8 (phys_memaddr & mem->size_mask, value,
        mem->direct_ops.writefunc8 (phys_memaddr & mem->size_mask, value,
                                    mem->direct_ops.write_dat8);
                                    mem->direct_ops.write_dat8);
      else
      else
        PRINTF ("ERR: 8-bit write out of memory area: %" PRIxADDR
        fprintf (stderr, "ERR: 8-bit write out of memory area: %" PRIxADDR
                " (physical: %" PRIxADDR "\n", memaddr, phys_memaddr);
                " (physical: %" PRIxADDR "\n", memaddr, phys_memaddr);
    }
    }
 
 
  if (cur_area && cur_area->log)
  if (cur_area && cur_area->log)
    fprintf (cur_area->log, "[%" PRIxADDR "] -> DIRECT write %02" PRIx8 "\n",
    fprintf (cur_area->log, "[%" PRIxADDR "] -> DIRECT write %02" PRIx8 "\n",

powered by: WebSVN 2.1.0

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