(cache_component::invalidate_set): Likewise.
* hw-cache.xml: Update documentation.
+2002-06-04 Graydon Hoare <graydon@redhat.com>
+
+ * cache.h (cache_component::set_refill_latency): New method.
+ (cache_component::get_refill_latency): New method.
+ (cache_component::refill_latency_specified): New flag.
+ (cache_component): Virtualize "refill-latency" attribute,
+ note when it is set in "refill_latency_specified".
+ * cache.cxx (read_line): Return either refill latency or
+ downstream latencies, depending on whether explicit refill
+ latency has been specified, not sum of both.
+
2002-05-17 Ben Elliston <bje@redhat.com>
* Makefile.am (DEJAGNUTESTS): Add refill.exp.
assoc (assocy),
hit_latency (0),
miss_latency (0),
- refill_latency (0)
+ refill_latency (0),
+ refill_latency_specified (false)
{
memset (&stats, 0, sizeof (stats));
add_attribute ("hit-latency", &hit_latency, "setting");
add_attribute ("miss-latency", &miss_latency, "setting");
- add_attribute ("refill-latency", &refill_latency, "setting");
+
+ add_attribute_virtual ("refill-latency", this,
+ &cache_component::get_refill_latency,
+ &cache_component::set_refill_latency,
+ "setting");
// FIXME: state save/restore
}
+
+
// dummy dtor
cache_component::~cache_component () throw ()
{
line.unlock ();
line.clean ();
line.validate ();
- st.latency = refill_latency + overall_latency;
+
+ if (refill_latency_specified)
+ st.latency = refill_latency;
+ else
+ st.latency = overall_latency;
+
return st;
}
return sid::component::ok;
}
+string
+cache_component::get_refill_latency ()
+{
+ return make_attribute (refill_latency);
+}
+
+sid::component::status
+cache_component::set_refill_latency (const string& value)
+{
+ if (parse_attribute (value, refill_latency) != sid::component::ok)
+ return sid::component::bad_value;
+ refill_latency_specified = true;
+ return sid::component::ok;
+}
+
sid::component::status
cache_component::dump (const string& ignore)
{
status set_hash_mask (const string& ignore);
string get_hash_shift ();
status set_hash_shift (const string& ignore);
+ string get_refill_latency ();
+ status set_refill_latency (const string& ignore);
unsigned line_offset (const cache_line& line, const host_int_4& addr);
host_int_2 hit_latency;
host_int_2 miss_latency;
host_int_2 refill_latency;
+ bool refill_latency_specified;
};
template <typename DataType>