📄 regfile_adaptor.h
字号:
/**
* Copyright (c) 2005 Zhejiang University, P.R.China
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
//=============================================================================
/**
* \class Regfile_Adaptor
*
* \brief To adapt the Register_File class
*
* \author Chenfeng Zhou <ini_autumn@163.com>
*
* $Id: Regfile_Adaptor.h,v 1.1 2005/06/16 06:01:51 qilj Exp $
*
* Last update: <2005-02-09 18:55:21 by Cheney Chow>
*/
//=============================================================================
#ifndef _PPC_REGFILE_ADAPTOR_H_
#define _PPC_REGFILE_ADAPTOR_H_
#include <map>
#include <string>
#include "Core/Register.h"
#include "Types.h"
#include "Register.h"
#include "PPC.h"
namespace PPC {
class Core::Register_File;
class PPC_API Regfile_Adaptor
{
public:
Regfile_Adaptor (Core::Register_File *);
//! set regs to zero;
int init ();
//! get some register by index, just like array;
PPC_Register& operator[] (PPC_u32 index);
PPC_Register& get_spr (unsigned int spr_n);
//! Get spr desciptions
const std::string& get_spr_info (unsigned int spr_n);
public:
static void append_info (Core::Register_File::Config &,
const Core::Register_File::Register_Meta&);
private:
//! map spr number
//! at the end of init()
void init_spr_map ();
private:
//! meta infomation for each register;
static Core::Register_File::Register_Meta reg_info_[];
static const int INFO_SIZE = NR_REG;
private:
Core::Register_File *reg_file_;
std::map<SPR_Index, Reg_Index> spr_map_;
};
} // namespace PPC
#endif // _PPC_REGFILE_ADAPTOR_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -