public LruStrategy(IPhysicalMemory physicalMemory) { if (physicalMemory.Any(f => !(f is IFrameWithTimeStamps))) { throw new Exception("bad frame type"); } _physicalMemory = physicalMemory; }
public FifoStrategy(IPhysicalMemory physicalMemory) { foreach (var frame in physicalMemory) { _frameGuidList.Add(frame.Id); } _enumerator = RepeatForever(_frameGuidList).GetEnumerator(); }
public ALruStrategy(IPhysicalMemory physicalMemory) { foreach (var frame in physicalMemory) { if (!(frame is IFrameWithMarker)) { throw new Exception("bad frame type"); } _queue.Add(frame); } }
public void ProcessAll() { _physicalMemory = _physicalMemoryFactory.Create(FrameList); _virtualMemory = _virtualMemoryFactory.Create(PageList); Process.PhysicalMemory = _physicalMemory; Process.VirtualMemory = _virtualMemory; while (Process.HasNextPageToLoad) { Process.LoadNextPage(); } StrategyName = Process.ToString(); PageErrors = Process.PagesErrors; }
/// <summary> /// Decodes the instruction in physical memory at the given address. /// </summary> /// <param name="mem"></param> /// <param name="address"></param> public Instruction(IPhysicalMemory mem, uint address) { // // Read the first halfword of the instruction in, determine its type and see if we need go further. // ushort hword = mem.ReadHalfWord(address); Op = (Opcode)(hword >> 8); Rx = (hword & 0xf0) >> 4; Ry = hword & 0xf; if ((hword & 0x8000) != 0) { // // This is a memory reference instruction. // Is this a short or long displacement instruction? // if ((hword & 0x1000) != 0) { Displacement = (int)mem.ReadWord(address + 2); Length = 6; } else { Displacement = (short)mem.ReadHalfWord(address + 2); Length = 4; } // Compute the displacement address (PC + Displacement) for branches. // The LSB is used for branch prediction logic BranchAddress = (uint)((address + Displacement) & 0xfffffffe); } else { Length = 2; } }
public FDLP(IPhysicalMemory mem, Processor cpu) { _mem = mem; _cpu = cpu; }
public OptStrategy(IPhysicalMemory physicalMemory, List <IPageReference> pageReferences) { _physicalMemory = physicalMemory; _pageReferences = pageReferences; }
public Processor(IPhysicalMemory mem, IOBus io) { _mem = mem; _io = io; }
public RandomStrategy(IPhysicalMemory physicalMemory) { _frames = physicalMemory.ToList(); }