rom.hh
来自「一个mips虚拟机非常好代码,使用C++来编写的,希望大家多学学,」· HH 代码 · 共 58 行
HH
58 行
#ifndef rom_hh_included#define rom_hh_included#include <clock.hh>#include <checkpoint.hh>#include <cpu.hh>#include <device.hh>#include <inttypes.hh>#include <module.hh>#include <serial.hh>#include <simarg.hh>class ROM : public Module, public Device{private: static SerialType<ROM> type; // Configuration parameter cache. const char* file_name; ClockValue read_latency, write_latency; // The clock frequency for which the cached values are valid. ClockValue freq; // Actual data array. UInt32 size; UInt64* data;public: // Constructors, etc. ROM(const SimArgs& args); ROM(Checkpoint& cp); ~ROM(); // Module interfaces. void reset(bool warm); // Serialization information. void checkpoint(Checkpoint& cp, bool parent = false) const; // Device access. ClockValue read(UInt64 addr, UInt64* buf, int size); ClockValue write(UInt64 addr, const UInt64* buf, int size);private: // Conviguration data. struct { char* file_name; int size; int read_latency, write_latency; } conf;};#endif // rom_hh_included
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?