Incrementing of the clock begins with
the first stepping pulse after the clock
enters the set state.
When the clock is in the set state,
execution of STORE CLOCK causes condi­
tion code 0 to be set and the current
value of the running clock to be stored.
Error State: The clock enters the error
state when a malfunction is detected
that is likely to have affected the
validity of the clock value. A timing­
facility-damage machine-check-interrup­
tion condition is generated on each CPU which has access to that clock whenever it enters the error state.
When STORE CLOCK is executed and the
clock accessed is in the error state,
condition code 2 is set, and the value
stored is unpredictable.
Not-Operational State: The clock is in
the not-operational state when its power
is off or when it is disabled for main­
tenance. It depends on the model if the
clock can be placed in this state.
Whenever the clock enters the not­
operational state, a timing-facility­
damage machine-check-interruption
condition is generated on each CPU that
has access to that clock.
When the clock is in the not-operational
state, execution of STORE CLOCK causes
condition code 3 to be set, and zero is stored. Changes in Clock State When the TOO clock accessed by a CPU changes value because of the execution
of SET CLOCK or changes state, inter­
ruption conditions pending for the clock
comparator, CPU timer, interval timer,
and TOD-clock-sync check mayor may not
be recognized for up to 1.048576 seconds (2
20
microseconds) after the change. Setting and Inspecting the Clock The clock can be set to a specific value
by execution of SET CLOCK if the manual TOO-clock control of any CPU in the
configuration is in the enable-set posi­
tion. Setting the clock replaces the
values in all bit positions from bit
position 0 through the rightmost posi­
tion that is incremented when the clock
is running. However, on some models,
the rightmost bits starting at or to the
right of bit 52 of the specified value
are ignored, and zeros are placed in the corresponding positions of the clock. , The TOO executing
clock can be inspected STORE CLOCK, which causes
by
a
64-bit value to be stored. Two
executions of STORE CLOCK, possibly on
different CPUs in the same
configuration, always store different
values if the clock is running or, if
separate clocks are accessed, both
clocks are running and are synchronized.
The values stored for a running clock
always correctly imply the sequence of
execution of STORE CLOCK on one or more CPUs for all cases where the sequence can be established by means of the
program. Zeros are stored in positions
to the right of the bit position that is
incremented. In a configuration with
more than one CPU, however, when the
value of a running clock is stored,
nonzero values may be stored in posi­
tions to the right of the rightmost
position that is incremented. This
ensures that a unique value is stored.
In a configuration where more than one CPU accesses the same clock, SET CLOCK is interlocked such that the entire
contents appear to be updated concur­
rently; that is, if SET CLOCK instructions are executed simultaneously
by two CPUs, the final result is either
one or the other value. If SET CLOCK is
executed on one CPU and STORE CLOCK on
the other, the result obtained by STORE CLOCK is either the entire old value or
the entire new value. When SET CLOCK is
executed by one CPU, a STORE CLOCK executed on another CPU may find the
clock in the stopped state even when the
TOD-clock-sync-control bit is zero in
each CPU. The TOD-clock-sync-control
bit is bit 2 of control register O. Since the clock enters the set state
before incrementing, the first STORE CLOCK executed after the clock enters
the set state may still find the
original value introduced by SET CLOCK. Programming Notes
1. Bit position 31 of the clock is
incremented every 1.048576 seconds;
for some applications, reference to
the leftmost 32 bits of the clock
may provide sufficient resolution.
2. Communication between systems is
facilitated by establishing a stan­
dard time origin, or standard
epoch, which is the calendar date
and time to which a clock value of
zero corresponds. January 1, 1900, o a.m. Greenwich Mean Time (GMT) is
recommended as the standard epoch
for the clock.
3. A program using the clock value as
a time-of-day and calendar indi­
cation must be consistent with the
programming support under which the
program is to be executed. If the
programming support uses the stand- Chapter 4. Control 4-25
ard epoch, bit 0 of the clock
remains one through the years
1972-2041. (Bit 0 turned on at 11:56:53.685248 (GMT) May 11,
1971.) Ordinarily, testing bit 0 for a one is sufficient to deter­
mine if the clock value is in the
standard epoch.
4. Because of the limited accuracy of
manually setting the clock value,
the rightmost bit positions of the
clock, expressing fractions of a
second, are normally not valid as
indications of the time of day.
However, they permit elapsed-time
measurements of high resolution.
5. The following chart shows the time
interval between instants at which
various bit positions of the TOO clock are stepped. This time value
may also be considered as the
weighted time value that the bit,
when one, represents. TOD- Stepping Interval
Clock OaysIHours\Min. I Bit Seconds
51 0.000 001 47 0.000 016 43 0.000 256
39 0.004 096 35 0.065 536
31 1.048 576
27 16.777 216
23 4 28.435 456
19 1 11 34.967 296
15 19 5 19.476 736
11 12 17 25 11.627 776
7 203 14 43 6.044 416
3 3257 19 29 36.710 656
6. The following chart shows the clock
setting at the start of various
years. The clock settings,
expressed in hexadecimal notation,
correspond to 0 a.m. Greenwich
Mean Time on January 1 of each
year. Year Clock Setting (Hex) 1900 0000 0000 0000 0000 1976 8853 BAFO B400 0000 1980 8F80 9F03 2200 0000 1984 96AD 84B5 9000 0000 1988 9DOA 6997 FEOO 0000 1992 A507 4E7 A 6COO 0000 1996 AC34 335C DADO 0000 2000 B361 183F 4800 0000 7. The stepping value of TOO-clock bit
position 63, if implemented, is
2_12 microseconds, or approximately
4-26 System/370 Principles of Operation 244 picoseconds. This value is
called a clock unit.
The following chart shows various
time intervals in clock units
expressed in hexadecimal notation.
Interval Clock Units (Hex)
1 microsecond 1000 1 millisecond 3E 8000 1 second F424 0000 1 minute 39 3870 0000 1 hour 069 3A40 0000 1 day 1 4100 7600 0000 365 days 1CA ESC1 3EOO 0000 366 days ICC 2A9E B400 0000 1,461 days* 72C E4E2 6EOO 0000 * Number of days in four years,
including a leap year. Note that the year 1900 was not a
leap year. Thus, the four-
year span starting in 1900 has only 1460 days.
8. In a multiprocessing configuration,
after the TOO clock is set and
begins running, the program should
delay activity for 2
20
microseconds (1.048576 seconds) to ensure that
the CPU-timer, clock-comparator,
interval timer, and TOD-clock­ sync-check interruption conditions are recognized by the CPU. TOO-CLOCK SYNCHRONIZATION In an installation with more than one CPU, each CPU may have a separate TOO clock, or more than one CPU may share a TOO clock, depending on the model. In
all cases, each CPU has access to a single clock.
The TOD-clock-synchronization facility,
in conjunction with a clock­
synchronization program, makes it possi­
ble to provide the effect of all CPUs in
a multiprocessing configuration sharing
a single TOO clock. The result is such
that, to all programs storing the TOD­ clock value, it appears that all CPUs in
the configuration read the same TOO clock. The TOO-clack-synchronization facility provides these functions in
such a way that even though the number
of CPUs sharing a TOO clock is madel­
dependent, a single model-independent
clock-synchronization routine can be
written. The following functions are
provided: Synchronizing the 7tepping rates
for all TOO clocks 1n the config­
uration. Thus, if all clocks are. set to the same value, they stay in synchronism.
Previous Page Next Page