Exemplo n.º 1
0
        void AssertReferenceOutput(string testName, ComplianceCPUSimilator sim)
        {
            var dataSectionAddress = DataSectionAddress() >> 2;
            var referenceOutput    = ReferenceOutput(testName);

            AssertMemory(sim, dataSectionAddress, referenceOutput);
        }
Exemplo n.º 2
0
        ComplianceCPUSimilator Run()
        {
            var dataMarkerAddress = DataMarkerAddress();
            var sim = new ComplianceCPUSimilator(dataMarkerAddress);

            sim.ClockCycle();
            sim.RunAll(Instructions());

            return(sim);
        }
Exemplo n.º 3
0
        protected void AssertMemory(ComplianceCPUSimilator sim, int testAddress, uint[] expectedValues)
        {
            for (var i = 0; i < expectedValues.Length; i++)
            {
                var actualWordAddress = testAddress + i;
                var expected          = expectedValues[i];
                var actual            = sim.MemoryBlock[actualWordAddress];

                if (expected != actual)
                {
                    throw new AssertFailedException($"Expected:<0x{expected:X8}>. Actual:<0x{actual:X8}>. Failed for value at {i} (0x{(actualWordAddress * 4):X8})");
                }
            }
        }