示例#1
0
        protected override void InitDetails(ulong programCounter)
        {
            Logger.Info("Init hart");
            // Set the initial program counter
            initialPc = programCounter;

            // Set the CPU, register, memory and Return Address Stack (ras) and hint
            cpu         = new Cpu64();
            register    = new Register64();
            csrRegister = Factory.CreateCsrRegister();
            memory      = Factory.CreateDynamicMemory(Architecture.Rv64I);
            environment = HartEnvironmentFactory.Build(Architecture.Rv64I, register, memory, csrRegister);

            composer = new RvcComposer64();

            ras = new Stack <ulong>();


            if (configuration.RvMode)
            {
                register.WriteUnsignedInt(2, 0x10000);
            }

            register.WriteUnsignedLong(3, programCounter);
        }
示例#2
0
        protected override void InitDetails(ulong programCounter)
        {
            // Set the initial program counter
            var programCounter32 = Convert.ToUInt32(programCounter);

            initialPc = programCounter32;


            // Set the CPU, register, memory and Return Address Stack (ras) and hint
            cpu         = new Cpu32();
            register    = new Register32(architecture);
            memory      = Factory.CreateDynamicMemory(architecture);
            csrRegister = Factory.CreateCsrRegister();
            environment = HartEnvironmentFactory.Build(architecture, register, memory, csrRegister);

            composer = new RvcComposer32();

            ras = new Stack <uint>();

            if (configuration.RvMode)
            {
                register.WriteUnsignedInt(2, 0x10000);
            }

            register.WriteUnsignedInt(3, programCounter32);
        }
示例#3
0
        public BootstrapCore64(Architecture architecture)
        {
            Memory       = Factory.CreateDynamicMemory(architecture);
            Register     = new Register64();
            CsrRegister  = Factory.CreateCsrRegister();
            RasStack     = new Stack <ulong>();
            Environment  = HartEnvironmentFactory.Build(architecture, Register, Memory, CsrRegister);
            BaseAddres   = 0x100;
            EndianCoding = EndianType.Little;

            InstructionsProcessed = new List <Instruction>();
            InstructionPayloads   = new List <InstructionPayload>();
        }