Exemple #1
0
        static Registers()
        {
            var factory = new StorageFactory();

            GpRegisters    = factory.RangeOfReg32(32, "r{0}");
            GpRegisters[0] = new RegisterStorage("zero", 0, 0, PrimitiveType.Word32);
            sp             = GpRegisters[27] = new RegisterStorage("sp", 27, 0, PrimitiveType.Word32);
            ra             = GpRegisters[31] = new RegisterStorage("ra", 31, 0, PrimitiveType.Word32);

            var ctrlFactory = new StorageFactory(StorageDomain.SystemRegister);

            ControlRegisters = new RegisterStorage?[]
            {
                ctrlFactory.Reg32("status"),    // 0 - Refer to The status Register on page 45
                ctrlFactory.Reg32("estatus"),   // 1 - Refer to The estatus Register on page 47
                ctrlFactory.Reg32("bstatus"),   // 2 - Refer to The bstatus Register
                ctrlFactory.Reg32("ienable"),   // 3 - Internal interrupt - enable bits - Available only when the external interrupt controller interface is not present.Otherwise reserved.
                ctrlFactory.Reg32("ipending"),  // 4 - Pending internal interrupt bits  Available only when the external interrupt controller interface is not present.
                ctrlFactory.Reg32("cpuid"),     // 5 - Unique processor identifier
                null,                           // 6 - Reserved
                ctrlFactory.Reg32("exception"), // 7 - Refer to The exception Register
                ctrlFactory.Reg32("pteaddr"),   // 8 - Refer to The pteaddr Register Available only when the MMU is present.

                ctrlFactory.Reg32("tlbacc"),    // 9 - Refer to The tlbacc Register Available only when the MMU is present.

                ctrlFactory.Reg32("tlbmisc"),   // 10 - Refer to The tlbmisc Register Available only when the MMU is present.
                ctrlFactory.Reg32("eccinj"),    // 11 - Refer to The eccinj Register Available only when ECC is present.
                ctrlFactory.Reg32("badaddr"),   // 12 - Refer to The badaddr Register
                ctrlFactory.Reg32("config"),    // 13 - Refer to The config Register on page 55. Available only when the MPU or ECC is present.
                ctrlFactory.Reg32("mpubase"),   // 14 - Refer to The mpubase Register Available only when the MPU is present.
                ctrlFactory.Reg32("mpuacc"),    // 15 - Refer to The mpuacc Register for MASK variations table
            };

            RegsByName = GpRegisters.ToDictionary(r => r.Name);
        }
Exemple #2
0
        static Registers()
        {
            var factory = new StorageFactory();

            GpRegisters     = factory.RangeOfReg(16, i => $"r{i}", PrimitiveType.Word16);
            GpRegisters[15] = new RegisterStorage("sp", 15, 0, PrimitiveType.Word16);

            ByName = GpRegisters.ToDictionary(r => r.Name);
        }