public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* [patch][rfa] Configure mappings and memory sizes in hex
@ 2006-09-14 19:39 Dave Brolley
  2006-09-15 18:15 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Brolley @ 2006-09-14 19:39 UTC (permalink / raw)
  To: sid

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

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


[-- Attachment #2: sid-conf-hex.ChangeLog --]
[-- Type: text/plain, Size: 167 bytes --]

2006-09-14  Dave Brolley  <brolley@redhat.com>

	* commonCfg.cxx (MemCfg::set_size): Use make_numeric_attribute and pass
	std::ios::hex.
	(MapperCfg::map): Likewise.


[-- Attachment #3: sid-conf-hex.patch.txt --]
[-- Type: text/plain, Size: 2754 bytes --]

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 += "]";
  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch][rfa] Configure mappings and memory sizes in hex
  2006-09-14 19:39 [patch][rfa] Configure mappings and memory sizes in hex Dave Brolley
@ 2006-09-15 18:15 ` Frank Ch. Eigler
  2006-09-19 18:47   ` Dave Brolley
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Ch. Eigler @ 2006-09-15 18:15 UTC (permalink / raw)
  To: Dave Brolley; +Cc: sid

Hi -

> I'm growing weary of seeing mappings and memory sizes in decimal in
> the config files generated by --save-temps. [...]

Yeah, might as well change that.

- FChE

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch][rfa] Configure mappings and memory sizes in hex
  2006-09-15 18:15 ` Frank Ch. Eigler
@ 2006-09-19 18:47   ` Dave Brolley
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Brolley @ 2006-09-19 18:47 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: sid

Frank Ch. Eigler wrote:
> Hi -
>
>   
>> I'm growing weary of seeing mappings and memory sizes in decimal in
>> the config files generated by --save-temps. [...]
>>     
>
> Yeah, might as well change that.
>
>   
Committed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-19 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-14 19:39 [patch][rfa] Configure mappings and memory sizes in hex Dave Brolley
2006-09-15 18:15 ` Frank Ch. Eigler
2006-09-19 18:47   ` 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).