This repository has been archived on 2026-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
Virtual-Memory-Demo/Assets/Scripts/Simulation/SimulationState.cs

37 lines
1.1 KiB
C#

using System;
using VMdemo.Core;
namespace VMdemo.Simulation
{
[Serializable]
public class SimulationState
{
public int CurrentRound { get; set; }
public TranslationStep CurrentStep { get; set; }
public ulong CurrentVirtualAddress { get; set; }
public AddressParts CurrentAddressParts { get; set; }
public ulong CurrentPhysicalAddress { get; set; }
public ulong CurrentPfn { get; set; }
public bool HasCurrentPfn { get; set; }
public bool IsPageFault { get; set; }
public bool IsTlbHit { get; set; }
public bool IsPageTableHit { get; set; }
public int CurrentCost { get; set; }
public void Reset()
{
CurrentRound = 0;
CurrentStep = TranslationStep.GenerateVA;
CurrentVirtualAddress = 0UL;
CurrentAddressParts = AddressParts.Empty;
CurrentPhysicalAddress = 0UL;
CurrentPfn = 0UL;
HasCurrentPfn = false;
IsPageFault = false;
IsTlbHit = false;
IsPageTableHit = false;
CurrentCost = 0;
}
}
}