This is the mail archive of the
sid@sourceware.org
mailing list for the SID project.
[patch][commit] Add hw-cache-buffer-8 and hw-blocking-cache-buffer-8
- From: Dave Brolley <brolley at redhat dot com>
- To: sid at sources dot redhat dot com
- Date: Wed, 10 May 2006 16:31:38 -0400
- Subject: [patch][commit] Add hw-cache-buffer-8 and hw-blocking-cache-buffer-8
Hi,
I've committed the attached patch which adds the hardware types
hw-cache-buffer-8 and hw-blocking-cache-buffer-8. The patch adds a table
of allowable lengths for these caches, so future expansion need only
update the table.
Dave
2006-05-10 Dave Brolley <brolley@redhat.com>
* cache.cxx (buffer_sizes): New static table.
(CacheListTypes): List hw-cache-buffer-* using buffer_sizes. Same for
hw-blocking-cache-buffer-*.
(CacheCreate): Parse hw-cache-buffer-N and hw-blocking-cache-buffer-N
in order to determine buffer size.
Index: sid/component/cache/cache.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/cache/cache.cxx,v
retrieving revision 1.21
diff -c -p -r1.21 cache.cxx
*** sid/component/cache/cache.cxx 1 Mar 2006 21:07:00 -0000 1.21
--- sid/component/cache/cache.cxx 10 May 2006 20:23:23 -0000
*************** using std::endl;
*** 26,31 ****
--- 26,34 ----
#include "cache.h"
+ static string buffer_sizes[] =
+ { "4", "8" };
+
static string line_sizes[] =
{ "16", "32", "64", "128" };
*************** CacheListTypes ()
*** 1054,1061 ****
types.push_back ("hw-cache-basic");
types.push_back ("hw-blocking-cache-basic");
! types.push_back ("hw-cache-buffer-8");
! types.push_back ("hw-blocking-cache-buffer-8");
for (unsigned i = 0; i < (sizeof (assocs) / sizeof (string)); i++)
for (unsigned j = 0; j < (sizeof (cache_sizes) / sizeof (string)); j++)
--- 1057,1068 ----
types.push_back ("hw-cache-basic");
types.push_back ("hw-blocking-cache-basic");
!
! for (unsigned i = 0; i < (sizeof (buffer_sizes) / sizeof (string)); i++)
! {
! types.push_back ("hw-cache-buffer-" + buffer_sizes[i]);
! types.push_back ("hw-blocking-cache-buffer-" + buffer_sizes[i]);
! }
for (unsigned i = 0; i < (sizeof (assocs) / sizeof (string)); i++)
for (unsigned j = 0; j < (sizeof (cache_sizes) / sizeof (string)); j++)
*************** CacheCreate (const string& typeName)
*** 1095,1106 ****
if (typeName == "hw-blocking-cache-basic")
return new blocking_cache_component (1, 16384, 32, null_replacement, internal_line_factory);
! if (typeName == "hw-cache-buffer-8")
! return new cache_component (0, 8, 8, null_replacement, internal_line_factory);
- if (typeName == "hw-blocking-cache-buffer-8")
- return new blocking_cache_component (0, 8, 8, null_replacement, internal_line_factory);
-
vector<string> parts = sidutil::tokenize (typeName, "-/");
unsigned extra_ix;
--- 1102,1123 ----
if (typeName == "hw-blocking-cache-basic")
return new blocking_cache_component (1, 16384, 32, null_replacement, internal_line_factory);
! if (typeName.substr (0, 16) == "hw-cache-buffer-")
! {
! unsigned size;
! if (parse_attribute (typeName.substr (16), size) != sid::component::ok)
! return 0;
! return new cache_component (0, size, size, null_replacement, internal_line_factory);
! }
!
! if (typeName.substr (0, 25) == "hw-blocking-cache-buffer-")
! {
! unsigned size;
! if (parse_attribute (typeName.substr (25), size) != sid::component::ok)
! return 0;
! return new blocking_cache_component (0, size, size, null_replacement, internal_line_factory);
! }
vector<string> parts = sidutil::tokenize (typeName, "-/");
unsigned extra_ix;