Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public Cpu32()
 {
     opCodeRegistry = new OpCodeRegistry();
     composer       = new RvcComposer32();
 }