From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19388 invoked by alias); 14 Sep 2006 19:39:24 -0000 Received: (qmail 19379 invoked by uid 22791); 14 Sep 2006 19:39:23 -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; Thu, 14 Sep 2006 19:39:19 +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 k8EJdHav006353 for ; Thu, 14 Sep 2006 15:39:17 -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 k8EJdH0K006058 for ; Thu, 14 Sep 2006 15:39:17 -0400 Received: from [172.16.14.227] (topaz.toronto.redhat.com [172.16.14.227]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id k8EJdHm9018717 for ; Thu, 14 Sep 2006 15:39:17 -0400 Message-ID: <4509AFE4.1050802@redhat.com> Date: Thu, 14 Sep 2006 19:39:00 -0000 From: Dave Brolley User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: sid@sources.redhat.com Subject: [patch][rfa] Configure mappings and memory sizes in hex Content-Type: multipart/mixed; boundary="------------060002090701020309010605" 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-q3/txt/msg00041.txt.bz2 This is a multi-part message in MIME format. --------------060002090701020309010605 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 477 Hi, I'm growing weary of seeing mappings and memory sizes in decimal in the config files generated by --save-temps. Does anyone have a problem with this patch which makes them appear in hex? The difference is something like connect-bus basic-0/main-map [0=0-32767] basic-0/extra-mem-0 read-write-port set basic-0/extra-mem-0 size 32768 becomes connect-bus basic-0/main-map [0x0=0x0-0xffff] basic-0/extra-mem-0 read-write-port set basic-0/extra-mem-0 size 0x10000 Dave --------------060002090701020309010605 Content-Type: text/plain; name="sid-conf-hex.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sid-conf-hex.ChangeLog" Content-length: 167 2006-09-14 Dave Brolley * commonCfg.cxx (MemCfg::set_size): Use make_numeric_attribute and pass std::ios::hex. (MapperCfg::map): Likewise. --------------060002090701020309010605 Content-Type: text/plain; name="sid-conf-hex.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sid-conf-hex.patch.txt" Content-length: 2754 Index: sid/main/dynamic/commonCfg.cxx =================================================================== RCS file: /cvs/src/src/sid/main/dynamic/commonCfg.cxx,v retrieving revision 1.16 diff -c -p -r1.16 commonCfg.cxx *** sid/main/dynamic/commonCfg.cxx 14 Jul 2006 19:45:51 -0000 1.16 --- sid/main/dynamic/commonCfg.cxx 14 Sep 2006 19:27:03 -0000 *************** void MemCfg::set_write_latency (sid::hos *** 86,92 **** void MemCfg::set_size (sid::host_int_4 sz) { my_size = sz; ! set (this, "size", sidutil::make_attribute(sz)); } sid::host_int_4 MemCfg::size() --- 86,92 ---- void MemCfg::set_size (sid::host_int_4 sz) { my_size = sz; ! set (this, "size", "0x" + sidutil::make_numeric_attribute(sz, std::ios::hex)); } sid::host_int_4 MemCfg::size() *************** void MapperCfg::map (const Mapping &m) *** 506,531 **** string map_accessor = "["; if (m._wordsz.specified) ! map_accessor += sidutil::make_attribute(m._wordsz.val) + "*"; if (m._base.specified) ! map_accessor += sidutil::make_attribute(m._base.val) + "="; // always include a low and a high. default to 0 if not specified. // FIXME: perhaps issuing a warning here would be better? ! map_accessor += ! sidutil::make_attribute(m._low.specified ? ! m._low.val : 0) ! + "-" ! + sidutil::make_attribute(m._high.specified ? ! m._high.val : 0); // Both stride and width must be specified for either to make sense. if (m._stride.specified && m._width.specified) ! map_accessor += "," ! + sidutil::make_attribute(m._stride.val) ! + "," ! + sidutil::make_attribute(m._width.val); map_accessor += "]"; --- 506,531 ---- string map_accessor = "["; if (m._wordsz.specified) ! map_accessor += "0x" + sidutil::make_numeric_attribute(m._wordsz.val, std::ios::hex) + "*"; if (m._base.specified) ! map_accessor += "0x" + sidutil::make_numeric_attribute(m._base.val, std::ios::hex) + "="; // always include a low and a high. default to 0 if not specified. // FIXME: perhaps issuing a warning here would be better? ! map_accessor += "0x" + ! sidutil::make_numeric_attribute(m._low.specified ? ! m._low.val : 0, std::ios::hex) ! + "-0x" ! + sidutil::make_numeric_attribute(m._high.specified ? ! m._high.val : 0, std::ios::hex); // Both stride and width must be specified for either to make sense. if (m._stride.specified && m._width.specified) ! map_accessor += ",0x" ! + sidutil::make_numeric_attribute(m._stride.val, std::ios::hex) ! + ",0x" ! + sidutil::make_numeric_attribute(m._width.val, std::ios::hex); map_accessor += "]"; --------------060002090701020309010605--