OSDN Git Service

* --trace-counter extensions
authorfche <fche>
Fri, 28 Dec 2001 21:16:48 +0000 (21:16 +0000)
committerfche <fche>
Fri, 28 Dec 2001 21:16:48 +0000 (21:16 +0000)
[bsp]
2001-12-27  Frank Ch. Eigler  <fche@redhat.com>

* configrun-sid.in: Make cpu<->sched pin connections for time queries.

[component/cgen-cpu]
2001-12-27  Frank Ch. Eigler  <fche@redhat.com>

* cgen-cpu.h (cgen_bi_endian_cpu): Make trace_count a host_int_8.
* compCGEN.cxx (cgen_read_memory): Don't distort memory latency

[include]
2001-12-27  Frank Ch. Eigler  <fche@redhat.com>

* sidcpuutil.h (basic_cpu): Add scheduler_time_query member.
Add flush_icache(PC) virtual function.

[bsp/pregen]
2001-12-27  Frank Ch. Eigler  <fche@redhat.com>

* ALL.conf: Regenerated with cpu/sched etc. changes.

24 files changed:
sid/bsp/ChangeLog
sid/bsp/configrun-sid.in
sid/bsp/pregen/ChangeLog
sid/bsp/pregen/arm-cma-tksm.conf
sid/bsp/pregen/arm-cma.conf
sid/bsp/pregen/arm-gloss-tksm.conf
sid/bsp/pregen/arm-gloss.conf
sid/bsp/pregen/arm-glossBE.conf
sid/bsp/pregen/arm-pid-redboot-tksm.conf
sid/bsp/pregen/arm-pid-redboot.conf
sid/bsp/pregen/arm-pid-tksm.conf
sid/bsp/pregen/arm-pid.conf
sid/bsp/pregen/arm-pidBE.conf
sid/bsp/pregen/i386-gdb.conf
sid/bsp/pregen/i386-gloss.conf
sid/bsp/pregen/xstormy16-gdb.conf
sid/bsp/pregen/xstormy16-gloss-gdb-tksm.conf
sid/bsp/pregen/xstormy16-gloss-gdb.conf
sid/bsp/pregen/xstormy16-gloss.conf
sid/component/cgen-cpu/ChangeLog
sid/component/cgen-cpu/cgen-cpu.h
sid/component/cgen-cpu/compCGEN.cxx
sid/include/ChangeLog
sid/include/sidcpuutil.h

index 9329f8f..f3d9b94 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-27  Frank Ch. Eigler  <fche@redhat.com>
+
+       * configrun-sid.in: Make cpu<->sched pin connections for time queries.
+
 2001-12-17  matthew green  <mrg@redhat.com>
 
        * Makefile.am (FAM10SCRIPTS): Add Xstormy16 support.
index 29bf108..4184302 100644 (file)
@@ -437,6 +437,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 ";
index 8bf0679..9bdf0bd 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-27  Frank Ch. Eigler  <fche@redhat.com>
+
+       * ALL.conf: Regenerated with cpu/sched etc. changes.
+
 2001-12-17  matthew green  <mrg@redhat.com>
 
        * pregen-configs.in: Add support for Xstormy16.
index 337a454..1205ec8 100644 (file)
@@ -68,6 +68,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 02e5ec6..28c7a5d 100644 (file)
@@ -63,6 +63,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index c03932b..2ac1b8c 100644 (file)
@@ -60,6 +60,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 5edd263..47463b5 100644 (file)
@@ -55,6 +55,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 849d4a0..c870a82 100644 (file)
@@ -55,6 +55,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 9fecba0..8754160 100644 (file)
@@ -66,6 +66,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 74f415c..c9745d0 100644 (file)
@@ -61,6 +61,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 444784d..d6a8bda 100644 (file)
@@ -68,6 +68,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 9c0f64b..e0d787e 100644 (file)
@@ -63,6 +63,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index f364e3b..bdc6774 100644 (file)
@@ -63,6 +63,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index d358c03..8af020d 100644 (file)
@@ -1,6 +1,6 @@
 # sid configuration file
-# created by Id: configrun-sid.in,v 1.99 2001/10/29 17:44:36 fche Exp 
-# run by fche @ tooth (Linux) at Mon Oct 29 13:01:40 EST 2001
+# created by Id: configrun-sid.in,v 1.33 2001/12/17 09:31:17 mrg Exp 
+# run by fche @ tooth (Linux) at Fri Dec 28 15:53:51 EST 2001
 # args: --cpu=x86 --no-run --gdb=5000
 load libaudio.la audio_component_library
 load libcache.la cache_component_library
@@ -55,6 +55,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 4420817..34b3928 100644 (file)
@@ -1,6 +1,6 @@
 # sid configuration file
-# created by Id: configrun-sid.in,v 1.99 2001/10/29 17:44:36 fche Exp 
-# run by fche @ tooth (Linux) at Mon Oct 29 13:01:39 EST 2001
+# created by Id: configrun-sid.in,v 1.33 2001/12/17 09:31:17 mrg Exp 
+# run by fche @ tooth (Linux) at Fri Dec 28 15:53:51 EST 2001
 # args: --cpu=x86 --no-run a.out
 load libaudio.la audio_component_library
 load libcache.la cache_component_library
@@ -55,6 +55,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index c501084..f9f3fe3 100644 (file)
@@ -1,6 +1,6 @@
 # sid configuration file
-# created by Id: configrun-sid.in,v 1.32 2001/12/04 22:40:52 fche Exp 
-# run by mrg @ crocodile-dances.eterna.com.au (SunOS) at Mon Dec 17 16:31:03 EST 2001
+# created by Id: configrun-sid.in,v 1.33 2001/12/17 09:31:17 mrg Exp 
+# run by fche @ tooth (Linux) at Fri Dec 28 15:53:51 EST 2001
 # args: --cpu=xstormy16 --no-run --gdb=5000
 load libaudio.la audio_component_library
 load libcache.la cache_component_library
@@ -55,6 +55,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 363fc47..802849d 100644 (file)
@@ -1,6 +1,6 @@
 # sid configuration file
-# created by Id: configrun-sid.in,v 1.32 2001/12/04 22:40:52 fche Exp 
-# run by mrg @ crocodile-dances.eterna.com.au (SunOS) at Mon Dec 17 16:31:04 EST 2001
+# created by Id: configrun-sid.in,v 1.33 2001/12/17 09:31:17 mrg Exp 
+# run by fche @ tooth (Linux) at Fri Dec 28 15:53:52 EST 2001
 # args: --cpu=xstormy16 --no-run --gdb=5000 --tksm
 load libaudio.la audio_component_library
 load libcache.la cache_component_library
@@ -60,6 +60,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index dcd406e..8d1fb0c 100644 (file)
@@ -1,6 +1,6 @@
 # sid configuration file
-# created by Id: configrun-sid.in,v 1.32 2001/12/04 22:40:52 fche Exp 
-# run by mrg @ crocodile-dances.eterna.com.au (SunOS) at Mon Dec 17 16:31:04 EST 2001
+# created by Id: configrun-sid.in,v 1.33 2001/12/17 09:31:17 mrg Exp 
+# run by fche @ tooth (Linux) at Fri Dec 28 15:53:51 EST 2001
 # args: --cpu=xstormy16 --no-run --gdb=5000 --board=gloss-tty
 load libaudio.la audio_component_library
 load libcache.la cache_component_library
@@ -60,6 +60,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index ff20176..f243171 100644 (file)
@@ -1,6 +1,6 @@
 # sid configuration file
-# created by Id: configrun-sid.in,v 1.32 2001/12/04 22:40:52 fche Exp 
-# run by mrg @ crocodile-dances.eterna.com.au (SunOS) at Mon Dec 17 16:31:03 EST 2001
+# created by Id: configrun-sid.in,v 1.33 2001/12/17 09:31:17 mrg Exp 
+# run by fche @ tooth (Linux) at Fri Dec 28 15:53:51 EST 2001
 # args: --cpu=xstormy16 --no-run a.out
 load libaudio.la audio_component_library
 load libcache.la cache_component_library
@@ -55,6 +55,9 @@ connect-pin init-sequence output-0 -> hw-reset-net input
 connect-pin hw-reset-net output-0 -> cpu reset!
 connect-pin target-sched 0-event -> cpu step!
 connect-pin target-sched 0-control <- cpu step-cycles
+connect-pin target-sched time-query <- cpu time-query
+connect-pin target-sched time-high -> cpu time-high
+connect-pin target-sched time-low -> cpu time-low
 connect-pin yield-net output-0 -> cpu yield
 connect-pin yield-net output-0 -> host-sched yield
 connect-bus cpu insn-memory cpu-mapper access-port
index 6a239e5..a47461e 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-27  Frank Ch. Eigler  <fche@redhat.com>
+
+       * cgen-cpu.h (cgen_bi_endian_cpu): Make trace_count a host_int_8.
+       * compCGEN.cxx (cgen_read_memory): Don't distort memory latency
+
 2001-12-18  Dave Brolley  <brolley@redhat.com>
 
        * cgen-ops.h (ROLHI): New macro.
index 8490cac..c2281f9 100644 (file)
@@ -80,7 +80,7 @@ protected:
   static int cgen_symbol_at_address(bfd_vma addr, struct disassemble_info * info);
   // Counter tracing support
   void trace_counter (PCADDR pc);
-  int trace_count;
+  host_int_8 trace_count;
 
 public:
   cgen_bi_endian_cpu ();
index d4421ee..27f6653 100644 (file)
@@ -176,6 +176,10 @@ cgen_bi_endian_cpu::cgen_read_memory(bfd_vma memaddr, bfd_byte *myaddr,
 {
   cgen_bi_endian_cpu *thisp = static_cast<cgen_bi_endian_cpu *>(info->application_data);
 
+  // We don't want to penalize the disassembler with memory latency counts, so we
+  // store it away here ...
+  host_int_8 prev_latency = thisp->total_latency;
+
   switch (length) {
 #if 0 // XXX not sure if this has byte order dependancies or not
   case 1:
@@ -195,6 +199,10 @@ cgen_bi_endian_cpu::cgen_read_memory(bfd_vma memaddr, bfd_byte *myaddr,
     for (int i = 0; i < length; i++)
       *(myaddr + i) = thisp->read_insn_memory_1(0, memaddr + i);
   }
+
+  // ... and restore it here.
+  thisp->total_latency = prev_latency;
+
   return 0;
 }
 
@@ -247,7 +255,12 @@ cgen_bi_endian_cpu::end_trace ()
 void
 cgen_bi_endian_cpu::trace_counter (PCADDR pc)
 {
-  this->trace_stream << this->trace_count++ << "\t";
+  this->trace_stream
+    << this->trace_count++ << ' ' 
+    << (this->sched_query.now()-1) << '\t';
+
+  // Invalidate any local icaches; they distort approximate cycle counting.
+  this->flush_icache (pc);
 }
 \f
 
index c0ad71d..31e78c6 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-27  Frank Ch. Eigler  <fche@redhat.com>
+
+       * sidcpuutil.h (basic_cpu): Add scheduler_time_query member.
+       Add flush_icache(PC) virtual function.
+
 2001-12-04  Ben Elliston  <bje@redhat.com>
 
        * sidbusutil.h (ro_value_control_register::operator=): Bug
index da7a5bb..411223f 100644 (file)
@@ -13,6 +13,7 @@
 #include <sidcomputil.h>
 #include <sidmiscutil.h>
 #include <sidwatchutil.h>
+#include <sidschedutil.h>
 
 using std::string;
 
@@ -127,6 +128,11 @@ namespace sidutil
   protected:
     recursion_limited step_limit;
 
+    // scheduler querying
+  protected:
+    friend class scheduler_time_query<basic_cpu>;
+    scheduler_time_query<basic_cpu> sched_query;
+
     // triggerpoint support
   protected:
     friend class self_watcher<basic_cpu>;
@@ -191,7 +197,7 @@ namespace sidutil
     }
 
     // step/yield control pins
-  private:
+  protected:
     callback_pin<basic_cpu> step_pin;
     callback_pin<basic_cpu> yield_pin;
     bool yield_p;
@@ -315,8 +321,10 @@ namespace sidutil
     // Flush internal abstract icache (if any)
   private:
     callback_pin<basic_cpu> flush_icache_pin;
-    virtual void flush_icache () = 0;
     void flush_icache_pin_handler(sid::host_int_4 v) { this->flush_icache(); }
+  protected:
+    virtual void flush_icache () = 0;
+    virtual void flush_icache (sid::host_int_4 pc) { this->flush_icache (); }
 
     // Set the initial PC after reset
   private:
@@ -460,6 +468,7 @@ public:
     basic_cpu ():
       total_latency (0),
       step_limit ("instruction stepping", 1),
+      sched_query (this),
       triggerpoint_manager (this),
       step_pin (this, & basic_cpu::step_pin_handler),
       yield_pin (this, & basic_cpu::yield_pin_handler),