Annotation of nono/vm/mpu.h, revision 1.1.1.14

1.1       root        1: //
                      2: // nono
1.1.1.3   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
1.1.1.11  root        7: //
1.1.1.13  root        8: // メイン MPU (680x0/88xx0) 共通部
1.1.1.11  root        9: //
1.1.1.2   root       10: 
1.1       root       11: #pragma once
                     12: 
                     13: #include "device.h"
1.1.1.11  root       14: #include "event.h"
                     15: #include "message.h"
1.1       root       16: 
1.1.1.13  root       17: class Debugger;
                     18: class MainbusDevice;
                     19: class Syncer;
                     20: 
1.1       root       21: class MPUDevice : public Device
                     22: {
1.1.1.3   root       23:        using inherited = Device;
1.1       root       24:  public:
1.1.1.13  root       25:        MPUDevice();
1.1.1.14! root       26:        ~MPUDevice() override;
1.1       root       27: 
1.1.1.5   root       28:        bool Init() override;
1.1.1.11  root       29:        void PowerOff() override;
1.1       root       30: 
1.1.1.2   root       31:        // 現在実行中の命令の PC を取得
                     32:        virtual uint32 GetPPC() const = 0;
1.1       root       33: 
1.1.1.11  root       34:        // 現在の VBR を取得
                     35:        virtual uint32 GetVBR() const = 0;
                     36: 
1.1.1.2   root       37:        // 現在アクセス中の論理アドレス、物理アドレスを取得。
                     38:        // Laddr == Paddr が MMU オフなのか PA=VA で運用中なのかの区別は
                     39:        // ここでは付かない。
                     40:        virtual uint32 GetLaddr() const = 0;
                     41:        virtual uint32 GetPaddr() const = 0;
1.1       root       42: 
1.1.1.14! root       43:        // MPU 名を取得する。("MC68030" みたいなやつ、ログ名とは別)
        !            44:        virtual const char *GetMPUName() const = 0;
        !            45: 
1.1.1.5   root       46:        // MPU クロック [kHz] を取得する。
                     47:        int GetClockSpeed() const { return clock_khz; }
                     48: 
1.1.1.12  root       49:        // MPU クロック [nsec] を取得する。
                     50:        uint64 GetClock_nsec() const { return clock_nsec; }
                     51: 
1.1.1.5   root       52:        // 割り込み発生を MPU に通知
                     53:        virtual void Interrupt(int level) = 0;
1.1.1.4   root       54: 
1.1.1.14! root       55:        // デバイスが CI (キャッシュ禁止) をセットする。
        !            56:        virtual void SetCI() = 0;
1.1.1.9   root       57: 
1.1.1.4   root       58:  protected:
1.1.1.11  root       59:        void TraceMessage(MessageID, uint32);
                     60:        virtual void SetTrace(bool trace_on) = 0;
                     61: 
1.1.1.5   root       62:        int clock_khz {};               // MPU クロック [kHz]
1.1.1.12  root       63:        uint64 clock_nsec {};   // MPU クロック [nsec]
                     64: 
                     65:        bool resetting {};              // リセット処理中フラグ
1.1.1.11  root       66: 
1.1.1.13  root       67:        Debugger *debugger {};
                     68:        MainbusDevice *mainbus {};
                     69:        Syncer *syncer {};
                     70: 
1.1.1.11  root       71:        // 1命令実行イベント
                     72:        Event exec_event { this };
1.1.1.10  root       73: 
                     74:        // Round Mode (モニタ表示用)
                     75:        static const char * const rmstr[4];
1.1       root       76: };
                     77: 
1.1.1.13  root       78: static inline MPUDevice *GetMPUDevice() {
                     79:        return Object::GetObject<MPUDevice>(OBJ_MPU);
                     80: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.