예제 #1
0
파일: CPU.cs 프로젝트: mohamedhh/MipSim
        static CPU()
        {
            RegisterFile = new GenericMemory(16);
            DataMemory = new GenericMemory(16);
            PC = new ProgramCounter();
            Instructions = new InstructionMemory();
            IsReady = false;

            _clockCycle = 0;
            _isStalled = false;

            InstructionQueue = new Queue<Instruction>();
            AwaitingRegisters = new HashSet<int>();
            ForwardedRegisters = new Dictionary<int, int>();
        }
예제 #2
0
파일: CPU.cs 프로젝트: Gabrola/MipSim
        public CPU()
        {
            _registerFile = new GenericMemory(16);
            _dataMemory = new GenericMemory(16);
            _pc = new ProgramCounter();
            _instructions = new InstructionMemory();
            _stack = new ProcedureStack();

            IsReady = false;

            ClockCycle = 0;
            _instructionExecution = 0;
            _isStalled = false;

            _instructionQueue = new Queue<Instruction>();
            _awaitingRegisters = new HashSet<int>();
            _forwardedRegisters = new Dictionary<int, int>();
            ExecutionRecords = new List<ExecutionRecordList>();
            Predictor = new BTB();

            _registerFile.Write(0, 0);

            Instance = this;
        }