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

Subversion Repositories or1k

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

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
#define MEMORY_LEN      100000
21
#define STACK_SIZE      10000
22 28 lampret
#define LABELNAME_LEN   50
23 26 lampret
#define INSNAME_LEN     15
24
#define OPERANDNAME_LEN 50
25 2 cvs
 
26 28 lampret
/* Structure for holding several labels of a particular memory location */
27
struct label_entry {
28
        char *name;
29
        struct label_entry *next;
30
};
31
 
32
/* Structure that holds disassembled instruction. */
33
struct insn_entry {
34
        char *insn;
35
        char *op1;
36
        char *op2;
37
        char *op3;
38
        char *op4;
39
};
40
 
41
/* This is an abstract memory type rather than physical memory type. It holds
42
disassembled instructions. */
43 2 cvs
struct mem_entry {
44
        unsigned char data;
45
        unsigned char brk;
46 28 lampret
        struct label_entry *label; /* labels */
47
        struct insn_entry *insn; /* insn */
48 2 cvs
};
49
 
50 22 lampret
enum insn_type { unknown, exception, arith, shift, compare, branch,
51 2 cvs
                 jump, load, store, movimm, move, extend, nop };
52
 
53
/* Instruction queue */
54
struct iqueue_entry {
55
        char insn[INSNAME_LEN];
56
        enum insn_type func_unit;
57
        char op1[OPERANDNAME_LEN];
58
        char op2[OPERANDNAME_LEN];
59
        char op3[OPERANDNAME_LEN];
60
        char op4[OPERANDNAME_LEN];
61
        char *dependdst;
62
        char *dependsrc1;
63
        char *dependsrc2;
64
        unsigned long insn_addr;
65
};
66
 
67
/* Completition queue */
68
struct icomplet_entry {
69
        char insn[INSNAME_LEN];
70
        enum insn_type func_unit;
71
        char op1[OPERANDNAME_LEN];
72
        char op2[OPERANDNAME_LEN];
73
        char op3[OPERANDNAME_LEN];
74
        char op4[OPERANDNAME_LEN];
75
        char *dependdst;
76
        char *dependsrc1;
77
        char *dependsrc2;
78
        unsigned long insn_addr;
79
};
80
 
81
extern struct iqueue_entry iqueue[20];
82
extern struct icomplet_entry icomplet[20];
83
extern unsigned long pc;
84
 
85
extern struct mem_entry mem[MEMORY_LEN];
86
extern void dumpmemory(unsigned int from, unsigned int to);
87
extern unsigned long eval_label(char *label);
88
extern unsigned long eval_mem32(unsigned long memaddr);
89
extern unsigned short eval_mem16(unsigned long memaddr);
90
extern unsigned char eval_mem8(unsigned long memaddr);
91
extern void set_mem32(unsigned long memaddr, unsigned long value);
92
extern void set_mem16(unsigned long memaddr, unsigned short value);
93
extern void set_mem8(unsigned long memaddr, unsigned char value);

powered by: WebSVN 2.1.0

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