Ejemplo n.º 1
0
        public Cache(ICycleProvider cycleProvider, CacheGeometry geometry)
        {
            this.CycleProvider = cycleProvider;
            this.Geometry = geometry;

            this.Sets = new List<CacheSet> ();
            for (uint i = 0; i < this.NumSets; i++) {
                this.Sets.Add (new CacheSet (this, this.Associativity, i));
            }

            this.Directory = new Directory (this.NumSets, this.Associativity);
        }
Ejemplo n.º 2
0
 public CacheConfig(string name, CacheGeometry geometry, uint hitLatency, CacheReplacementPolicy policy)
 {
     this.Name = name;
     this.Geometry = geometry;
     this.HitLatency = hitLatency;
     this.Policy = policy;
 }
Ejemplo n.º 3
0
 public TlbConfig(CacheGeometry geometry, uint hitLatency, uint missLatency)
 {
     this.Geometry = geometry;
     this.HitLatency = hitLatency;
     this.MissLatency = missLatency;
 }
Ejemplo n.º 4
0
 public static bool IsAligned(this uint addr, CacheGeometry cacheGeometry)
 {
     return addr.GetDisplacement (cacheGeometry) == 0;
 }
Ejemplo n.º 5
0
 public static uint GetTag(this uint addr, CacheGeometry cacheGeometry)
 {
     return addr & ~(cacheGeometry.LineMask);
 }
Ejemplo n.º 6
0
 public static uint GetIndex(this uint addr, CacheGeometry cacheGeometry)
 {
     return (addr >> (int)cacheGeometry.LineSizeInLog2) % cacheGeometry.NumSets;
 }
Ejemplo n.º 7
0
 public static uint GetDisplacement(this uint addr, CacheGeometry cacheGeometry)
 {
     return addr & (cacheGeometry.LineMask);
 }
Ejemplo n.º 8
0
 static MemoryConstants()
 {
     MemoryGeometry = new CacheGeometry (1 << 22, 1, 1 << 12);
 }