1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-2002. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @include common/timemac.texi |
---|
10 | @tex |
---|
11 | \global\advance \smallskipamount by -4pt |
---|
12 | @end tex |
---|
13 | |
---|
14 | @chapter ERC32 Timing Data |
---|
15 | |
---|
16 | @section Introduction |
---|
17 | |
---|
18 | The timing data for RTEMS on the ERC32 implementation |
---|
19 | of the SPARC architecture is provided along with the target |
---|
20 | dependent aspects concerning the gathering of the timing data. |
---|
21 | The hardware platform used to gather the times is described to |
---|
22 | give the reader a better understanding of each directive time |
---|
23 | provided. Also, provided is a description of the interrupt |
---|
24 | latency and the context switch times as they pertain to the |
---|
25 | SPARC version of RTEMS. |
---|
26 | |
---|
27 | @section Hardware Platform |
---|
28 | |
---|
29 | All times reported in this chapter were measured |
---|
30 | using the SPARC Instruction Simulator (SIS) developed by the |
---|
31 | European Space Agency. SIS simulates the ERC32 -- a custom low |
---|
32 | power implementation combining the Cypress 90C601 integer unit, |
---|
33 | the Cypress 90C602 floating point unit, and a number of |
---|
34 | peripherals such as counter timers, interrupt controller and a |
---|
35 | memory controller. |
---|
36 | |
---|
37 | For the RTEMS tests, SIS is configured with the |
---|
38 | following characteristics: |
---|
39 | |
---|
40 | @itemize @bullet |
---|
41 | @item 15 Mhz clock speed |
---|
42 | |
---|
43 | @item 0 wait states for PROM accesses |
---|
44 | |
---|
45 | @item 0 wait states for RAM accesses |
---|
46 | @end itemize |
---|
47 | |
---|
48 | The ERC32's General Purpose Timer was used to gather |
---|
49 | all timing information. This timer was programmed to operate |
---|
50 | with one microsecond accuracy. All sources of hardware |
---|
51 | interrupts were disabled, although traps were enabled and the |
---|
52 | interrupt level of the SPARC allows all interrupts. |
---|
53 | |
---|
54 | @section Interrupt Latency |
---|
55 | |
---|
56 | The maximum period with traps disabled or the |
---|
57 | processor interrupt level set to it's highest value inside RTEMS |
---|
58 | is less than RTEMS_MAXIMUM_DISABLE_PERIOD |
---|
59 | microseconds including the instructions which |
---|
60 | disable and re-enable interrupts. The time required for the |
---|
61 | ERC32 to vector an interrupt and for the RTEMS entry overhead |
---|
62 | before invoking the user's trap handler are a total of |
---|
63 | RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK |
---|
64 | microseconds. These combine to yield a worst case interrupt |
---|
65 | latency of less than RTEMS_MAXIMUM_DISABLE_PERIOD + |
---|
66 | RTEMS_INTR_ENTRY_RETURNS_TO_PREEMPTING_TASK microseconds at |
---|
67 | RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ Mhz. |
---|
68 | [NOTE: The maximum period with interrupts disabled was last |
---|
69 | determined for Release RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.] |
---|
70 | |
---|
71 | The maximum period with interrupts disabled within |
---|
72 | RTEMS is hand-timed with some assistance from SIS. The maximum |
---|
73 | period with interrupts disabled with RTEMS occurs during a |
---|
74 | context switch when traps are disabled to flush all the register |
---|
75 | windows to memory. The length of time spent flushing the |
---|
76 | register windows varies based on the number of windows which |
---|
77 | must be flushed. Based on the information reported by SIS, it |
---|
78 | takes from 4.0 to 18.0 microseconds (37 to 122 instructions) to |
---|
79 | flush the register windows. It takes approximately 41 CPU |
---|
80 | cycles (2.73 microseconds) to flush each register window set to |
---|
81 | memory. The register window flush operation is heavily memory |
---|
82 | bound. |
---|
83 | |
---|
84 | [NOTE: All traps are disabled during the register |
---|
85 | window flush thus disabling both software generate traps and |
---|
86 | external interrupts. During a normal RTEMS critical section, |
---|
87 | the processor interrupt level (pil) is raised to level 15 and |
---|
88 | traps are left enabled. The longest path for a normal critical |
---|
89 | section within RTEMS is less than 50 instructions.] |
---|
90 | |
---|
91 | The interrupt vector and entry overhead time was |
---|
92 | generated on the SIS benchmark platform using the ERC32's |
---|
93 | ability to forcibly generate an arbitrary interrupt as the |
---|
94 | source of the "benchmark" interrupt. |
---|
95 | |
---|
96 | @section Context Switch |
---|
97 | |
---|
98 | The RTEMS processor context switch time is 10 |
---|
99 | microseconds on the SIS benchmark platform when no floating |
---|
100 | point context is saved or restored. Additional execution time |
---|
101 | is required when a TASK_SWITCH user extension is configured. |
---|
102 | The use of the TASK_SWITCH extension is application dependent. |
---|
103 | Thus, its execution time is not considered part of the raw |
---|
104 | context switch time. |
---|
105 | |
---|
106 | Since RTEMS was designed specifically for embedded |
---|
107 | missile applications which are floating point intensive, the |
---|
108 | executive is optimized to avoid unnecessarily saving and |
---|
109 | restoring the state of the numeric coprocessor. The state of |
---|
110 | the numeric coprocessor is only saved when an FLOATING_POINT |
---|
111 | task is dispatched and that task was not the last task to |
---|
112 | utilize the coprocessor. In a system with only one |
---|
113 | FLOATING_POINT task, the state of the numeric coprocessor will |
---|
114 | never be saved or restored. When the first FLOATING_POINT task |
---|
115 | is dispatched, RTEMS does not need to save the current state of |
---|
116 | the numeric coprocessor. |
---|
117 | |
---|
118 | The following table summarizes the context switch |
---|
119 | times for the ERC32 benchmark platform: |
---|
120 | |
---|