diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2010-11-11 09:27:41 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2010-11-11 09:28:03 +0100 |
commit | e1051b8c95059c28d8215b84dcbe4f41b326cb56 (patch) | |
tree | 0f336f5fa92cbd39eaf71d02ebd9c3ffa1e5fb49 /nios2.h | |
parent | 26c3f9e1e50b7fcec816f4711717b69d1ee00ee2 (diff) |
Baisc instruction handling
Diffstat (limited to 'nios2.h')
-rw-r--r-- | nios2.h | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,33 @@ +/* + * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch> + * Copyright (C) 2010 chysun2000@gmail.com + * + * This file is part of nios2sim-ng. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#ifndef _NIOS2_H_ +#define _NIOS2_H_ + +#include "instruction.h" + +#define NIOS2_GP_REG_COUNT 32 +/* there are really 32, but 16-31 are reserved for future use */ +#define NIOS2_CTRL_REG_COUNT 16 + +struct nios2 { + /* General-Purpose Registers */ + uint32_t gp_regs[NIOS2_GP_REG_COUNT]; + /* Control Registers */ + uint32_t ctrl_regs[NIOS2_CTRL_REG_COUNT]; + /* Program counter */ + uint32_t pc; +}; + +#define PC_INC_NORMAL 0 +#define PC_INC_BY_INSTR 1 + +#endif /* _NIOS2_H_ */ |