Exemplo n.º 1
0
        public void AmdOpteron2347HE()
        {
            AuthenticAmdCpu cpu = GetCpu("AMD Opteron-2347-HE.xml");

            CheckSignature(0x100F21);
            FeatureCheck.Check("standard", 0x00802009, 0x17BFBFFD);
            FeatureCheck.Check("extended", 0x000007FF, 0xEFD3FBFF, 0x00003030);
            Assert.That(cpu.Description, Is.EqualTo("Quad-Core AMD Opteron(tm) Processor 2347 HE"));
            Assert.That(cpu.BrandString, Is.EqualTo("Quad-Core AMD Opteron(tm) Processor 2347 HE"));

            CacheTopoList expectedCache = new CacheTopoList()
            {
                new CacheTopoCpu(1, CacheType.Instruction, 2, 64, 64),
                new CacheTopoCpu(1, CacheType.Data, 2, 64, 64),
                new CacheTopoCpu(2, CacheType.Unified, 16, 64, 512),
                new CacheTopoCpu(3, CacheType.Unified, 32, 64, 2 * 1024),
                new CacheTopoTlb(1, CacheType.InstructionTlb4k, 0, 32),
                new CacheTopoTlb(1, CacheType.InstructionTlb2M4M, 0, 16),
                new CacheTopoTlb(1, CacheType.DataTlb4k, 0, 48),
                new CacheTopoTlb(1, CacheType.DataTlb2M4M, 0, 48),
                new CacheTopoTlb(1, CacheType.DataTlb1G, 0, 48),
                new CacheTopoTlb(2, CacheType.InstructionTlb4k, 4, 512),
                new CacheTopoTlb(2, CacheType.DataTlb4k, 4, 512),
                new CacheTopoTlb(2, CacheType.DataTlb2M4M, 2, 128),
            };

            Assert.That(cpu.Topology.CacheTopology, Is.EquivalentTo(expectedCache).Using(new CacheTopoComparer()));
        }
Exemplo n.º 2
0
        public void AmdPhenomIIX2550()
        {
            AuthenticAmdCpu cpu = GetCpu("AMD PhenomIIX2-550.xml");

            CheckSignature(0x100F42);
            FeatureCheck.Check("standard", 0x00802009, 0x178BFBFF);
            FeatureCheck.Check("extended", 0x000037FF, 0xEFD3FBFF, 0x00002001);
            Assert.That(cpu.Description, Is.EqualTo("AMD Phenom(tm) II X2 550 Processor"));
            Assert.That(cpu.BrandString, Is.EqualTo("AMD Phenom(tm) II X2 550 Processor"));

            CacheTopoList expectedCache = new CacheTopoList()
            {
                new CacheTopoCpu(1, CacheType.Instruction, 2, 64, 64),
                new CacheTopoCpu(1, CacheType.Data, 2, 64, 64),
                new CacheTopoCpu(2, CacheType.Unified, 16, 64, 512),
                new CacheTopoCpu(3, CacheType.Unified, 48, 64, 6 * 1024),
                new CacheTopoTlb(1, CacheType.InstructionTlb4k, 0, 32),
                new CacheTopoTlb(1, CacheType.InstructionTlb2M4M, 0, 16),
                new CacheTopoTlb(1, CacheType.DataTlb4k, 0, 48),
                new CacheTopoTlb(1, CacheType.DataTlb2M4M, 0, 48),
                new CacheTopoTlb(1, CacheType.DataTlb1G, 0, 48),
                new CacheTopoTlb(2, CacheType.InstructionTlb4k, 4, 512),
                new CacheTopoTlb(2, CacheType.DataTlb4k, 4, 512),
                new CacheTopoTlb(2, CacheType.DataTlb2M4M, 2, 128),
                new CacheTopoTlb(2, CacheType.DataTlb1G, 8, 16)
            };

            Assert.That(cpu.Topology.CacheTopology, Is.EquivalentTo(expectedCache).Using(new CacheTopoComparer()));
        }
Exemplo n.º 3
0
        public void AmdA8()
        {
            AuthenticAmdCpu cpu = GetCpu("AMD A8.xml");

            CheckSignature(0x610F01);
            FeatureCheck.Check("standard", 0x3698320B, 0x178BFBFF, 0x00000008, 0x00000000, 0x00000000);
            FeatureCheck.Check("extended", 0x01EBBFFF, 0x2FD3FBFF, 0x00000000);
            Assert.That(cpu.Description, Is.EqualTo("AMD A8-5500 APU with Radeon(tm) HD Graphics"));

            CacheTopoList expectedCache = new CacheTopoList()
            {
                new CacheTopoCpu(1, CacheType.Instruction, 2, 64, 64),
                new CacheTopoCpu(1, CacheType.Data, 4, 64, 16),
                new CacheTopoCpu(2, CacheType.Unified, 16, 64, 2048),
                new CacheTopoTlb(1, CacheType.InstructionTlb4k, 0, 48),
                new CacheTopoTlb(1, CacheType.InstructionTlb2M4M, 0, 24),
                new CacheTopoTlb(1, CacheType.InstructionTlb1G, 0, 24),
                new CacheTopoTlb(1, CacheType.DataTlb4k, 0, 64),
                new CacheTopoTlb(1, CacheType.DataTlb2M4M, 0, 64),
                new CacheTopoTlb(1, CacheType.DataTlb1G, 0, 64),
                new CacheTopoTlb(2, CacheType.InstructionTlb4k, 4, 512),
                new CacheTopoTlb(2, CacheType.InstructionTlb2M4M, 8, 1024),
                new CacheTopoTlb(2, CacheType.InstructionTlb1G, 8, 24),
                new CacheTopoTlb(2, CacheType.DataTlb4k, 8, 1024),
                new CacheTopoTlb(2, CacheType.DataTlb2M4M, 8, 1024),
                new CacheTopoTlb(2, CacheType.DataTlb1G, 8, 1024)
            };

            Assert.That(cpu.Topology.CacheTopology, Is.EquivalentTo(expectedCache).Using(new CacheTopoComparer()));
        }
Exemplo n.º 4
0
            public static string GetType(AuthenticAmdCpu cpu)
            {
                int brand = GetBrand(cpu);

                if (brand == 0)
                {
                    return("AMD Engineering Sample");
                }

                int str1 = (brand & 0x780000) >> 19;
                int str2 = (brand & 0xF00) >> 8;
                int pm   = ((brand & 0x7F000) >> 12) - 1;
                int pg   = (brand & 0x800000) >> 23;

                CpuIdRegister ext81Reg = cpu.Registers.GetCpuId(GenericIntelCpuBase.ExtendedInformationFunction, 0);
                int           pkgType  = (ext81Reg.Result[1] >> 28) & 0xF;

                CpuIdRegister ext88Reg = cpu.Registers.GetCpuId(GenericIntelCpuBase.ExtendedLmApicId, 0);
                int           nc       = ext88Reg.Result[2] & 0xFF;

                string pma = string.Format("{0:D02}", pm);
                string s1  = Family11hTree[pkgType][1][pg][nc][str1].Value;

                if (!string.IsNullOrEmpty(s1))
                {
                    string s2 = Family11hTree[pkgType][2][pg][nc][str2].Value;
                    if (string.IsNullOrEmpty(s2))
                    {
                        return(string.Format("{0}{1}", s1, pma));
                    }
                    return(string.Format("{0}{1}{2}", s1, pma, s2));
                }
                return("AMD Processor Model Unknown");
            }
Exemplo n.º 5
0
        public void AmdGeode()
        {
            AuthenticAmdCpu cpu = GetCpu("AMD Geode.xml");

            CheckSignature(0x5A2);
            FeatureCheck.Check("standard", 0x00000000, 0x0088A93D);
            FeatureCheck.Check("extended", 0x00000000, 0xC0C0A13D);
            Assert.That(cpu.Description, Is.EqualTo("Geode(TM) Integrated Processor by AMD PCS"));
        }
Exemplo n.º 6
0
            public static string GetType(AuthenticAmdCpu cpu)
            {
                int key = (cpu.Family << 4) | cpu.Model;

                if (AmdLegacy.TryGetValue(key, out string brandName))
                {
                    return(brandName);
                }
                return(string.Empty);
            }
Exemplo n.º 7
0
        private AuthenticAmdCpu GetCpu(string fileName)
        {
            string fullPath = Path.Combine(TestResources, fileName);

            FeatureCheck.LoadCpu(fullPath);
            AuthenticAmdCpu x86cpu = FeatureCheck.Cpu as AuthenticAmdCpu;

            Assert.That(x86cpu, Is.Not.Null);
            Assert.That(x86cpu.CpuVendor, Is.EqualTo(CpuVendor.AuthenticAmd));
            Assert.That(x86cpu.VendorId, Is.EqualTo("AuthenticAMD"));
            Assert.That(x86cpu.Topology.CoreTopology.IsReadOnly, Is.True);
            Assert.That(x86cpu.Topology.CacheTopology.IsReadOnly, Is.True);
            return(x86cpu);
        }
Exemplo n.º 8
0
        protected ICpuIdX86 Create(BasicCpu cpu)
        {
            ICpuIdX86 x86cpu;

            switch (cpu.VendorId)
            {
            case "GenuineIntel":
                try {
                    x86cpu = new GenuineIntelCpu(cpu);
                } catch {
                    if (!cpu.CpuRegisters.IsOnline)
                    {
                        throw;
                    }
                    x86cpu = new GenericIntelCpu(cpu);
                }
                break;

            case "AuthenticAMD":
                try {
                    x86cpu = new AuthenticAmdCpu(cpu);
                } catch {
                    if (!cpu.CpuRegisters.IsOnline)
                    {
                        throw;
                    }
                    x86cpu = new GenericIntelCpu(cpu);
                }
                break;

            default:
                x86cpu = new GenericIntelCpu(cpu);
                break;
            }

            x86cpu.Topology.CoreTopology.IsReadOnly  = true;
            x86cpu.Topology.CacheTopology.IsReadOnly = true;
            return(x86cpu);
        }