public ExternalMmuBase(ICPUWithExternalMmu cpu, uint windowsCount)
        {
            this.cpu          = cpu;
            this.windowsCount = windowsCount;
            windowMapping     = new Dictionary <uint, uint>();

            cpu.EnableExternalWindowMmu(true);
            for (uint index = 0; index < windowsCount; index++)
            {
                AddWindow(index);
            }
        }
示例#2
0
        public ExternalWindowMMU(ICPUWithExternalMmu cpu, ulong startAddress, ulong windowSize, uint numberOfWindows) : base(cpu, numberOfWindows)
        {
            this.numberOfWindows = numberOfWindows;
            IRQ       = new GPIO();
            registers = DefineRegisters();

            cpu.AddHookOnMmuFault((faultAddress, accessType, faultyWindowAddress) =>
            {
                if (faultyWindowAddress != -1 && this.ContainsWindowWithIndex((uint)faultyWindowAddress))
                {
                    this.TriggerInterrupt();
                    throw new CpuAbortException("Mmu fault occured. This must be handled properly");
                }
            });
        }