/* * Copyright (C) 2010 Tobias Klauser * 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; }; /* Aliases for general-purpors registers */ enum { zero = 0, at, et = 24, bt, gp, sp, fp, ea, ba, ra, }; /* Aliases for control registers */ enum { status = 0, estatus, bstatus, ienable, ipending, cpuid, /* reserved */ exception = 7, pteaddr, tlbacc, tlbmisc, /* reserved */ badaddr = 12, config, mpubase, mpuacc, }; extern void nios2_cpu_reset(struct nios2 *cpu); #endif /* _NIOS2_H_ */