OSDN Git Service

2003-10-07 Dave Brolley <brolley@redhat.com>
authorbrolley <brolley>
Tue, 21 Oct 2003 21:36:29 +0000 (21:36 +0000)
committerbrolley <brolley>
Tue, 21 Oct 2003 21:36:29 +0000 (21:36 +0000)
        For Graydon Hoare  <graydon@redhat.com>
        * sid-visual-sched.tk (toggle_subscription): Do not alter the
        enabled? flag of the scheduler when updating subscriptions.
        (set_sub): Alter the subscription in an order that respects
        whether time is zero or not.

sid/component/sched/ChangeLog
sid/component/sched/sid-sched.txt
sid/component/sched/sid-sched.xml
sid/component/sched/sid-visual-sched.tk

index 622ac6e..1855605 100644 (file)
@@ -1,3 +1,11 @@
+2003-10-07  Dave Brolley  <brolley@redhat.com>
+
+       For Graydon Hoare  <graydon@redhat.com>
+       * sid-visual-sched.tk (toggle_subscription): Do not alter the
+       enabled? flag of the scheduler when updating subscriptions.
+       (set_sub): Alter the subscription in an order that respects
+       whether time is zero or not.
+
 2003-08-29  Dave Brolley  <brolley@redhat.com>
 
        * compSched.cxx (operator <<): Stream active_pin.
index 0761897..d637724 100644 (file)
@@ -138,9 +138,10 @@ Functionality:
    |     advancing | When you have disabled the      |
    |               | scheduler by setting the        |
    |               | enabled? attribute to a value   |
-   |               | less than enable-threshold,     |
-   |               | advancing as described below,   |
-   |               | does not occur.                 |
+   |               | less than the enable-threshold  |
+   |               | attribute, advancing as         |
+   |               | described below, does not       |
+   |               | occur.                          |
    |               |                                 |
    |               | Whenever the advance input pin  |
    |               | is driven, the scheduler may    |
@@ -249,74 +250,72 @@ Component Reference:
 
   Component: sid-sched (Abstract)
 
-   +-------------------------------------------------+
-   |                      pins                       |
-   |-------------------------------------------------|
-   |   name   |direction|  legalvalues  | behaviors  |
-   |----------+---------+---------------+------------|
-   |advance   |in       |any            |advancing   |
-   |----------+---------+---------------+------------|
-   |yield     |in       |any            |advancing   |
-   |----------+---------+---------------+------------|
-   |active    |out      |boolean        |advancing   |
-   |----------+---------+---------------+------------|
-   |N-event   |out      |no value       |advancing   |
-   |----------+---------+---------------+------------|
-   |N-control |in       |coded value    |subscription|
-   |----------+---------+---------------+------------|
-   |time-query|in       |any            |timing      |
-   |----------+---------+---------------+------------|
-   |          |         |high order 32  |            |
-   |time-high |out      |bits of 64-bit |timing      |
-   |          |         |value          |            |
-   |----------+---------+---------------+------------|
-   |          |         |low order 32   |            |
-   |time-low  |out      |bits of 64-bit |timing      |
-   |          |         |value          |            |
-   +-------------------------------------------------+
-
-   +---------------------------------------------------------------------------+
-   |                                attributes                                 |
-   |---------------------------------------------------------------------------|
-   |          name           |category| legal  | default value  |  behaviors  ||
-   |                         |        | values |                |             ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |state-snapshot           |no      |opaque  |-               |state        ||
-   |                         |category|string  |                |save/restore ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |num-clients              |setting |numeric |'0'             |configuration||
-   |-------------------------+--------+--------+----------------+-------------||
-   |N-name                   |setting |-       |-               |configuration||
-   |-------------------------+--------+--------+----------------+-------------||
-   |N-regular?               |setting |boolean |'0'             |subscription ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |N-time                   |setting |numeric |'0'             |subscription ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |N-scale                  |setting |numeric |'1'             |subscription ||
-   |                         |        |fraction|                |             ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |N-event                  |pin     |-       |-               |advancing    ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |N-control                |pin     |-       |-               |subscription ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |advance                  |pin     |-       |-               |advancing    ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |yield                    |pin     |-       |-               |advancing    ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |enabled?                 |setting |numeric |'1'             |advancing    ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |enable-threshold         |setting |numeric |'1'             |advancing    ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |yield-host-time-threshold|setting |numeric |'1'             |timing       ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |yield-host-time?         |setting |numeric |'0'             |timing       ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |step-cycle-limit         |setting |numeric |advancing       |             ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |time                     |register|numeric |timing          |             ||
-   |-------------------------+--------+--------+----------------+-------------||
-   |advance-count            |register|numeric |advancing       |             ||
-   +---------------------------------------------------------------------------+
+   +-----------------------------------------------------+
+   |                        pins                         |
+   |-----------------------------------------------------|
+   |   name   |direction|    legalvalues    | behaviors  |
+   |----------+---------+-------------------+------------|
+   |advance   |in       |any                |advancing   |
+   |----------+---------+-------------------+------------|
+   |yield     |in       |any                |advancing   |
+   |----------+---------+-------------------+------------|
+   |active    |out      |boolean            |advancing   |
+   |----------+---------+-------------------+------------|
+   |N-event   |out      |no value           |advancing   |
+   |----------+---------+-------------------+------------|
+   |N-control |in       |coded value        |subscription|
+   |----------+---------+-------------------+------------|
+   |time-query|in       |any                |timing      |
+   |----------+---------+-------------------+------------|
+   |time-high |out      |high order 32 bits |timing      |
+   |          |         |of 64-bit value    |            |
+   |----------+---------+-------------------+------------|
+   |time-low  |out      |low order 32 bits  |timing      |
+   |          |         |of 64-bit value    |            |
+   +-----------------------------------------------------+
+
++------------------------------------------------------------------------------+
+|                                  attributes                                  |
+|------------------------------------------------------------------------------|
+|           name            | category |  legal   |  default  |   behaviors   ||
+|                           |          |  values  |   value   |               ||
+|---------------------------+----------+----------+-----------+---------------||
+|state-snapshot             |no        |opaque    |-          |state          ||
+|                           |category  |string    |           |save/restore   ||
+|---------------------------+----------+----------+-----------+---------------||
+|num-clients                |setting   |numeric   |'0'        |configuration  ||
+|---------------------------+----------+----------+-----------+---------------||
+|N-name                     |setting   |-         |-          |configuration  ||
+|---------------------------+----------+----------+-----------+---------------||
+|N-regular?                 |setting   |boolean   |'0'        |subscription   ||
+|---------------------------+----------+----------+-----------+---------------||
+|N-time                     |setting   |numeric   |'0'        |subscription   ||
+|---------------------------+----------+----------+-----------+---------------||
+|N-scale                    |setting   |numeric   |'1'        |subscription   ||
+|                           |          |fraction  |           |               ||
+|---------------------------+----------+----------+-----------+---------------||
+|N-event                    |pin       |-         |-          |advancing      ||
+|---------------------------+----------+----------+-----------+---------------||
+|N-control                  |pin       |-         |-          |subscription   ||
+|---------------------------+----------+----------+-----------+---------------||
+|advance                    |pin       |-         |-          |advancing      ||
+|---------------------------+----------+----------+-----------+---------------||
+|yield                      |pin       |-         |-          |advancing      ||
+|---------------------------+----------+----------+-----------+---------------||
+|enable-threshold           |setting   |numeric   |'1'        |advancing      ||
+|---------------------------+----------+----------+-----------+---------------||
+|enabled?                   |setting   |numeric   |'1'        |advancing      ||
+|---------------------------+----------+----------+-----------+---------------||
+|yield-host-time-threshold  |setting   |numeric   |'1'        |timing         ||
+|---------------------------+----------+----------+-----------+---------------||
+|yield-host-time?           |setting   |numeric   |'0'        |timing         ||
+|---------------------------+----------+----------+-----------+---------------||
+|step-cycle-limit           |setting   |numeric   |advancing  |               ||
+|---------------------------+----------+----------+-----------+---------------||
+|time                       |register  |numeric   |timing     |               ||
+|---------------------------+----------+----------+-----------+---------------||
+|advance-count              |register  |numeric   |advancing  |               ||
++------------------------------------------------------------------------------+
 
   Variant: sid-sched-sim
 
index 17f4c44..179c56c 100644 (file)
 
     <behavior name="advancing">
       <p> When you have disabled the scheduler by setting the
-      <attribute>enabled?</attribute> attribute to a value less than enable-threshold,
-      advancing as described below, does not occur.
+      <attribute>enabled?</attribute> attribute to a value less than the <attribute>enable-threshold</attribute>
+      attribute, advancing as described below, does not occur.
       </p>
 
       <p> Whenever the <pin>advance</pin> input pin is driven, the scheduler
index 65e12f2..371b9a1 100644 (file)
@@ -20,23 +20,23 @@ proc get_sub {sched n} {
 proc set_sub {sched n pair} {
     set time [lindex $pair 0]
     set regular [lindex $pair 1]
-    set time [sid::component::set_attribute_value $sched $n-time $time]
-    set regular [sid::component::set_attribute_value $sched $n-regular? $regular]
-}
-
-
-proc set_enable {sched flag} {
-    sid::component::set_attribute_value $sched enabled? $flag
+    if {$time} {
+       # time is nonzero, so set regular *first* and then time
+       set regular [sid::component::set_attribute_value $sched $n-regular? $regular]
+       set time [sid::component::set_attribute_value $sched $n-time $time]
+    } else {
+       # time is zero, so disable time *first* and then set regular
+       set time [sid::component::set_attribute_value $sched $n-time $time]
+       set regular [sid::component::set_attribute_value $sched $n-regular? $regular]
+    }
 }
 
 
 proc toggle_subscription {sched n} {
     global saved_subs
-    set_enable $sched 0
     set new_sub $saved_subs($sched,$n)
     set saved_subs($sched,$n) [get_sub $sched $n]
     set_sub $sched $n $new_sub
-    set_enable $sched 1
 }