OSDN Git Service

2006-08-29 Dave Brolley <brolley@redhat.com>
authorbrolley <brolley>
Tue, 29 Aug 2006 20:34:00 +0000 (20:34 +0000)
committerbrolley <brolley>
Tue, 29 Aug 2006 20:34:00 +0000 (20:34 +0000)
        * glue.cxx (base_address): New member of bus_prober.
        (bus_prober): Initialize base_address.
        (writeAny): Add this->prober->base_address to the address driven.
        (readAny): Likewise.
        * hw-glue-probe-bus.xml: Document new base-address attribute.
        * *.txt: Regenerated.

sid/component/glue/glue.cxx
sid/component/glue/hw-glue-probe-bus.txt
sid/component/glue/hw-glue-probe-bus.xml

index dc25e89..e8b1205 100644 (file)
@@ -469,12 +469,13 @@ probing_bus::writeAny(host_int_4 addr, DataType data, host_int_4 code) throw ()
       this->counter ++;
       if (this->counter >= this->prober->sample_interval)
        {
+         addr += this->prober->base_address;
          if (this->verbose_p)
            this->traceAccess (addr, data, code, s);
 
          this->counter = 0;
          // drive informational pins
-         this->prober->address_pin.drive (this->prober->base_address + addr);
+         this->prober->address_pin.drive (addr);
          typename DataType::host_int_type d_host = data; // natural endianness
          host_int_8 d_wide(d_host); // widen
          this->prober->data_high_pin.drive ((d_wide >> 32) & 0xFFFFFFFF);
@@ -505,12 +506,13 @@ probing_bus::readAny(host_int_4 addr, DataType& data, host_int_4 code) throw ()
       this->counter ++;
       if (this->counter >= this->prober->sample_interval)
        {
+         addr += this->prober->base_address;
          if (this->verbose_p)
            this->traceAccess (addr, data, code, s);
 
          this->counter = 0;
          // drive informational pins
-         this->prober->address_pin.drive (this->prober->base_address + addr);
+         this->prober->address_pin.drive (addr);
          typename DataType::host_int_type d_host = data; // natural endianness
          host_int_8 d_wide(d_host); // widen
          this->prober->data_high_pin.drive ((d_wide >> 32) & 0xFFFFFFFF);
index 4ad0ec0..f6911bd 100644 (file)
@@ -106,6 +106,25 @@ Environment:
    A statistics-gathering component could attach to the sampling output pins
    to maintain a picture of a program's memory access patterns.
 
+   The base-address attribute should only be used if the downstream component
+   has a fixed address within the system. The base-address attribute is not
+   suitable for situations in which more than one address range is mapped
+   onto the upstream bus.
+
+   Consider the example below in which a single hw-glue-probe-bus is used to
+   trace two address ranges.
+
+         new hw-glue-probe-bus bus-prober
+         new SOME_KIND_OF_CPU cpu
+         new SOME_KIND_OF_TRANSPARENT_MAPPER probe-mapper
+         new SOME_KIND_OF_MAPPER mapper
+         connect-bus cpu insn-memory probe-mapper access-port
+         connect-bus probe-mapper [0-1023] bus-prober upstream
+         connect-bus probe-mapper [1024-2047] mapper access-port
+         connect-bus probe-mapper [2048-3071] bus-prober upstream
+         connect-bus bus-prober downstream mapper access-port
+         set bus-prober trace? 1
+
      ----------------------------------------------------------------------
 
 Component Reference:
@@ -153,7 +172,8 @@ Component Reference:
    |      name      |category| legal |default|     behaviors     ||
    |                |        |values | value |                   ||
    |----------------+--------+-------+-------+-------------------||
-   |base-address    |setting |numeric|0      |bus traffic tracing||
+   |base-address    |setting |numeric|0      |bus traffic        ||
+   |                |        |       |       |sampling           ||
    |----------------+--------+-------+-------+-------------------||
    |trace?          |setting |boolean|0      |bus traffic tracing||
    |----------------+--------+-------+-------+-------------------||
index 64812ea..a85e3bb 100644 (file)
@@ -18,7 +18,7 @@
     <defpin name="type" direction="out" legalvalues="enum values" behaviors="bus traffic sampling" />
 
     <!-- attributes -->
-    <defattribute name="base-address" category="setting" legalvalues="numeric" defaultvalue="0" behaviors="bus traffic tracing" />
+    <defattribute name="base-address" category="setting" legalvalues="numeric" defaultvalue="0" behaviors="bus traffic sampling" />
     <defattribute name="trace?" category="setting" legalvalues="boolean" defaultvalue="0" behaviors="bus traffic tracing" />
     <defattribute name="sample-interval" category="setting" legalvalues="numeric" defaultvalue="1" behaviors="bus traffic sampling" />
     <defattribute name="interval-counter" category="register" legalvalues="numeric" behaviors="bus traffic sampling" />
@@ -55,7 +55,8 @@
          pins.  In sequence, the following output pins are driven:</p>
        <ul>
          <li>
-           <name>address</name> - address parameter added to the value of the <attribute>base-address</attribute> attribute</li>
+           <name>address</name> - address parameter added to the value of the
+            <attribute>base-address</attribute> attribute</li>
          <li>
            <name>data-high</name> - top 32 bits of bus data being read/written</li>
          <li>
        <p>
          A statistics-gathering component could attach to the sampling output
          pins to maintain a picture of a program's memory access patterns.</p>
+
+        <p>
+          The <attribute>base-address</attribute> attribute should only be used if
+          the downstream component has a fixed address within the system. The
+          <attribute>base-address</attribute> attribute is not suitable for situations in
+          which more than one address range is mapped onto the <bus>upstream</bus> bus.</p>
+        <p>
+          Consider the example below in which a single hw-glue-probe-bus is used to trace
+          two address ranges.</p>
+
+       <code>  new hw-glue-probe-bus bus-prober
+       new SOME_KIND_OF_CPU cpu
+        new SOME_KIND_OF_TRANSPARENT_MAPPER probe-mapper
+        new SOME_KIND_OF_MAPPER mapper
+        connect-bus cpu insn-memory probe-mapper access-port
+        connect-bus probe-mapper [0-1023] bus-prober upstream
+        connect-bus probe-mapper [1024-2047] mapper access-port
+        connect-bus probe-mapper [2048-3071] bus-prober upstream
+        connect-bus bus-prober downstream mapper access-port
+        set bus-prober trace? 1</code>
+       
       </p>
     </p>
   </env>