示例#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;
        }