--- nono/vm/mpu88xx0.h 2026/04/29 17:04:32 1.1.1.1 +++ nono/vm/mpu88xx0.h 2026/04/29 17:04:36 1.1.1.2 @@ -1,6 +1,7 @@ // // nono -// Copyright (C) 2020 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // // MPU (m88xx0) @@ -12,33 +13,33 @@ class MPU88xx0Device : public MPUDevice { - typedef MPUDevice inherited; + using inherited = MPUDevice; public: MPU88xx0Device(uint32 reset_addr); - virtual ~MPU88xx0Device(); + ~MPU88xx0Device() override; - virtual void ResetHard(); + void ResetHard() override; - virtual bool MonitorUpdate(); + bool MonitorUpdate() override; // MPU を request サイクル分実行する - virtual uint32 Run(uint64 request) { return cpu->Run(request); } + uint32 Run(uint64 request) override { return cpu->Run(request); } // 基準サイクル数を取得 - virtual uint64 total_cycle() const { return cpu->total_cycle; } + uint64 total_cycle() const override { return cpu->total_cycle; } // MPU の処理をこの命令で中断させる。 - virtual void Release() { cpu->Release(); } + void Release() override { cpu->Release(); } // 現在実行中の命令の PC を取得 - virtual uint32 GetPPC() const { return cpu->Getxip(); } + uint32 GetPPC() const override { return cpu->Getxip(); } // 現在アクセス中の論理アドレス、物理アドレスを取得。 - virtual uint32 GetLaddr() const { return 0; } // XXX NotImplemented - virtual uint32 GetPaddr() const { return 0; } // XXX NotImplemented + uint32 GetLaddr() const override { return 0; } // XXX NotImplemented + uint32 GetPaddr() const override { return 0; } // XXX NotImplemented // 割り込み発生を MPU に通知 - virtual void Interrupt(int dummy) { cpu->Interrupt(); } + void Interrupt(Object *src, int level) override; // CPU コアを取得 (主にデバッグ用途) m88kcpu *GetCPU() const { return cpu.get(); } @@ -50,4 +51,19 @@ class MPU88xx0Device : public MPUDevice std::unique_ptr cpu; }; +// ATC モニタ +class MPU88200ATC : public Object +{ + public: + MPU88200ATC(m88200 *cmmu); + ~MPU88200ATC() override { } + + bool MonitorUpdate() override; + + private: + m88200 *cmmu = NULL; +}; + +extern std::unique_ptr gMPU88200ATC[2]; + #define gMPU88xx0 (dynamic_cast(gMPU.get()))