0% found this document useful (0 votes)
15 views8 pages

2023 Nosolution

The document outlines the structure and rules for the IL2212 Embedded Software written exam scheduled for March 17, 2023. It details allowed materials, instructions for answering questions, grading criteria, and specific tasks divided into three parts (A, B, C) with various questions related to embedded software systems. To pass, students must achieve a minimum score of 60 points overall and at least 16 points in each part.

Uploaded by

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

2023 Nosolution

The document outlines the structure and rules for the IL2212 Embedded Software written exam scheduled for March 17, 2023. It details allowed materials, instructions for answering questions, grading criteria, and specific tasks divided into three parts (A, B, C) with various questions related to embedded software systems. To pass, students must achieve a minimum score of 60 points overall and at least 16 points in each part.

Uploaded by

changyusong123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

W RITTEN E XAM

IL2212 Embedded Software


2023-03-17, 14.00 – 18.00

Examiner: Ingo Sander

Material
The student is only allowed to use the following material in the exam:
• Writing material: pen, pencil, rubber, ruler

• Calculator
Instructions
• Use only the front side of each paper sheet for your answers.
• Write your name and ”personnummer” on each page of your answer sheets.

• Write your answers in English or Swedish.


• Underline the final result, important intermediate results and keywords.
• Ensure that answers are clear and convincing. It is not the task of the examiner to guess what the
student wanted to say with the answer.

• Answers without motivation may give 0 points.


• Provide only one answer to each question.
• If only a minor part of the correct answer is given no points may be awarded.

Grading
The total number of points in the exam is 120. The exam contains three parts (Part A, Part B, and Part C),
where each part contains 40 points. To pass the exam, the following is required:
• 60 points of the total points, where the bonus points achieved in the laboratory course of this study
year will be counted towards the total points, and
• 16 points in each part of the exam. For the individual parts, bonus points will not be counted.

If the student does not achieve 50% of the total points, or if the student fails two individual parts of the
exam, the student will receive the grade F.
The grade is given by the sum of the points scored in the exam according to the following grading table.

Points Points Points Total


Part A Part B Part C Points Grade Comment
16 – 40 16 – 40 16 – 40 108 or more A
16 – 40 16 – 40 16 – 40 96 – 107 B
16 – 40 16 – 40 16 – 40 84 – 95 C
16 – 40 16 – 40 16 – 40 72 – 83 D
16 – 40 16 – 40 16 – 40 60 – 71 E
0 – 15 16 – 40 16 – 40 60 or more FX Possible completion exam on Part A
16 – 40 0 – 15 16 – 40 60 or more FX Possible completion exam on Part B
16 – 40 16 – 40 0 – 15 60 or more FX Possible completion exam on Part C
In all other cases F

NOTE: In case a student receives the grade FX, the student has the possibility to take a completion exam
on the part, where less than 40% of the points were scored. The student has to inform the examiner
within seven days after the publication of the result, that the student wants to take the opportunity to take a
completion exam. In case of a passed completion exam, the grade E is awarded, a failed completion exam
results in the grade F.

G OOD L UCK !

2
Part A
(Part A corresponds to the following intended learning outcome of the course: The student shall be able to
use different models of computation for specification of embedded software systems.)

1. (PART A, 8 POINTS ) Given is the following Petri net.


(a) Is it guaranteed that the Petri net reaches a final state after a finite number of firings? Motivate!
(b) Give all possible final states of this Petri net. You do not need to draw the Petri-nets for the
final solution(s), but need only to give the number of tokens in each place pi .

p1 p2 p4

t1 t2 t3 t4

p3 p5 p6

t5

p7

2. (PART A, 20 POINTS ) Given is the following synchronous data flow graph.

x y
1 2 3 2 1 1
sin A B C sout

(a) Represent the SDF-graph mathematically.


(b) Use this representation to calculate the smallest possible values for x and y, so that a periodic
admissible sequential schedule exists.
(c) Give the schedule with the minimal buffer requirements. What are the required buffer sizes for
this schedule?
(d) Give a periodic admissable sequential schedule for the following cyclo-static data-flow graph.

1 2 2,1 2 4 1
sin A B C sout

3
3. (PART A, 4 POINTS ) Lustre and Esterel are members of the family of synchronous languages which
are based on the perfect synchrony hypothesis.
What is the main assumption of this hypothesis?
4. (PART A, 8 POINTS ) Given is the following Lustre program.

1 node prog(a, b: bool) returns (y: bool);


2 let
3 y = false -> if b then
4 false
5 else
6 if a or pre(y) then
7 true
8 else
9 false;
10 tel.

Analyse the program for the node prog and complete the missing information in the following
output. The execution trace should be read as follows. In step 1 the input values for a and b are both
f (False), and the output y has the value f (False). In step 2 the input value for a is t (True)
and the input value for b is f (False). The output value n1 shall be derived by the student.

1 inputs "a":bool "b":bool


2 #outputs "y":bool
3 #step 1
4 f f #outs f
5 #step 2
6 t f #outs n1?
7 #step 3
8 f f #outs n2?
9 #step 4
10 t f #outs n3?
11 #step 5
12 f t #outs n4?

Give the missing output values n1, n2, n3, and n4!

4
Part B
(Part B corresponds to the following intended learning outcome of the course: The student shall be able to
use advanced models and methods for the analysis of embedded real-time systems.)

5. (PART B, 14 P OINTS ) A system contains four jobs. There are two resources X and Y. The following
table shows the job parameters and their execution pattern. The execution pattern describes how each
job is executed. [R;t] is read as follows: the job requires the resource R for t time units. Here, job
J3 requires no resource for one time unit, the resource Y for two time units and no resource for one
further time unit.

Job ri ei πi Execution Pattern


J1 6 3 1 [-;1][Y;1][-;1]
J2 3 4 2 [-;1][X;2][-;1]
J3 2 4 3 [-;1][Y;2][-;1]
J4 0 4 4 [-;1][X;2][-;1]

Use the basic priority-ceiling protocol to schedule the system of jobs. Give the schedule and show
also the current priority ceiling and the current priority of the executing job at all time instants.
6. (PART B, 14 P OINTS ) Assume that a system consists of the following tasks. T1 = (5, 1) is a polling
server, task T2 = (6, 2) is a deferrable server, while task T3 = (9, 2) is a periodic task. The system is
scheduled using the rate-monotonic algorithm. Assume that the polling server is handling aperiodic
jobs with a firm deadline, and the deferrable server serves aperiodic jobs with a soft deadline.
The following two jobs are released:

• an aperiodic job with soft deadline, A, with an execution time 4 is released at time 4;
• an aperiodic job with firm deadline, S, with an execution time 2 and an absolute deadline of 8
is released at time 3.

(a) Draw the schedule containing all the necessary information for this set of task to give the
answers to the following questions:
(b) When will the aperiodic job with soft dealine, A, complete?
(c) Can the aperiodic job with firm deadline, S, be accepted? When would it complete?

5
7. (PART B, 12 P OINTS ) A system consists of six jobs J1 , J2 , . . . , J6 . The release time ri , the absolute
deadline di and the execution time ei for each job is given in the following table.

Job ri di ei
J1 1 4 3
J2 0 10 6
J3 3 14 7
J4 9 22 6
J5 2 17 6
J6 8 20 2

J1 is the immediate predecessor of J2 , J3 , J4 and J5 . J6 is the immediate successor of J2 , J3 , J4


and J5 . There are no further precedence constraints.
A job Ji is the immediate predecessor of a job Jk , if Jk can first be executed when Ji has completed.
A job Ji is the immediate successor of a job Jk , if Ji can first be executed when Jk has completed.

(a) Draw the precedence graph of the jobs.


(b) Assume that the jobs can be executed on two processors, where jobs may be preempted but
never migrated. Schedule the jobs using a priority-driven scheduling algorithm with the priority
order J1 , J2 , . . . , J6 , where J1 has the highest priority. Will all jobs meet their deadlines?
(c) Assume that due to a faster algorithm, the execution time for job J3 is reduced to e3 = 4. Give
the schedule for this case. Will all jobs meet their deadlines?

6
Part C
(Part C corresponds to the following intended learning outcome of the course: The student shall be able to
use methods for generation of software from high-level models.)

8. (PART C, 10 P OINTS ) As part of the design space exploration phase, a number of candidate solu-
tions have been generated and their performance figures are summarised in the following table. The
performance numbers are normalised. In all cases (execution time, power consumption, design cost)
a lower number is better!

Candidate Execution Power Design


Solution Time (E) Consumption (P ) Cost (C)
A 10 45 30
B 29 40 10
C 35 15 21
D 24 32 14
E 46 12 25
F 38 37 8

(a) Determine graphically the Pareto points, if only execution time and power consumption are
taken into account (design cost is ignored).
(b) Determine the Pareto points, if all three performance figures (execution time, power consump-
tion, design cost) are taken inte account. Motivate your answer!

9. (PART C, 15 P OINTS ) Given is the following Lustre code, which shall be compiled into a finite
state machine implementation in C. As a first step, a finite state machine control structure shall be
generated before the C-code is generated based on this finite state machine. The generation of the
C-code is not part of this task!

1 node prog(a, b: bool) returns (y: bool);


2 let
3 y = false -> if b then
4 false
5 else
6 if a or pre(y) then
7 true
8 else
9 false;
10 tel.

(a) Choose suitable state variables as starting point to create the control structure based on a finite
state machine (automaton).
(b) Show, how to create the control structure as a finite state machine by starting from the initial
state and then simulating the behaviour of the state variables.
(c) Draw the state diagram of the resulting finite state machine.

You do not have to give the C-code for the implementation.

7
10. (PART C, 15 P OINTS ) The following synchronous data flow (SDF) model shall be implemented in
the programming language C.

1 1 2 1
sin A B sout
2
1 2

• Assume that empty FIFO-buffers with the correct size have been already created as data type
channel for all arcs including the input and output arc. Use the following names for the FIFO
buffers: s_in, arc_ab, arc_ba, and s_out. You do not have to create these FIFOs in your
code.
• The actors execute the following functions during each firing, where all tokens (modelled with
data type token) are integer variables (int):
– Actor A: The actor shall read one token from the channel s_in, one token from the chan-
nel arc_ba, calculate the sum of these tokens and write the result to arc arc_ab.
– Actor B: The actor shall read two tokens from the channel arc_ab, calculate first the sum
of both tokens and write the result both to s_out and arc_ba, and then calculate the
product of both tokens and write the result to arc_ba.
• There are two initial integer tokens on the arc between actor A and actor B. The tokens shall
have the initial value 0.
• Assume that the following functions already exist, which shall be used to read tokens from and
write tokens to a FIFO buffer:
– void read_token(channel ch, token* data): reads a token from channel
ch. The read token can be accessed via the variable data.
– void write_token(channel ch, token data): writes a token data to
channel ch.

(a) Determine the output signal sout , if the input signal is sin has the following sequence of input
values: {1, 2, 3}.
(b) Complete the following code skeleton and write a C-program that implements the functionality
of the SDF-graph in an infinite loop. You shall not assume any additional library functions than
the functions read_token and write_token (defined above).

1 int main() {
2 /* Channels (FIFO-buffers) s_in, s_out, arc_ab, arc_ba
3 exist already and do not need to be implemented */
4 ...
5

6 /* Initial tokens in FIFO buffer on arc_ab */


7 /* i. Give the code for the initial tokens on arc_ab
8 ==> Your code! */
9 while(1) {
10 /* ii. Give the code to execute the periodic schedule B,A,A
11 ==> Your code! */
12 }
13 return 0;
14 }

i. Give the code for creating the initial tokens on the FIFO buffer (channel) arc_ab.
ii. Give the code to execute the periodic schedule, where the actors fire in the following order:
B,A,A.

You might also like