0% found this document useful (0 votes)
5 views2 pages

cheatsheet

Real-time systems (RTS) must meet functional requirements and deadlines, with classifications into hard, soft, and firm RTS based on the consequences of missing deadlines. Key components of RTS include a technical system, sensoring, processing, and actuating systems, with concerns around concurrency and scheduling strategies. Additionally, the document discusses various scheduling algorithms, multitasking types, interrupts, and the characteristics of embedded systems.

Uploaded by

nb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

cheatsheet

Real-time systems (RTS) must meet functional requirements and deadlines, with classifications into hard, soft, and firm RTS based on the consequences of missing deadlines. Key components of RTS include a technical system, sensoring, processing, and actuating systems, with concerns around concurrency and scheduling strategies. Additionally, the document discusses various scheduling algorithms, multitasking types, interrupts, and the characteristics of embedded systems.

Uploaded by

nb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Requirements for RTS • Functional requirements must be met!

(like for all systems) • Defined response times need to be met! è real-time systems
must meet deadlines! Additional requirements for RTS • Determinability (it comes to a well-defined end!) • Predictability (when it comes to the end!)
• Reliability. Describe the basic model for real time systems - Real-time Systems must meet their functional requirements and they have time
constraints that means they must meet deadlines. Generally, an RTS comprises of è A technical system that follows a physical process è A sensoring
system è A central processing system that must meet deadlines è An actuating system Sequentiality and concurrency (Gleichzeitigkeit/
Nebenläufigkeit) are major concerns of RTS. Types of RTS I. Hard RTS Missing a deadline is a total system failure (e.g. airbag in car, use case in
aviation). II. Soft RTS The usefulness of a result degrades after its deadline, thereby degrading the system‘s quality of service. (e.g. warning systems,
e.g. distance warner). III. Firm RTS Infrequent deadline misses are tolerable but may degrade the system‘s quality of service. The usefulness of a result
is zero after its deadline. (e.g. ignition-point-optimizer for motor) Classification criteria of RTS and comment on them 1. Consequence of missing
deadline 2. Reliability and fault tolerance 3. Distribution: centralized or distributed RTS 4. Interactive or autonomous system 5. Hierarchical or
independent systems 6. Time-driven or event-driven RTS è Time-driven: which job is next at specific time, there is a chosen priority before execution è
Event-driven RTS: scheduling decisions are triggered by events not time instance events are release completion blocking, unblocking of jobs 7.
periodic, aperiodic, sporadic RTS 8. Cyclic or asynchronous scheduling Requirements of RT-clocks Time in Real-Time Computer Systems Real-Time
Clock: • high resolution • high accuracy (low jitter) • smooth time adjustment additional information (may not be relevant): Real-Time Timer: • high
resolution • high accuracy (low jitter) Software: • able to handle concurrency • able to perform real-time-scheduling-strategies (configurable
scheduler) • able to control (avoid) system tasks • libraries to handle real-time hardware World Clock è indicates UTC in local time zone è absolute
point in time è Nothing to set; No trigger; No reaction; Just time, lasting forever • Alarm Clock è set up an absolute alarm time (absolute point in time)
è time-based trigger: The alarm clock compares the actual (point in) time with the alarm (point in time.) When the alarm is lower or equal the actual
time the alarm clock triggers a sound. • Stopwatch with lap times (Rundenzeiten) è A stopwatch with lap times has the following additional
functionality: Between start time and stop time you can have additional events. These events are lap times. è When a lap is terminated the event
initiates an additional time stamp. è This time stamp is a relative point in time. è If you calculate the time difference between two absolute
subsequent lap timestamps. è You get the time difference (duration) of the preceding lap. This duration is called lap time. • Timer è you can set a
relative alarm time è the alarm time is a time difference (duration) è There is a trigger: The trigger starts the time. The alarm is decreasing. When the
alarm time is lower or equal zero è the timer triggers a sound. Duration • Stopwatch è Reference point in time is set to 00:00.00 s è There is a
manual/electronic trigger to start the stopwatch. è The stopwatch is counting upwards with the SI-second or parts of it. è It displays the relative time
difference based on the trigger time point. è There is a manual/electronic trigger to stop the stopwatch. è After this stop trigger the stopwatch stops
the clock. è The display shows the time difference (duration) between: start event and stop event. Single instance, periodic, aperiodic, and sporadic
Reappearing Jobs are called Tasks. Periodic Task When the time of the reappearing is constant. Sporadic Task When the recurrence is random but
there is a minimum time difference between two jobs of the same task. Aperiodic Task When the recurrence is random but there is no minimum time
difference between two jobs of the same task, means they may even appear at the same time. Why is the WCET so important for real time systems? è
Relevant for deadlines is the maximum execution time of a program on a certain hardware. è The WCET is the maximum limit of the variable execution
time. How can you determine a value for the WCET (of a specific peace of software on a predefined system) Two different levels 1. macroscopic
examination: What does a computer program do? 2. microscopic examination: What happens inside the microprocessor? Two methods 1. Dynamical
WCET Analysis: (deductive, let's measure) Measurement of an adequate number of executions runs on a certain hardware 2. Static WCET Analysis:
(inductive, let's think) Calculating execution time based on the computer program. How can you determine a value for the WCET for a program that
contains branches? 1. (internal) measurement the execution time of the code sequence by taking to time stamps and calculate the difference 2.
(external) measurement of the time between request and output (e.g. using of an oscilloscope, stroboscope) " Concurrent processes" does not mean
"at the same time". è Concurrent means "independent". • However, when two concurrent processes need to use a resource at the same time then
they become dependent. • To analyze concurrent processes a model is needed to describe the states and transitions of the system. • The model Petri-
Net (similar to the finite state machine (endlicher Zustandsautomat) is able to describe and to analyze a system with concurrent processes. Priority
Inversion occurs when a high priority task - requiring a resource - is blocked due to the lock of this resource by a low priority task. Then the high
priority task is blocked until the low priority task is completed and has released the resource. This can take a long time, especially when mid-prioritized
tasks delay the completion of the low prioritized one. online and offline Before execution of the system: offline-scheduling • Inflexible (changes) •
Always maximum utilization • Low costs at execution During execution of the system: online-scheduling • Flexible (changes) • Utilization depends on
scheduling algorithm • Higher cost at execution • Normally priority based EDF Earliest Deadline First • has dynamic priorities • each tasks priority is
calculated depending on deadline: àan executable task with shorter deadline has always a higher priority than the other tasks àan executable task
with higher priority will always interrupt a task with lower priority àa task with the same priority is not interrupted. RMS Rate Monotonic Scheduling •
is a priority based preemptive scheduling, in which the threads with the lower periods should be given higher priorities and vice versa. • the priority is
solely determined by its period only with the rule: “lower the period higher the priority and vice versa” àif a system cannot be schedulable by RMS,
the system cannot be scheduled with any other static priority assignment. • If a system cannot be scheduled by RMS, the system cannot be scheduled
with any other static priority assignment (PIP) A low priority task holding a critical resource that àis requested by a higher prioritized task àinherits the
priority of the higher prioritized task. After completion of the access to the critical resource the priority will be set back to the initial value. The Priority
Ceiling Protocol (PCP) is an enhancement of the Priority Inheritance Protocol (PIP). In case of a priority inversion the job having allocated a resource
inherits the highest priority of all tasks that are using the resource. Explain (computer-) program, process and thread/LWP - Process A process is set of
relations or actions that converts a predefined input into a required outcome. Thread Two processes can run at the same time, but they do not share
memory. Suppose we provided software entities that could run at the same time but also share memory. Such entities exist in most of the actual OS. A
thread has some of the characteristics of a process, but it is possible to have threads sharing the same memory space. Difference between process and
thread Process • Process is considered heavy • Unit of Resource Allocation and of Protection • Process creation is very costly in terms of resources •
Program execution as process is relatively slow • Process cannot access the memory belonging to another process • Process switching is time
consuming • One Process can contain several threads Thread • Thread is considered light weight. • Unit of CPU utilization. • Thread creation is very
economical. • Programs executing using threads are comparatively faster • Thread can access the memory area belonging to another thread within
the same process. • Thread switching is faster. • One thread can belong exactly to one Process. Goals of Standard Scheduler • Minimizing the average
response time: e.g. interactive systems • Maximizing throughput: e.g. server • Maximizing processor load: e.g. supercomputer • Fairness: fair
utilization of resources • Compliance with deadlines Real Time Scheduling • Deadlines must be met • Tasks have different importance (priorities) =>
no fairness! • Priorities may change over time • Low response time is not enough, deadlines must be guaranteed • Periods for periodic tasks • Inter
task dependencies (task graph). What is the difference between pre-emptive and cooperative multitasking? Preemptive Multitasking • is task in
which a computer operating system uses some criteria to decide how long to allocate to any one task before giving another task a turn to use the
operating system • The act of taking control of the operating system from one task and giving it to another task is called preempting. • A common
criterion for preempting is simply elapsed time (this kind of system is sometimes called time sharing or time slicing) • In some operating systems,
some applications can be given higher priority than other applications, giving the higher priority programs control as soon as they are initiated and
perhaps longer time slices. Cooperative Multitasking • A type of multitasking in which the process currently controlling the CPU must offer control to
other processes. • In cooperative multitasking, what happens is that the scheduler has no say in when a thread can run. • Each thread decides for how
long it keeps the CPU. • If it decided not to share the CPU with any other thread, then no other threads will run, causing what is known as starvation.
Difference • Preemptive: threads do not decide when to run and are forced to share the CPU. (Used in most modern computer) • Cooperative: each
thread, once running decides for how long to keep the CPU, and when it is time to give it up so that another thread can use it. (Applicable for
embedded systems). Describe the functionality of interrupts Functionality In system programming, an interrupt is a signal to the processor emitted by
hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the
interruption of the current code the processor is executing. The processor responds by • suspending its current activities, • suspending its current
activities, • executing a function called an interrupt handler (or an interrupt service routine, ISR) to deal with the event. This interruption is temporary,
and, after the interrupt handler finishes, the processor resumes normal activities. There are two types of interrupts: • hardware interrupts • software
interrupts. List the different categories of interrupts (hw/sw, (non-/) maskable) etc.) Software interrupt an interrupt generated within a processor by
executing an instruction. Software interrupts are often used to implement system calls because they result in a subroutine call with a CPU ring level
change. Spurious interrupt a hardware interrupt that is unwanted. They are typically generated by system conditions such as electrical interference on
an interrupt line or through incorrectly designed hardware. Maskable interrupt (IRQ) a hardware interrupt that may be ignored by setting a bit in an
interrupt mask register's (IMR) bitmask. Non-maskable interrupt (NMI) a hardware interrupt that lacks an associated bitmask, so that it can never be
ignored. NMIs are used for the highest priority tasks such as timers, especially watchdog timers. Inter-processor interrupt (IPI) a special case of
interrupt that is generated by one processor to interrupt another processor in a multiprocessor system. An interrupt is an event that • stops a
currently running program A, • starts another program B and returns to the program A, that is continuing exactly where it was interrupted. The event
is also called trigger. The program A is called interrupted program. The program B is called interrupt service routine (ISR). The processor state when a
program is running is called context. Therefor an interrupt causes a change in the processor state. This state change is called a context switch. What is
a „minor page fault”? A Memory management Unit has 4 tasks to do: 1. Memory Protection (applications and processes(not threads) have its own
address space, that is protected against mutual access ) 2. Address Translation (makes sure, that code-segments start with memory address 0 :
codeshare, less memory, faster) 3. Provisioning of extended Memory (when more memory is required than it is accessible by the bus) 4. Provisioning
of virtual memory (provides more memory than available physical memory by paging and swapping). General Definition Embedded System "is a
computer system but doesn't look like a computer". Better Definition An Embedded System is a computer that is part of an overall system and
controls physical processes. Though the computer is embedded in a technical system. It responds reactive on (input) signals and produces (after
calculations) other (new output) signals to control the technical system. Properties • Complex interaction with the environment and other Embedded
Systems • Often operated autonomously • High requirements on reliability • Replace mechanical systems (e.g. regulator, stabilizer, controller) •
HW/SW-Code design: System on a chip (SoC) • Usage of processor often not visible • Normally working under RT constraints • Repair costs are often
higher than a new system Example of embedded systems • Missile Control • Digital Camera • Home Security System • Industrial Robots • Calculator •
… Name examples of sensors • Microphone, Gyroscope, Accelerometer, Magnetometer, Micro Electronic Mechanical Systems (MEMS) • Additional
Examples: Ultrasonic Sensors, LDR (Light sensor), Water Flow Sensor, Touch Sensor, Humidity Sensor. Actuator - Electric Motor, Screw jack, Hydraulic
cylinder (excavator), … • A signal is 'active low' means that signal will be performing its function when its logic level is 0. • A signal is 'active high'
means that signal will be performing its function when its logic level is 1. • ASIC is an integrated circuit chip customized for a particular use. • SOC is an
integrated circuit that integrates all or most components of a computer or other electronic system. Components of Microcontrollers • Central
Processing Unit (CPU) • Program Memory (ROM – Read Only Memory) • Data Memory (RAM – Random Access Memory) • Timers and Counters • I/O
Ports (I/O – Input/Output) • Serial Communication Interface • Clock Circuit (Oscillator Circuit) • Interrupt Mechanism 8.8 Resolution of analog-digital-
converters • Resolution refers to the conversion of an analog voltage to a digital value in a computer. • An n-bit ADC has a resolution of one part in
2n. Example: A 12-bit ADC has a resolution of one part in 4,096, where 212 = 4,096 Quantization error - is the difference between the analog signal
and the closest available digital value at each sampling. Sampling theorem - states that a signal can be exactly reproduced if it is sampled at a
frequency F, where F is greater than twice the maximum frequency. Antialiasing It is a technique used to smooth otherwise jagged lines or textures by
blending the colour of an edge with the colour of pixels around it. Pagefault (Minor Pagefault) A pagefault is a type of exceptionraised by computer
hardware when running program accesses a memory page that is not currently mapped by memory management unit into virtual address space of a
process. If a page is loaded in memory at the time the fault is generated, but is not marked in the MMU as being loaded in memory, then it is called
minorfault. No I/O operations are necessary.

You might also like