design of on-chip cores and sensors to improve embedded ...fabian vargas obtained his ph.d. degree...

36
1 [email protected] [email protected] Catholic University PUCRS Design of On-Chip Cores and Sensors to Improve Embedded System Reliability Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG), France, in 1995. In 2005, he spent a sabbatical year at the Technical University of Lisbon (INESC-ID / IST), Portugal. At present, he is Associate Professor at the Catholic University (PUCRS) in Porto Alegre, Brazil. His main research domains involve the HW-SW co-design and test of system- on-chip (SoC) for critical applications; system-level design and methodologies for radiation and electromagnetic compatibility; and the on-chip sensor design for reliability and aging binning. Among several activities, Prof. Vargas has served as Technical Committee Member or Guest-Editor in many IEEE-sponsored conferences and journals. He holds 6 BR and international patents, co-authored a book and published over 200 refereed papers. Prof. Vargas is associate researcher of the BR National Science Foundation since 1996. He co-founded the IEEE Latin American Test Technology Technical Council (LA-TTTC) in 1997 and the IEEE Latin American Test Workshop (LATW) in 2000. Prof. Vargas received the Meritorious Service Award of the IEEE Computer Society for providing significant services for chairing the IEEE Latin American Regional TTTC Group and the LATW for several years. Prof. Vargas is a Golden Core Member of the IEEE Computer Society.

Upload: others

Post on 04-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

1

[email protected]

[email protected]

Catholic University

PUCRS

Design of On-Chip Cores and

Sensors to Improve

Embedded System Reliability

Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut

National Polytechnique de Grenoble (INPG), France, in 1995. In 2005, he

spent a sabbatical year at the Technical University of Lisbon (INESC-ID / IST),

Portugal. At present, he is Associate Professor at the Catholic University

(PUCRS) in Porto Alegre, Brazil.

His main research domains involve the HW-SW co-design and test of system-

on-chip (SoC) for critical applications; system-level design and methodologies

for radiation and electromagnetic compatibility; and the on-chip sensor design

for reliability and aging binning.

Among several activities, Prof. Vargas has served as Technical Committee

Member or Guest-Editor in many IEEE-sponsored conferences and journals.

He holds 6 BR and international patents, co-authored a book and published

over 200 refereed papers. Prof. Vargas is associate researcher of the BR

National Science Foundation since 1996.

He co-founded the IEEE Latin American Test Technology Technical Council

(LA-TTTC) in 1997 and the IEEE Latin American Test Workshop (LATW) in

2000. Prof. Vargas received the Meritorious Service Award of the IEEE

Computer Society for providing significant services for chairing the IEEE Latin

American Regional TTTC Group and the LATW for several years. Prof. Vargas

is a Golden Core Member of the IEEE Computer Society.

Page 2: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

2

[email protected]

[email protected]

Catholic University

PUCRS

Design of On-Chip Cores and

Sensors to Improve

Embedded System Reliability

Fabian Vargas

Page 3: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 3 3 Catholic University

PUCRS

Development of IP Cores

Development of On-Chip Sensors

Page 4: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 4 4 Catholic University

PUCRS

Development of IP Cores

Development of On-Chip Sensors

Page 5: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

Motivation

Nowadays, embedded systems must respect strict timing constraints

to support real-time (RT) applications.

They have to provide logically and temporally correct results !

In this reality, these systems mandate the adoption of Real-Time Operating

Systems (RTOS) that manage task switching process, concurrency

between tasks, memory, time as well as interrupts.

[email protected] 5 5 Catholic University

PUCRS

Page 6: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 6

Understanding the Problem …

These faults can affect not only the applications running on

embedded systems but also the RTOS executing the application

code, by causing scheduling dysfunctions that could lead to

incorrect system behavior.

The increasing hostility of the electromagnetic

environment caused by the widespread adoption of electronics,

(mainly wireless technologies), represents a huge challenge

for the reliability of RT embedded systems.

Transient Faults

Radiated electromagnetic interference (EMI)

Power Supply Disturbances (PSD)

Catholic University

PUCRS

Page 7: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 7

Understanding the Problem …

e.g.: about 34% of the faults injected in processor’s registers

led to scheduling dysfunctions:

- 44% of these dysfunctions led to system crashes,

- 34% caused RT problems and

- 22% generated incorrect outputs (propagate to system

outputs).

If not detected at the RTOS-level,

these faults escape detection by

conventional (app-level) techniques as well !

Several solutions have been proposed. However, they provide

fault tolerance only at the application level and do NOT

consider faults affecting the RTOS that propagate to

application tasks.

Catholic University

PUCRS

Page 8: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 8

Goal

In this context…

We have been developing an IP core (RTOS-Guardian:

RTOS-G) to monitor RTOS activity in embedded systems

the RTOS-G targets faults that ESCAPE detection by

the native structures present in the RTOS kernel.

Catholic University

PUCRS

Page 9: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 9

1. Preliminaries

RTOS Preemptive Algorithm’s Behavior

Task1 Task2

Time Slice

PREEMPTION

LOW

HIGH

Prio

rity

Task1 and Task2 have

the same priority and

they do not posses

external dependencies

Task1

While a third task (Task3) with higher priority

is blocked and waiting for an external event.

But during Task1 execution this dependency

is solved

Task3

Then, the RTOS stops the

current task (Task1) execution

and switches to Task3.

Task1

Since this task has the highest

priority, it will be executed

completely before returning to the

interrupted Task1.

Catholic University

PUCRS

Page 10: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 10

The RTOS-G must keep a complete list of all tasks labeled

ready (ready-list) and blocked (blocked-list).

Every time a scheduling event is performed, the ready task

marked with the highest priority must be executed.

The complexity of monitoring this kind of behavior relies on

keeping track of the ready-list: its elements must NOT have any

pending IO requests or semaphore objects still to be acquired.

Then, the RTOS-G monitors not only the task addresses, but

also the addresses related to the kernel synchronization,

including: SemaphoreLock() and SemaphoreUnlock().

From the Preemption Algorithm to the Specification of the RTOS-G

1. Preliminaries

Catholic University

PUCRS

Page 11: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 11

The RTOS-G observes the order in which the functions responsible for task

synchronization are being called by the RTOS to infer ready-list constraints.

Task1

...

SemaphoreLock()

...

SemaphoreLock() {

//semaphore is locked

ReSchedule()

}

...

RTOS Kernel Task2

running

blocked

Task1 is running and tries to acquire a semaphore. Then,

system call is performed.

The RTOS kernel realizes that the semaphore is already

locked. In order to prevent the system from going into a

deadlock as well as to increase the CPU usage, the kernel

performs a CS calling another task into execution.

When the RTOS-G detects this flow, it will infer that Task2

is the next to run and therefore it should be taken out from

the ready-list.

In conclusion: the execution flow for an ―already locked

semaphore‖ consists of: SemaphoreLock() and

ReSchedule().

A similar analysis can be performed for other situations,

always concentrating all efforts in keeping the detection

algorithm generic enough for any RTOS or processor.

and the following execution flow analysis is adopted …

1. Preliminaries

Catholic University

PUCRS

Page 12: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 12

2. The Proposed Approach

Block diagram of the target embedded system

Events: Tick, interruption, ...

(Reference for

Task Context Switching)

Embedded

System

Memory Addresses accessed

by the processor.

RTOS-G identifies the current

task under execution by

correlating addresses flowing

through the bus with the

information stored in an Address

Table generated during the

compilation process.

RTOS-G

Catholic University

PUCRS

Page 13: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 13

2. The Proposed Approach

TC identifies the task in execution based on the

address accessed by the CPU during code execution.

LMEG classifies all tasks in two separate lists,

ready tasks and blocked tasks, each one organized

according to their priority and indicates errors.

CAM1: ready-list

CAM2: blocked-list.

Block diagram of the RTOS-G

Catholic University

PUCRS

FI analyses the scheduling process execution order

and identifies the event that triggered the process (e.g.,

occurrence of a Tick signal, IO request or semaphore

acquisition/release).

Page 14: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 14

by redefining the Context Switching Parameter

and creating a new Time Limit Variable:

2. The Proposed Approach

Time for Context Switching (Δ time, proportional to the number and complexity of resources. services, used by the RTOS)

Time Limit for Switching Context

Current task

retirement into the

execution queue

Next task recover

from the

execution queue

External Event

TIME constraint is handled by the core …

Catholic University

PUCRS

Page 15: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 15

Regarding the fault detection capability, the RTOS-G targets two types of

faults:

Sequence error (E_seq): occurs at the end of the Time Limit, tl, by noting

that the current task is not the expected one according to the task’s

execution flow (ready-list and priority-list).

Time error (E_time): occurs when a task switching process takes place

in between two consecutive context switching events (e.g., two

consecutive ticks) thus, violating the time constraints associated to the

RT-system.

2. The Proposed Approach

Catholic University

PUCRS

Page 16: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 16

RTOS-G area overhead (333 LUTs) with respect to the Plasma

(MIPS-like) microprocessor (3306 LUTs): 10%.

Some features …

For larger cores, area overhead can be reduced to values lower

than 10% because the size of the I-IP core is basically dependent on the

kernel complexity (i.e., number of resources, or functions, existing in

the RTOS kernel and how they are interconnected).

CAMs are able to store information up to 14 tasks simultaneously in execution

(both account for 60% of the I-IP overhead).

CAMs can be placed externally: RTOS-G’s overhead is 4%.

RTOS-G fault latency: 2% of the latency yielded by the RTOS

(measurement with ChipScope in terms of processor CC).

2. The Proposed Approach

Catholic University

PUCRS

Page 17: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 17

3. Practical Experiments

Von Neumann 32-bit RISC Plasma microprocessor running a RTOS (opencores.org).

Plasma’s instruction set compatible to MIPS architecture.

3 test programs were developed to exploit different services offered by the Plasma’s RTOS:

8 tasks access and update the value of a variable, which is protected

by a semaphore. Other variable is accessed by an Int. The 8 tasks

priorities: ―1, 2, 3, 4, 1, 2, 3, 4‖. The Int has the maximum priority.

4 tasks access and update the value of a variable, which is protected

by a semaphore. T5 communicates with T6 through a message

queue. An Int accesses a variable. The 6 tasks priorities: ―1, 2, 3, 4, 5,

6‖. The Int has the maximum priority.

Case Study:

Increasing use of RTOS services

Catholic University

PUCRS

2 tasks access and update the value of a global variable, which is

protected by a semaphore. T3 communicates with T4 through a

message queue. T5 and T6 access and update the value of a variable,

which is protected by a mutual exclusion semaphore (MUTEX). An Int

communicates with a T7 throughout a message queue. The 7 tasks

priorities: ―1, 2, 3, 4, 5, 6, 7‖. The Int has the maximum priority.

Page 18: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 18

8051

32 bits

8 bits 8 bits

8 bits 8 bits

8 bits

Top

Botton

SRAM 0

Flash 0

SRAM 0

SRAM 1

Flash 1

SRAM 1

Supply

M0

Supply

M1

Supply F0 Supply F1

Supply C

Supply

MSCFPGA1

RS232RS232

FPGA0

RS232

FPGA

CLK RS2328051

Block Diagram

FPGA

SRAM

8051

Flash

Power

Supplies

Test Side

Glue Logic Side

3. Practical Experiments

Test Side

Temp Sensor

Remaining Glue

Logic Side

Catholic University

PUCRS

Test board designed for IEC 62.132-2 and 61.004-29 electromagnetic susceptibility analysis

Page 19: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 19

3. Practical Experiments

Voltage dips were randomly injected at the FPGA 1 Vdd input pins at a frequency of 25.68 kHz and consisted

of dips of about 10.83% of the nominal Vdd.

Fault injection environment

FPGA_clk

Plasma

Microprocessor

RTOS-G

Address

Tick InterruptionStart

Task

Error

FPGA 1

RAM

(Data memory)

Voltage Dips

(Core Vdd pins)

ChipScope

FPGA 2

FPGA_clk

Plasma

Microprocessor

RTOS-G

Address

Tick InterruptionStart

Task

Error

FPGA 1

RAM

(Data memory)

Voltage Dips

(Core Vdd pins)

ChipScope

FPGA 21.2 volts

1.07 volts

Injected noise at the FPGA power bus

(conducted EMI)

10.38 % of voltage dips

Fault injection campaigns: generated according to the IEC 61.000-4-29 Int.

Std. for conducted EMI on the DC input power port of FPGA 1

RAM

(Instruction)

Catholic University

PUCRS

Page 20: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 20

3. Practical Experiments

TABLE I

Results for Fault Detection

As long as more

complex services of

the kernel are used,

the higher RTOS error

detection.

The native fault

detection mechanism

(assert() function) is

called by the kernel

every time RTOS runs

its services (message

queues, semaphores).

The priority level of tasks using the same

RTOS services has no direct influence on the

error probability.

Catholic University

PUCRS

Page 21: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 21

3. Practical Experiments

Experiment FPGA0

(krads)

FPGA1

(krads)

FPGA2

(krads)

FPGA3

(krads)

FPGA4

(krads)

1st experiment,

December/2010

0 5.6 51.9 111.0 216.0

2nd experiment,

March/2011

0 217.6 263.9 323.0 ---

Gamma Cell

Sample Holder

Silver-Chromate dosimeters

Around the test fixture, there are 4

boards for EM immunity tests

Fault injection campaigns: radiation on a Gamma Cell with Co60

Catholic University

PUCRS

Page 22: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 22

FAULTS DETECTED

0,00%

20,00%

40,00%

60,00%

80,00%

100,00%

120,00%

RTOS RTOS-G ONLY RTOS ONLY RTOS-G

TOTAL

FPGA3

FAULTS DETECTED

0,00%

5,00%

10,00%

15,00%

20,00%

25,00%

RTOS RTOS-G ONLY RTOS ONLY RTOS-G

TOTAL

FPGA2

3. Practical Experiments

FAULTS DETECTED

0,00%10,00%

20,00%30,00%

40,00%50,00%

60,00%70,00%

80,00%90,00%

100,00%

RTOS RTOS-G ONLY RTOS ONLY RTOS-G

TOTAL

FPGA1

RTOS-G: 68,67%

RTOS: 18,00%

Catholic University

PUCRS

Page 23: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 23 Catholic University

PUCRS

A second work ...

Page 24: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 24 24

Case Study & Practical Experiments

AP

AP Bus

Data Memory

Instruction Memory

OS Kernel Memory

Error Indication WDP-IP

Operating System (OS)

Driver

SoC General architecture

uCOS-II

Xilinx FPGA

IP

Core

Microprocessor

Catholic University

PUCRS

Page 25: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

25 [email protected] 25

IEC 62.132-2 std compliant board. Four-layers: Gnd (top) - signal - signal - Vdd (botton).

Top view Bottom view

FPGA (Processor + IP Core) 16MB SRAM (uCOS-II

+

user application) System under Test

Case Study & Practical Experiments

Catholic University

PUCRS

Page 26: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 26 26

Case Study & Practical Experiments

Interface Board

System under Test

TEM Cell

Catholic University

PUCRS

Page 27: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 27 [email protected] 27 IEC 62132-2 Experimental Results

(Prime Numbers Generator)

Comparison among techniques

51

95

43

19

10

20

40

60

80

100

uC/OS – II YACCA WDP-IP by

SW

WDP-IP+

by SW

WDP-IP by

HW

Detection techniques

De

tecte

d (

%)

Errors detected by

the IP Core

Errors detected by

different techniques

(check-point insertion)

implemented in the

application code

Errors detected by

native fault detection

structures embedded in

the OS kernel

Test setup:

Frequency range: 80MHz – 3GHz

EM field: 10V/m – 220V/m

Detected only faults that prevented

the OS from controlling the

semaphores between tasks.

Detected mostly faults that affected

data-flow execution.

Detected mostly faults that affected

data-flow execution and

configuration logic of the FPGA, as well as

semaphore-related ones.

Case Study & Practical Experiments

Catholic University

PUCRS

Page 28: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

28 [email protected] 28 [email protected] 28 Catholic University

PUCRS

An initial work ...

Page 29: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 29

General Block Diagram of the I-IP (RTOS-G) under development for MPSoCs

[email protected] 29 29 Catholic University

PUCRS

Initial Work

Page 30: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

30 30 Catholic University

PUCRS

An initial study ...

Page 31: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 31

Initial Study

Catholic University

PUCRS

Despite of more than 20 years of highly active research on WCET

analysis, there are still serious open problems in the area. The most

challenging problem is the high complexity of today’s processors:

features like cache coherence (hit and misses) and pipeline

(expeculative execution) create a huge state space.

Static WCET Analysis tools & Measurement-Based WCET Analysis tools have evolved as

complementary approaches, but both suffer from the state problem (i.e., the precise

determination of possible processor states at different program locations).

Page 32: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 32

We are studying the development of an IP core* dedicated to:

(a) perform on-chip WCET measurement as a complement to Static WCET Analysis;

(b) identify timing-critical parts of the SW (e.g., functions, instructions)

and the timing-critical parts of the HW (e.g., cache coherence, pipeline execution)

for further design optimization purposes;

(c) on-chip, runtime WCET monitoring.

Initial Study

Catholic University

PUCRS

* R. Kirner, I. Wenzel, B. Rieder, and P. Puschner. Intelligent Systems at the Service of Mankind, volume

2, chapter Using Measurements as a Complement to Static Worst-Case Execution Time Analysis, pages

205–226. UBooks Verlag, Augsburg, Germany, Jan. 2006. ISBN: 3-86608-052-2.

Page 33: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

33 Catholic University

PUCRS

[email protected]

Tasks for determining the

WCET of a program

(Static Analysis):

CFG Buiilding

Executable Program

Value analysis

Loop bound analysis

Cache analysis

Pipeline analysis

Paph analysis WCET Bound

Initial Study

Page 34: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

34

CFG Building decodes, i.e. identifies instructions, and reconstructs the control-flow graph (CFG)

from a binary program.

Value Analysis computes value ranges for registers and memory cells, and address ranges for

instructions accessing memory. Value analysis tries to determine the values in the processor memory

for every program point and execution context. Its results are used to determine possible addresses

of indirect memory accesses —important for cache analysis— and in loop bound analysis.

Loop Bound Analysis determines upper bounds for the number of iterations of simple loops. WCET

analysis requires that upper bounds for the iteration numbers of all loops be known.

Cache Analysis classifies memory references as cache misses or hits.

Pipeline Analysis predicts the behavior of the program on the processor pipeline. Pipeline analysis

models the pipeline behavior to determine execution times for sequential flows (basic blocks) of

instructions.

Catholic University

PUCRS

[email protected]

Initial Study

Path Analysis determines a worst-case execution path of the program. Using the results of the micro-

architecture analyses, path analysis determines a safe estimate of the WCET. The program’s control

flow is modeled by an integer linear program [14] so that the solution to the objective function is the

predicted worst-case execution time for the input program.

[14] H. Theiling. ILP-based interprocedural path analysis. In A. L. Sangiovanni-Vincentelli and J. Sifakis, editors, Proceedings of

EMSOFT 2002, Second International Conference on Embedded Software, volume 2491 of Lecture Notes in Computer Science,

pages 349–363. Springer-Verlag, 2002.

Page 35: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

35 Catholic University

PUCRS

[email protected]

Initial Study

Task1 Task2

Time Slice

PREEMPTION

LOW

HIGH

Prio

rity

Task1 and Task2 have

the same priority and

that they do not posses

external dependencies

Task1

While a third task (Task3) with higher priority

is blocked and waiting for an external event,

but during Task1 execution this dependency is

solved

Task3

Then, the RTOS stops the

current task (Task1) execution

and switches to Task3.

Task1

Since this task has the highest

priority, it will be executed

completely before returning to the

interrupted Task1.

IP triggers the initial execution time IP triggers the completion time

The RTOS-G checks if the execution time of a given task fits inside the

estimated WCET.

Page 36: Design of On-Chip Cores and Sensors to Improve Embedded ...Fabian Vargas obtained his Ph.D. Degree in Microelectronics from the Institut National Polytechnique de Grenoble (INPG),

[email protected] 36

The RTOS-G checks if the time required by the RTOS to reschedule due

to a semaphore already taken fits inside the estimated WCET.

Task1

...

SemaphoreLock()

...

SemaphoreLock() {

//semaphore is locked

ReSchedule()

}

...

RTOS Kernel Task2

running

blocked

Task1 is running and tries to acquire a semaphore. Then,

system call is performed.

The RTOS kernel realizes that the semaphore is already

locked. In order to prevent the system from going into a

deadlock as well as to increase the CPU usage, the kernel

performs a CS calling another task into execution.

When the RTOS-G detects this flow, it will infer that Task2

is the next to run and therefore it is taken out from the

ready-list.

In conclusion: the execution flow for an ―already locked

semaphore‖ consists of: SemaphoreLock() and

ReSchedule().

A similar analysis can be performed for other situations,

always concentrating all efforts in keeping the detection

algorithm generic enough for any RTOS or processor.

Catholic University

PUCRS

Initial Study