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

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_61/] [or1ksim/] [cuc/] [insn.h] - Blame information for rev 879

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
#define II_SFOR  21
48
#define II_BF    22
49
#define II_LRBB  23
50
#define II_CMOV  24
51
#define II_REG   25
52
#define II_NOP   26
53
#define II_LAST  26
54
 
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
#define II_MEM_WIDTH(x) ((x) == II_LB || (x) == II_SB ? 1 :\
62
                         (x) == II_LH || (x) == II_SH ? 1 :\
63
                         (x) == II_LW || (x) == II_SW ? 1 : -1)
64
 
65
/* Clock speed in ns */
66
extern double cycle_duration;
67
 
68
/* List of known instructions and their rtl representation */
69
typedef struct {
70
        char *name;
71
        int  comutative;
72
        char *rtl;
73
} cuc_known_insn;
74
 
75
extern const cuc_known_insn known[II_LAST + 1];
76
 
77
/* Timing table -- same indexes as known table */
78
typedef struct {
79
        double delay;
80
        double size;
81
        double delayi;
82
        double sizei;
83
} cuc_timing_table;
84
 
85
/* Conversion links */
86
typedef struct {
87
        const char *from;
88
        const int to;
89
} cuc_conv;
90
 
91
/* Find known instruction and attach them to insn */
92
void change_insn_type (cuc_insn *i, int index);
93
 
94
/* Returns instruction name */
95
const char *cuc_insn_name (cuc_insn *ii);
96
 
97
/* Loads in the specified timings table */
98
void load_timing_table (char *filename);
99
 
100
#endif /* _DF_INSN_ */
101
 

powered by: WebSVN 2.1.0

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