From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10304 invoked by alias); 10 May 2006 20:31:42 -0000 Received: (qmail 10293 invoked by uid 22791); 10 May 2006 20:31:42 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 May 2006 20:31:40 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4AKVcfx004772 for ; Wed, 10 May 2006 16:31:38 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4AKVc2j009843 for ; Wed, 10 May 2006 16:31:38 -0400 Received: from [172.16.14.227] (IDENT:xfXSU9/GdTbqBVPWn4nsWZHnXfGgokrk@topaz.toronto.redhat.com [172.16.14.227]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k4AKVcAc007287 for ; Wed, 10 May 2006 16:31:38 -0400 Message-ID: <44624DAA.3070000@redhat.com> Date: Wed, 10 May 2006 20:31:00 -0000 From: Dave Brolley User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) MIME-Version: 1.0 To: sid@sources.redhat.com Subject: [patch][commit] Add hw-cache-buffer-8 and hw-blocking-cache-buffer-8 Content-Type: multipart/mixed; boundary="------------020302010400030804020709" X-IsSubscribed: yes Mailing-List: contact sid-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sourceware.org X-SW-Source: 2006-q2/txt/msg00019.txt.bz2 This is a multi-part message in MIME format. --------------020302010400030804020709 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 238 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 --------------020302010400030804020709 Content-Type: text/plain; name="sid-cache.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sid-cache.ChangeLog" Content-length: 303 2006-05-10 Dave Brolley * 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. --------------020302010400030804020709 Content-Type: text/plain; name="sid-cache.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sid-cache.patch.txt" Content-length: 2874 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 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 parts = sidutil::tokenize (typeName, "-/"); unsigned extra_ix; --------------020302010400030804020709--