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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_49/] [or1ksim/] [cpu/] [common/] [abstract.h] - Blame information for rev 201

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 cvs
/* abstract.c -- Abstract entities header file
2
   Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
3
 
4
This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
 
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
GNU General Public License for more details.
15
 
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20 30 lampret
#define MEMORY_START    0
21 167 markom
#define MEMORY_LEN      0x800000
22 37 lampret
#define STACK_SIZE      20
23 28 lampret
#define LABELNAME_LEN   50
24 26 lampret
#define INSNAME_LEN     15
25
#define OPERANDNAME_LEN 50
26 2 cvs
 
27 138 markom
#define MAX_OPERANDS    (4)
28
 
29 28 lampret
/* Structure for holding several labels of a particular memory location */
30
struct label_entry {
31 123 markom
  char *name;
32
  struct label_entry *next;
33 28 lampret
};
34
 
35 134 markom
#define OP_MEM_ACCESS 0x80000000
36
 
37
/* This is an abstract memory type rather than physical memory type.  It holds
38
disassembled instructions.  */
39 2 cvs
struct mem_entry {
40 123 markom
  unsigned char data;
41
  unsigned char brk;
42
  struct label_entry *label; /* labels */
43 2 cvs
};
44
 
45 22 lampret
enum insn_type { unknown, exception, arith, shift, compare, branch,
46 123 markom
                 jump, load, store, movimm, move, extend, nop, mac };
47 2 cvs
 
48
/* Instruction queue */
49
struct iqueue_entry {
50 123 markom
  enum insn_type func_unit;
51 138 markom
  int insn_index;
52
  unsigned long insn;
53
  unsigned long op[2 * MAX_OPERANDS];
54 123 markom
  unsigned long insn_addr;
55 2 cvs
};
56
 
57 30 lampret
/* Memory regions assigned to devices */
58
struct dev_memarea {
59 123 markom
  struct dev_memarea *next;
60
  unsigned long baseaddr;
61
  unsigned long size;
62 201 erez
  unsigned long (*readfunc)(unsigned long);
63
  void (*writefunc)(unsigned long, unsigned long);
64 30 lampret
};
65
 
66 2 cvs
extern struct iqueue_entry iqueue[20];
67 138 markom
extern struct iqueue_entry icomplet[20];
68 2 cvs
extern unsigned long pc;
69
 
70
extern struct mem_entry mem[MEMORY_LEN];
71 167 markom
extern void dumpmemory(unsigned int from, unsigned int to, int disasm);
72 2 cvs
extern unsigned long eval_label(char *label);
73 123 markom
extern unsigned long eval_mem32(unsigned long memaddr,int*);
74
extern unsigned short eval_mem16(unsigned long memaddr,int*);
75
extern unsigned char eval_mem8(unsigned long memaddr,int*);
76
extern void set_mem32(unsigned long memaddr, unsigned long value,int*);
77
extern void set_mem16(unsigned long memaddr, unsigned short value,int*);
78
extern void set_mem8(unsigned long memaddr, unsigned char value,int*);
79
 
80
unsigned long evalsim_mem32(unsigned long,int*);
81
unsigned short evalsim_mem16(unsigned long,int*);
82
unsigned char evalsim_mem8(unsigned long,int*);
83
void setsim_mem32(unsigned long,unsigned long);
84
void setsim_mem16(unsigned long,unsigned short);
85
void setsim_mem8(unsigned long,unsigned char);
86
 
87 167 markom
#ifndef DEBUGMOD_OFF
88 123 markom
extern int GlobalMode; /* Added by CZ 26/05/01 */
89 167 markom
#else /* DEBUGMOD_OFF */
90
#define GlobalMode 0
91
#endif /* DEBUGMOD_OFF */
92 123 markom
 
93
/* Added by MM */
94
#ifndef LONGEST
95
 
96
#ifdef BFD64
97
 
98
#define LONGEST BFD_HOST_64_BIT
99
#define ULONGEST BFD_HOST_U_64_BIT
100
 
101
#else /* No BFD64 */
102
 
103
#ifdef CC_HAS_LONG_LONG
104
#define LONGEST long long
105
#define ULONGEST unsigned long long
106
#else
107
#ifdef BFD_HOST_64_BIT
108
/* BFD_HOST_64_BIT is defined for some hosts that don't have long long
109
   (e.g. i386-windows) so try it.  */
110
#define LONGEST BFD_HOST_64_BIT
111
#define ULONGEST BFD_HOST_U_64_BIT
112
#else
113
#define LONGEST long
114
#define ULONGEST unsigned long
115
#endif
116
#endif
117
 
118
#endif /* No BFD64 */
119
 
120
#endif /* ! LONGEST */

powered by: WebSVN 2.1.0

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