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

Subversion Repositories sardmips

[/] [sardmips/] [trunk/] [source/] [constants/] [constants.h] - Blame information for rev 20

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

Line No. Rev Author Line
1 4 igorloi
//
2 17 igorloi
// $Id: constants.h,v 1.2 2006-02-09 15:39:38 igorloi Exp $
3 4 igorloi
//
4
#ifndef _CONSTANTS_H
5
#define _CONSTANTS_H
6
// #include "config.h"
7
#include <stdio.h>
8
 
9
//#ifndef _DEBUG_
10
//#define _DEBUG_    
11
//#endif
12
 
13
#ifdef _DEBUG_
14
#define PRINT(aa) cout << "MIPS:  "  << aa
15
#define PRINTLN(aa) cout << "MIPS:  "  << aa << endl
16
#define PRINT2(aa,bb) cout << "MIPS:  "  << aa << bb
17
#define PRINT2LN(aa,bb) cout << "MIPS:  "  << aa << bb << endl
18
#define PRINT3(aa,bb,cc) cout << "MIPS:  "  << aa << bb << cc
19
#define PRINT3LN(aa,bb,cc) cout << "MIPS:  "  << aa << bb << cc <<endl
20
#else
21
#define PRINT(aa)
22
#define PRINTLN(aa)
23
#define PRINT2(aa,bb)
24
#define PRINT2LN(aa,bb)
25
#define PRINT3(aa,bb,cc)
26
#define PRINT3LN(aa,bb,cc)
27
#endif
28
 
29
#define SC_LOGIC_0 (sc_logic) 0
30
#define SC_LOGIC_1 (sc_logic) 1
31
 
32
 
33
#define BIT_ZERO      '0'
34
#define BIT_ONE       '1'
35
#define BIT_X         'X'
36
#define BIT_Z         'Z'
37
 
38
#define BYTE_ZERO      "00000000"
39
#define BYTE_ONE       "11111111"
40
#define BYTE_X         "XXXXXXXX"
41
#define BYTE_Z         "ZZZZZZZZ"
42
 
43
#define HALFWORD_ZERO  "0000000000000000"
44
#define HALFWORD_ONE   "1111111111111111"
45
#define HALFWORD_X     "XXXXXXXXXXXXXXXX"
46
#define HALFWORD_Z     "ZZZZZZZZZZZZZZZZ"
47
 
48
#define WORD_ZERO      "00000000000000000000000000000000"
49
#define WORD_ONE       "11111111111111111111111111111111"
50
#define WORD_X         "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
51
#define WORD_Z         "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
52
#define DOUBLE_ZERO    "0000000000000000000000000000000000000000000000000000000000000000"
53
 
54
#define WORD_CON_ONE       "00000000000000000000000000000001"
55
#define WORD_CON_TWO       "00000000000000000000000000000010"
56
#define WORD_CON_THREE     "00000000000000000000000000000011"
57
#define WORD_CON_FOUR      "00000000000000000000000000000100"
58
#define WORD_CON_FIVE      "00000000000000000000000000000101"
59
#define WORD_CON_10000     "00000000000000000010011100010000"
60
 
61
#define OP_RFORMAT "000000"
62
#define OP_BRANCH  "000001"
63
#define BRANCH_BLTZ    "00"
64
#define BRANCH_BGEZ    "01"
65
#define BRANCH_BLTZAL  "10"
66
#define BRANCH_BGEZAL  "11"
67
#define OP_J       "000010"
68
#define OP_JAL     "000011"
69
#define OP_BEQ     "000100"
70
#define OP_BNE     "000101"
71
#define OP_BLEZ    "000110"
72
#define OP_BGTZ    "000111"
73
#define OP_ADDI    "001000"
74
#define OP_ADDIU   "001001"
75
#define OP_SLTI    "001010"
76
#define OP_SLTIU   "001011"
77
#define OP_ANDI    "001100"
78
#define OP_ORI     "001101"
79
#define OP_XORI    "001110"
80
#define OP_LUI     "001111"
81
 
82
#define OP_COPROC0 "010000"
83
#define OP_COPROC1 "010001"
84
#define OP_COPROC2 "010010"
85
 
86
#define OP_LB      "100000"
87
#define OP_LH      "100001"
88
#define OP_LWL     "100010"
89
#define OP_LW      "100011"
90
#define OP_LBU     "100100"
91
#define OP_LHU     "100101"
92
#define OP_LWR     "100110"
93
#define OP_SB      "101000"
94
#define OP_SH      "101001"
95
#define OP_SWL     "101010"
96
#define OP_SW      "101011"
97
#define OP_SWR     "101110"
98
#define OP_CACHE   "101111"
99
#define OP_COSW0   "110000"
100
#define OP_COSW1   "110001"
101
#define OP_COSW2   "110010"
102
 
103
#define FUNC_SLL     "000000"
104
#define FUNC_SRL     "000010"
105
#define FUNC_SRA     "000011"
106
#define FUNC_SLLV    "000100"
107
#define FUNC_SRLV    "000110"
108
#define FUNC_SRAV    "000111"
109
#define FUNC_JR      "001000"
110
#define FUNC_JALR    "001001"
111
#define FUNC_SYSCALL "001100"
112
#define FUNC_BREAK   "001101"
113
#define FUNC_MFHI    "010000"
114
#define FUNC_MTHI    "010001"
115
#define FUNC_MFLO    "010010"
116
#define FUNC_MTLN    "010011"
117
#define FUNC_MULT    "011000"
118
#define FUNC_MULTU   "011001"
119
#define FUNC_DIV     "011010"
120
#define FUNC_DIVU    "011011"
121
#define FUNC_ADD     "100000"
122
#define FUNC_ADDU    "100001"
123
#define FUNC_SUB     "100010"
124
#define FUNC_SUBU    "100011"
125
#define FUNC_AND     "100100"
126
#define FUNC_OR      "100101"
127
#define FUNC_XOR     "100110"
128
#define FUNC_NOR     "100111"
129
#define FUNC_SLT     "101010"
130
#define FUNC_SLTU    "101011"
131
 
132
#define FUNC_    
133
 
134
/*!
135
  Cp0 function code
136
  Note - thei
137
*/
138
#define FUNC_TLBR    "000001"
139
#define FUNC_TLBWI   "000010"
140
#define FUNC_TLBWR   "000110"
141
#define FUNC_TLBP    "001000"
142
#define FUNC_ERET    "011000"
143
#define FUNC_DERET   "011111"
144
#define FUNC_WAIT    "100000"
145
 
146
 
147 17 igorloi
#define RS_MFC0 "00000"
148 4 igorloi
#define RS_MTC0 "00100"
149
 
150
 
151
#define CP0_NOTHING "0000"
152
#define CP0_SYSCALL "0001"
153
#define CP0_BREAK   "0010"
154
#define CP0_CACHE   "0011"
155
#define CP0_ERET    "0100"
156
#define CP0_MFC0    "0101"
157
#define CP0_MTC0    "0110"
158
#define CP0_TLBP    "0111"
159
#define CP0_TLBWR   "1000"
160
#define CP0_TLBWI   "1001"
161
#define CP0_TLBR    "1010"
162
#define CP0_WAIT    "1011"
163
#define CP0_DERET   "1100"
164
 
165
#define OCP_MCMD_IDLE "000"
166
#define OCP_MCMD_WR   "001"
167
#define OCP_MCMD_RD   "010"
168
#define OCP_MCMD_RDEX "011"
169
#define OCP_MCMD_BCST "111"
170
 
171
#define OCP_SRESP_NULL "00"
172
#define OCP_SRESP_DVA  "01"
173
#define OCP_SRESP_ERR  "11"
174
 
175
#endif

powered by: WebSVN 2.1.0

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