summaryrefslogtreecommitdiff
path: root/instruction.h
blob: 2253c86ab9379a5ee1e31f5b84abe2ca07e03985 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
    Nios-sim - one simple NIOSII simulator only for personal interest and fun.
    Copyright (C) 2010  chysun2000@gmail.com

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef __INSTRUCTION_H__
#define __INSTRUCTION_H__

/*--J_TYPE-------------------------------------------------------------*/
/*--R_TYPE-------------------------------------------------------------*/
enum OPX_TYPE_INSTR{
	ERET = 0x01,
	ROLI = 0x02,
	ROL  = 0x03,
	FLUSHP = 0x04,
	RET = 0x05,
	NOR = 0x06,
	MULXUU = 0x07,
	CMPGE = 0x08,
	BRET = 0x09,
	ROR=0x0B,
	FLUSHI=0x0c,
	JMP=0x0d,
	AND=0x0e,
	CMPLT = 0x10,
	SLLI = 0x12,
	SLL=0x13,
	WRPRS = 0x14,
	OR = 0x16,
	MULXSU=0x17,
	CMPNE=0x18,
	SRLI = 0x1A,
	SRL=0x1b,
	NEXTPC=0x1c,
	CALLR = 0x1D,
	XOR=0x1e,
	MULXSS=0x1f,
	CMPEQ=0x20,
	DIVU = 0x24,
	DIV=0x25,
	RDCTL,
	MUL,
	CMPGEU,
	INITI,
	TRAP = 0x2D,
	WRCTL,
	CMPLTU = 0x30,
	ADD,
	BREAK = 0x34,
	SYNC = 0x36,
	SUB = 0x39,
	SRAI = 0x3A,
	SRA=0x3b
};
/*--I_TYPE-------------------------------------------------------------*/
enum OP_TYPE_INSTR{
	CALL = 0x00,
	JMPI = 0x01,
	LDBU = 0x03,
	ADDI = 0x04,
	STB = 0x05,
	BR = 0x06,
	LDB = 0x07,
	CMPGEI = 0x08,
	LDHU = 0x0B,
	ANDI = 0x0C,
	STH = 0x0D,
	BGE = 0x0E,
	LDH = 0x0F,
	CMPLTI = 0x10,
	INITDA = 0x13,
	ORI,
	STW,
	BLT,
	LDW,
	CMPNEI=0x18,
	FLUSHDA = 0x1B,
	XORI = 0x1C,
	BNE = 0x1E,
	CMPEQI = 0x20,
	LDBUIO = 0x23,
	MULI,
	STBIO,
	BEQ,
	LDBIO,
	CMPGEUI=0x28,
	LDHUIO = 0x2B,
	ANDHI = 0x2C,
	STHIO = 0x2D,
	BGEU = 0x2E,
	LDHIO = 0x2F,
	CMPLTUI = 0x30,
	CUSTOM = 0x32,
	INITD,
	ORHI,
	STWIO,
	BLTU,
	LDWIO,
	RDPRS,
	R_TYPE = 0x3A,
    FLUSHD = 0x3B,
	XORHI = 0x3C
};
#endif