public PhysicalRegisterFile(Core core, string namePostfix, uint capacity) { this.Core = core; this.Name = "c" + this.Core.Num + "." + namePostfix; this.Capacity = capacity; this.Entries = new List<PhysicalRegister> (); for (uint i = 0; i < this.Capacity; i++) { this.Entries.Add (new PhysicalRegister (this)); } }
public Processor(Simulation simulation) { this.Simulation = simulation; this.Cores = new List<ICore> (); this.CurrentCycle = 0; this.ActiveThreadCount = 0; for (uint i = 0; i < this.Simulation.Config.Architecture.Processor.Cores.Count; i++) { Core core = new Core (this, i); for (uint j = 0; j < this.Simulation.Config.Architecture.Processor.NumThreadsPerCore; j++) { ContextConfig context = this.Simulation.Config.Contexts[(int)(i * this.Simulation.Config.Architecture.Processor.NumThreadsPerCore + j)]; List<string> args = new List<string> (); args.Add (context.Workload.Cwd + Path.DirectorySeparatorChar + context.Workload.Exe + ".mipsel"); args.AddRange (context.Workload.Args.Split (' ')); Process process = new Process (context.Workload.Cwd, args); uint threadNum = i * this.Simulation.Config.Architecture.Processor.NumThreadsPerCore + j; ContextStat contextStat = this.Simulation.Stat.Processor.Contexts[(int)threadNum]; Thread thread = new Thread (core, contextStat, j, process); core.Threads.Add (thread); this.ActiveThreadCount++; } this.Cores.Add (core); } this.MemorySystem = new MemorySystem (this); }
public FunctionalUnitPool(Core core) { this.Core = core; this.Name = "c" + this.Core.Num + ".fuPool"; this.Entities = new Dictionary<FunctionalUnit.Types, List<FunctionalUnit>> (); this.Add (FunctionalUnit.Types.IntALU, 4, 1, 1); this.Add (FunctionalUnit.Types.IntMultiply, 1, 3, 1); this.Add (FunctionalUnit.Types.IntDivide, 1, 20, 19); this.Add (FunctionalUnit.Types.ReadPort, 2, 1, 1); this.Add (FunctionalUnit.Types.WritePort, 2, 1, 1); this.Add (FunctionalUnit.Types.FloatAdd, 4, 2, 1); this.Add (FunctionalUnit.Types.FloatCompare, 4, 2, 1); this.Add (FunctionalUnit.Types.FloatConvert, 4, 2, 1); this.Add (FunctionalUnit.Types.FloatMultiply, 1, 4, 1); this.Add (FunctionalUnit.Types.FloatDivide, 1, 12, 12); this.Add (FunctionalUnit.Types.FloatSquareRoot, 1, 24, 24); this.EventQueue = new ActionEventQueue (); this.Core.EventProcessors.Add (this.EventQueue); }