From 32f507ce5f66dd9c89a45854688f46bde33c5e3d Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 10 Nov 2010 09:20:50 +0100 Subject: Initial import of nios2sim (http://nios2sim.googlecode.com/svn/trunk/ r16) --- instruction.h | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 instruction.h (limited to 'instruction.h') diff --git a/instruction.h b/instruction.h new file mode 100644 index 0000000..2253c86 --- /dev/null +++ b/instruction.h @@ -0,0 +1,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 + + -- cgit v1.2.3-54-g00ecf