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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [sysc/] [include/] [MemoryLoad.h] - Diff between revs 52 and 462

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

Rev 52 Rev 462
Line 22... Line 22...
   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
/* Here we define some often used caharcters in assembly files.  This wil
/* Here we define some often used caharcters in assembly files.  This wil
   probably go into architecture dependent directory. */
   probably go into architecture dependent directory. */
 
 
 
 
#ifndef MEMORYLOAD__H
#ifndef MEMORYLOAD__H
#define MEMORYLOAD__H
#define MEMORYLOAD__H
 
 
/* Package includes */
/* Package includes */
//#include "sim-config.h"
//#include "sim-config.h"
Line 71... Line 70...
 
 
#ifndef ULONGEST
#ifndef ULONGEST
#define ULONGEST unsigned long long
#define ULONGEST unsigned long long
#endif /* ULONGEST */
#endif /* ULONGEST */
 
 
 
 
 
 
#define PRIx32 "x"
#define PRIx32 "x"
#define PRIx16 "hx"
#define PRIx16 "hx"
#define PRIx8 "hhx"
#define PRIx8 "hhx"
#define PRId32 "d"
#define PRId32 "d"
 
 
Line 87... Line 84...
 
 
/* Endianness convenience macros */
/* Endianness convenience macros */
#define LE16(x) bswap_16(x)
#define LE16(x) bswap_16(x)
 
 
/*! Instruction queue */
/*! Instruction queue */
struct iqueue_entry
struct iqueue_entry {
{
 
  int       insn_index;
  int       insn_index;
  uint32_t  insn;
  uint32_t  insn;
  oraddr_t  insn_addr;
  oraddr_t  insn_addr;
};
};
 
 
/*! Structure for holding one label per particular memory location */
/*! Structure for holding one label per particular memory location */
struct label_entry
struct label_entry {
{
 
  char               *name;
  char               *name;
  oraddr_t            addr;
  oraddr_t            addr;
  struct label_entry *next;
  struct label_entry *next;
};
};
 
 
/* from arch sim cpu/or1k/opcode/or32.h */
/* from arch sim cpu/or1k/opcode/or32.h */
#define MAX_GPRS 32
#define MAX_GPRS 32
#define PAGE_SIZE 8192
#define PAGE_SIZE 8192
 
 
 
class MemoryLoad {
 
 
class MemoryLoad
 
{
 
 public:
 public:
 
 
  // Constructor
  // Constructor
  MemoryLoad(OrpsocAccess            *_accessor);
  MemoryLoad(OrpsocAccess            *_accessor);
 
 
  // Label access function
  // Label access function
  struct label_entry* get_label (oraddr_t addr);
  struct label_entry* get_label (oraddr_t addr);
 
 
  uint32_t  loadcode (char     *filename,
  uint32_t  loadcode (char     *filename,
                      oraddr_t  startaddr,
                          oraddr_t startaddr, oraddr_t virtphy_transl);
                      oraddr_t  virtphy_transl);
 
 
 
 
 
 private:
 private:
 
 
  //! The accessor for the Orpsoc instance
  //! The accessor for the Orpsoc instance
  OrpsocAccess *accessor;
  OrpsocAccess *accessor;
Line 157... Line 147...
  // A large number, for the Linux kernel (~8000 functions)
  // A large number, for the Linux kernel (~8000 functions)
#define LABELS_HASH_SIZE 10000
#define LABELS_HASH_SIZE 10000
  /* Local list of labels (symbols) */
  /* Local list of labels (symbols) */
  struct label_entry *label_hash[LABELS_HASH_SIZE];
  struct label_entry *label_hash[LABELS_HASH_SIZE];
 
 
 
 
  /* Function prototypes for external use */
  /* Function prototypes for external use */
  char     *strstrip (char       *dst,
        char *strstrip(char *dst, const char *src, int n);
                      const char *src,
 
                      int         n);
 
 
 
  oraddr_t translate (oraddr_t  laddr,
 
                      int      *breakpoint);
 
 
 
 
        oraddr_t translate(oraddr_t laddr, int *breakpoint);
 
 
  int bits (uint32_t val);
  int bits (uint32_t val);
 
 
  void check_insn (uint32_t insn);
  void check_insn (uint32_t insn);
 
 
  void addprogram (oraddr_t  address,
        void addprogram(oraddr_t address, uint32_t insn);
                   uint32_t  insn,
 
                   int      *breakpoint);
        void readfile_coff(char *filename, short sections);
 
 
  void readfile_coff (char  *filename,
        void readsyms_coff(char *filename, uint32_t symptr, uint32_t syms);
                      short  sections);
 
 
 
  void readsyms_coff (char *filename,
 
                      uint32_t symptr,
 
                      uint32_t syms);
 
 
 
  void readfile_elf (char *filename);
  void readfile_elf (char *filename);
 
 
  void identifyfile (char *filename);
  void identifyfile (char *filename);
 
 
Line 193... Line 173...
  void add_label (oraddr_t addr, char *name);
  void add_label (oraddr_t addr, char *name);
 
 
  struct label_entry* find_label (char *name);
  struct label_entry* find_label (char *name);
  oraddr_t eval_label (char *name);
  oraddr_t eval_label (char *name);
 
 
 
 
 
 
 
 
};
};
 
 
#endif  /* MEMORYLOAD__H */
#endif  /* MEMORYLOAD__H */
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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