* [patch][commit] Add hw-cache-buffer-8 and hw-blocking-cache-buffer-8
@ 2006-05-10 20:31 Dave Brolley
0 siblings, 0 replies; only message in thread
From: Dave Brolley @ 2006-05-10 20:31 UTC (permalink / raw)
To: sid
[-- Attachment #1: Type: text/plain, Size: 238 bytes --]
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
[-- Attachment #2: sid-cache.ChangeLog --]
[-- Type: text/plain, Size: 303 bytes --]
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.
[-- Attachment #3: sid-cache.patch.txt --]
[-- Type: text/plain, Size: 2874 bytes --]
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-10 20:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-10 20:31 [patch][commit] Add hw-cache-buffer-8 and hw-blocking-cache-buffer-8 Dave Brolley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).