Exemplo n.º 1
0
        public void CopyFrom(MappingTable tbl)
        {
            if (this.Map.Length != tbl.Map.Length)
            {
                throw new ArgumentOutOfRangeException("Mapping tables are different size.");
            }

            for (int i = 0; i < Map.Length; i++)
            {
                this.Map[i] = tbl.Map[i];
            }
        }
Exemplo n.º 2
0
 public CPU(UInt16[] instr)
 {
     FE_DE.Instructions   = new Queue <IData>();
     DE_RN.Ops            = new Queue <DecodedOp>();
     this.PhysFreeList    = new FreeList(PHYSICAL_REGISTER_COUNT);
     this.PhysRegisters   = new RegisterFile(PHYSICAL_REGISTER_COUNT);
     this.ArchRegisters   = new RegisterFile(ARCHITECTURE_REGISTER_COUNT);
     this.ArchToPhysTable = new MappingTable(ARCHITECTURE_REGISTER_COUNT, this.PhysFreeList);
     this.CommitRAT       = new MappingTable(ARCHITECTURE_REGISTER_COUNT);
     this.CommitRAT.CopyFrom(this.ArchToPhysTable);
     this.InstructionList = instr;
     this.FUs             = new List <FunctionalUnit>();
     this.IQueue          = new IssueQueue(ISSUE_QUEUE_SIZE);
     this.ROB             = new ReOrderBuffer(REORDER_BUFFER_SIZE);
     this.FUs.Add(new ArithmeticLogicUnit(this));
     this.FUs.Add(new ArithmeticLogicUnit(this));
     this.FUs.Add(new ArithmeticLogicUnit(this));
     this.FUs.Add(new ArithmeticLogicUnit(this));
     this.FUs.Add(new BranchUnit(this));
     this.FUs.Add(new LoadStoreUnit(this));
 }