예제 #1
0
        public WpcCpuBoard.State getUiState(bool includeExpensiveData = true)
        {
            var uiState          = cpuBoard.getState();
            var asicChangedState = uiFacade.getChangedAsicState((WpcCpuBoard.Asic)uiState.asic, includeExpensiveData);

            uiState.asic = asicChangedState;

            var runtime = new DateTimeOffset(DateTime.Now).ToUnixTimeMilliseconds() - startTime;

            // TODO should be renamed to averageTicksPerMs
            uiState.opsMs   = (int)(uiState.cpuState.tickCount / runtime);
            uiState.runtime = runtime;
            return(uiState);
        }
예제 #2
0
        public void ShouldGetUIData()
        {
            TestContext.WriteLine("should get ui data");

            cpuBoard.reset();
            var result = cpuBoard.getState();

            Assert.That(result.cpuState.tickCount, Is.EqualTo(0));
            Assert.That(result.cpuState.missedIRQ, Is.EqualTo(0));
            Assert.That(result.cpuState.missedFIRQ, Is.EqualTo(0));
            Assert.That(result.cpuState.irqCount, Is.EqualTo(0));
            Assert.That(result.cpuState.firqCount, Is.EqualTo(0));
            Assert.That(result.cpuState.nmiCount, Is.EqualTo(0));
            Assert.That(result.protectedMemoryWriteAttempts, Is.EqualTo(0));
            Assert.That(result.memoryWrites, Is.EqualTo(0));
            Assert.That(result.version, Is.EqualTo(5));
        }