This is the mail archive of the sid@sourceware.org mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch][commit] SID configuration


I've committed the attached patch which does two things:

1) Adds configuration support for hw-cache-buffer-N (previously committed)
2) Adds configuration to force --insn-count=1 when --trace-counter is supplied on the command line.


Dave

2006-05-11  Dave Brolley  <brolley@redhat.com>

	* commonCfg.cxx (CacheCfg::CacheCfg (const string name)): Now takes
	a second argument for the size of the buffer. Initialize my_size using
	the size provided. Call compute_comptype.
	(compute_comptype): Use my_size to complete "hw_cache_buffer-".
	(BoardCfg): Initalize step_insn_count. Initialize
	step_insn_count_1_required.
	(BoardCfg::write_load): Set the cpu's step-insn-count based on
	step_insn_count_1_required.
	(set_step_insn_count): Just set step_insn_count here.
	(trace_counter): Set step_insn_count_1_required.
	* commonCfg.h (CacheCfg::CacheCfg (const string name)): Now takes
	a second argument for the size of the buffer.
	(step_insn_count): New member of BoardCfg.
	(step_insn_count_1_required): New member of BoardCfg.

Index: sid/main/dynamic/commonCfg.cxx
===================================================================
RCS file: /cvs/src/src/sid/main/dynamic/commonCfg.cxx,v
retrieving revision 1.11
diff -c -p -r1.11 commonCfg.cxx
*** sid/main/dynamic/commonCfg.cxx	23 Aug 2005 21:09:48 -0000	1.11
--- sid/main/dynamic/commonCfg.cxx	11 May 2006 20:17:44 -0000
*************** sid::host_int_4 MemCfg::write_latency()
*** 108,124 ****
  
  // CacheCfg
  CacheCfg::~CacheCfg () {}
! CacheCfg::CacheCfg (const string name) : 
    ComponentCfg (name),
    AtomicCfg (name, 
  	     "libcache.la", 
  	     "cache_component_library",
! 	     "hw-cache-buffer-8"),
    my_assoc (""),
!   my_size (8),
    my_line_size (0),
    my_replace ("")
! {}
  
  // direct caches
  CacheCfg::CacheCfg (const string name, 
--- 108,126 ----
  
  // CacheCfg
  CacheCfg::~CacheCfg () {}
! CacheCfg::CacheCfg (const string name, sid::host_int_4 size) : 
    ComponentCfg (name),
    AtomicCfg (name, 
  	     "libcache.la", 
  	     "cache_component_library",
! 	     ""),
    my_assoc (""),
!   my_size (size),
    my_line_size (0),
    my_replace ("")
! {
!   compute_comptype ();
! }
  
  // direct caches
  CacheCfg::CacheCfg (const string name, 
*************** void CacheCfg::compute_comptype ()
*** 161,167 ****
  {
    if (my_assoc == "")
      {
!       my_comptype = "hw-cache-buffer-8";
      }
    else
      {
--- 163,169 ----
  {
    if (my_assoc == "")
      {
!       my_comptype = "hw-cache-buffer-" + sidutil::make_attribute (my_size);
      }
    else
      {
*************** BoardCfg::BoardCfg (const string name, 
*** 1168,1178 ****
    core_probe (0),
    dynamic_configurator (NULL),
    start_config (""),
!   warmup_funcs ("_Sid_config")
  {
    assert (sess);
    cpu = new CpuCfg ("cpu", default_cpu_variant, sess);
-   set_step_insn_count ("10000");
    set_engine ("pbb");
    main_mapper = new MapperCfg ("main-map");
    assert (main_mapper);
--- 1170,1181 ----
    core_probe (0),
    dynamic_configurator (NULL),
    start_config (""),
!   warmup_funcs ("_Sid_config"),
!   step_insn_count ("10000"),
!   step_insn_count_1_required_p (false)
  {
    assert (sess);
    cpu = new CpuCfg ("cpu", default_cpu_variant, sess);
    set_engine ("pbb");
    main_mapper = new MapperCfg ("main-map");
    assert (main_mapper);
*************** void BoardCfg::write_load (Writer &w)
*** 1266,1271 ****
--- 1269,1276 ----
      if (sess->verbose)
        set (loader, "verbose?", "true");
  
+   set (cpu, "step-insn-count", step_insn_count_1_required_p ? "1" : step_insn_count);
+ 
    AggregateCfg::write_load (w);
  }
  
*************** void BoardCfg::set_engine (const string 
*** 1388,1394 ****
  void BoardCfg::set_step_insn_count (const string count)
  {
    assert (cpu);
!   cpu->set (cpu, "step-insn-count", count);
  }
  
  void BoardCfg::set_endian (const string endian)
--- 1393,1399 ----
  void BoardCfg::set_step_insn_count (const string count)
  {
    assert (cpu);
!   step_insn_count = count;
  }
  
  void BoardCfg::set_endian (const string endian)
*************** void BoardCfg::trace_counter ()
*** 1455,1460 ****
--- 1460,1466 ----
  {
    assert (cpu);
    cpu->set (cpu, "trace-counter?", "true");
+   step_insn_count_1_required_p = true;
  }
  
  void BoardCfg::trace_disassemble ()
Index: sid/main/dynamic/commonCfg.h
===================================================================
RCS file: /cvs/src/src/sid/main/dynamic/commonCfg.h,v
retrieving revision 1.9
diff -c -p -r1.9 commonCfg.h
*** sid/main/dynamic/commonCfg.h	23 Aug 2005 21:09:48 -0000	1.9
--- sid/main/dynamic/commonCfg.h	11 May 2006 20:17:44 -0000
*************** class CacheCfg :
*** 37,44 ****
    virtual public AtomicCfg
  {
  public:
!   // 8-byte buffers
!   CacheCfg (const string name);
    // direct caches
    CacheCfg (const string name, 
  	    const sid::host_int_4 size, 
--- 37,44 ----
    virtual public AtomicCfg
  {
  public:
!   // n-byte buffers
!   CacheCfg (const string name, sid::host_int_4 size = 8);
    // direct caches
    CacheCfg (const string name, 
  	    const sid::host_int_4 size, 
*************** public:
*** 408,413 ****
--- 408,415 ----
    string start_config;
    string warmup_funcs;
    string profile_funcs;
+   string step_insn_count;
+   bool step_insn_count_1_required_p;
  };
  
  #endif // __commonCfg_h__

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]