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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_1_x/] [or1ksim/] [cuc/] [insn.h] - Blame information for rev 1768

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

Line No. Rev Author Line
1 879 markom
/* insn.h -- OpenRISC Custom Unit Compiler, internal instruction definitions
2
 *    Copyright (C) 2002 Marko Mlinar, markom@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
#ifndef _DF_INSN_
21
#define _DF_INSN_
22
 
23
#include "cuc.h"
24
 
25
/* Instruction types */
26
#define II_ADD   0
27
#define II_SUB   1
28
#define II_AND   2
29
#define II_OR    3
30
#define II_XOR   4
31
#define II_MUL   5
32
#define II_SRL   6
33
#define II_SLL   7
34
#define II_SRA   8
35
#define II_LB    9
36
#define II_LH    10
37
#define II_LW    11
38
#define II_SB    12
39
#define II_SH    13
40
#define II_SW    14
41
#define II_SFEQ  15
42
#define II_SFNE  16
43
#define II_SFLE  17
44
#define II_SFLT  18
45
#define II_SFGE  19
46
#define II_SFGT  20
47 928 markom
#define II_BF    21
48
#define II_LRBB  22
49
#define II_CMOV  23
50
#define II_REG   24
51
#define II_NOP   25
52
#define II_CALL  26
53
#define II_LAST  26
54 879 markom
 
55
/* misc flags */
56
#define II_MASK   0x0fff
57
#define II_MEM    0x1000
58
#define II_SIGNED 0x2000
59
 
60
#define II_IS_LOAD(x) ((x) == II_LB || (x) == II_LH || (x) == II_LW)
61 932 markom
#define II_IS_STORE(x) ((x) == II_SB || (x) == II_SH || (x) == II_SW)
62 883 markom
#define II_MEM_WIDTH(x) (((x) == II_LB || (x) == II_SB) ? 1 :\
63
                         ((x) == II_LH || (x) == II_SH) ? 2 :\
64
                         ((x) == II_LW || (x) == II_SW) ? 4 : -1)
65 879 markom
 
66
/* List of known instructions and their rtl representation */
67
typedef struct {
68
        char *name;
69
        int  comutative;
70
        char *rtl;
71
} cuc_known_insn;
72
 
73
extern const cuc_known_insn known[II_LAST + 1];
74
 
75
/* Timing table -- same indexes as known table */
76
typedef struct {
77
        double delay;
78
        double size;
79
        double delayi;
80
        double sizei;
81
} cuc_timing_table;
82
 
83
/* Conversion links */
84
typedef struct {
85
        const char *from;
86
        const int to;
87
} cuc_conv;
88
 
89 883 markom
/* normal (not immediate) size of a function */
90
double ii_size (int index, int imm);
91
 
92
/* Returns instruction size */
93
double insn_time (cuc_insn *ii);
94
 
95
/* Returns instruction time */
96
double insn_size (cuc_insn *ii);
97
 
98 879 markom
/* Find known instruction and attach them to insn */
99
void change_insn_type (cuc_insn *i, int index);
100
 
101
/* Returns instruction name */
102
const char *cuc_insn_name (cuc_insn *ii);
103
 
104
/* Loads in the specified timings table */
105
void load_timing_table (char *filename);
106
 
107 897 markom
/* Displays shared instructions */
108
void print_shared (cuc_func *rf, cuc_shared_item *shared, int nshared);
109
 
110 879 markom
#endif /* _DF_INSN_ */
111
 

powered by: WebSVN 2.1.0

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