OSDN Git Service

2002-04-09 Ben Elliston <bje@redhat.com>
authorbje <bje>
Tue, 9 Apr 2002 15:03:06 +0000 (15:03 +0000)
committerbje <bje>
Tue, 9 Apr 2002 15:03:06 +0000 (15:03 +0000)
* cache.cxx (cache_component::read_line): Set the overall latency
for a cache line fill to the latency of the first downstream read,
not the last.

sid/component/cache/ChangeLog
sid/component/cache/cache.cxx

index 5c06fa3..a8ddb3d 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-09  Ben Elliston  <bje@redhat.com>
+
+       * cache.cxx (cache_component::read_line): Set the overall latency
+       for a cache line fill to the latency of the first downstream read,
+       not the last.
+
 2001-12-27  Frank Ch. Eigler  <fche@redhat.com>
 
        * cache.cxx (CacheListTypes, CacheCreate): Support hw-cache-buffer-8
index fa5bf4d..e34c0aa 100644 (file)
@@ -316,11 +316,15 @@ bus::status
 cache_component::read_line (cache_line& line)
 {
   bus::status st;
+  int overall_latency = 0;
   host_int_4 base = acache.tag_to_addr (line.tag ());
   for (host_int_4 offset = 0; offset < line_size; offset += 4)
     {
       sid::big_int_4 data;
       st = downstream->read (base + offset, data);
+      // Latency for line fills is the latency of the first read
+      if (offset == 0)
+       overall_latency = st.latency;
       if (st != bus::ok)
        return st;
       line.insert (offset, data);
@@ -328,6 +332,7 @@ cache_component::read_line (cache_line& line)
   line.unlock ();
   line.clean ();
   line.validate ();
+  st.latency = overall_latency;
   return st;
 }