54
1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 7: Models and Architecture Synthesis Yun Cheng [email protected] 9/11 Dec 2020

Embedded Systems Exercise 7: Models and Architecture …

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

1Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Embedded Systems

Exercise 7:Models and Architecture Synthesis

Yun [email protected]

9/11 Dec 2020

2Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

2./4.12.20202

Exercise Structure

Goal of today’s exercise:• Understand the interaction of energy input, storage and use in energy harvesting systems,

maximum power point tracking and optimal application control

Agenda:§ Wednesday 16:15 – 17:00 Clicker quiz (recorded)

Lecture summary (recorded)Solving a sample task (recorded)Tasks of exercise 7 (recorded)Q & A

§ Friday 16:15 – 17:00 Solution discussion (recorded)Q & A

Available Assistants:§ Yun Cheng - TA§ Julian Keller - SA

Naomi Stricker

3Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Overview

• Summary of the Lecture

• Start solving the Exercise

• Discussion of the Solution

4Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

• Specification Models:– DG/MG/space exploration/timeing inequations

• Scheduling without resource constraints– ASAP/ALAP → Exercise 8

• Scheduling with resource constraints– List scheduling– Pipeline resources → Exercise 8– Integer Linear Programming (ILP) → Exercise 8

Scheduling

5Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Dependance Graph (DG)

• A dependence graph describes order relations for the execution of single operations or tasks.

• It represents parallelism in a program but no branches in control flow.

• W= a+b;• X= a*b;• Y= X+c;• Z=X-W;

6Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Scheduling : timing inequations Task 1

7Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Scheduling : timing inequations

Assume all operations consume 1 time unit.Based on the dependence graph: we start formulating timing constraints represented by inequations:

𝜏(𝑊) >= 𝜏(𝑡0)

𝜏(𝑋) >= 𝜏(𝑡0)

𝜏(𝑌) >= 𝜏(𝑋) + 1

𝜏(𝑍) >= 𝜏(𝑋) + 1

𝜏(𝑍) >= 𝜏(𝑊) + 1

Task 1

8Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Design space exploration

• For schedule, we try to minimize latency and cost (multi-objective optimization)

• Its goal is finding a balance between the number of resources used and the latency for executing the program, and choosing an implementation according to the available resources and any constraints on latency

Task 2

costs

Latency

bestbest

pareto optimal point

9Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Pareto Points

Pareto Points : points that are not dominated by any other nodes

10Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Pareto Set

11Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Design space exploration Example

• No of resources =1• Latency =4

• No of resources =2• Latency =2

• No of resources =3• Latency =2 Pareto Points ?

12Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Marked Graphs Task 3

Activated node consumes one token from input and produce one to the output

13Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Marked Graph Example

Given the 2 nodes in the marked graph, How many times can node B fire before Node A has to fire to enable node B firing again?

14Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

• Consider resource constraints– Assignment of priority to the tasks is required

• For every point in time, not just at events like ALAP

• Algorithm is heuristic– Does not yield optimal solution (min. latency)

Task 4

15Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling Example

x

+

-

<

nop

x

nop

x

+

1 multiplier, duration: 2

1 ALU, duration: 1

Allocation of resources

Determine Schedule for this resource constrained sequence graph:1. Resource constrained2. Priority : #follow-up nodes

x

+

-

<

nop

x

nop

1 3 3

2

1

16Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

Allocation: resource type #instancesBinding: operation resource type

Ready operations

Running operations

Starting operations

Step-1 : ready nodesStep-2 : running nodesStep-3 : choose nodes from ready

Step-4 : iterate to next time

17Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling Example

x

+

-

<

nop

x

nop

18Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling Example

x

+

-

<

nop

x

nop

x

+

1 multiplier, duration: 2

1 ALU, duration: 1

Allocation of resources

19Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling Example

Static priority assignment:# follow-up nodes

x

+

-

<

nop

x

nop

1 3 3

2

1

Priority Assignment

20Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

x

+

-

<

nop

x

nop

1 3 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 1: Determine candidates U

21Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

x

+

-

<

x

nop

1 3 3

2

1

nopnop time 0

time 1

time 2

time 3

time 4

time 5

Step 2: Determine running operations TList Scheduling

22Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

x

+

-

<

x

nop

1 3 3

2

1

nopnop time 0

time 1

time 2

time 3

time 4

time 5

Step 3: Choose S Ì U with max P and |S|+|T| £ aList Scheduling

23Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling Step 4: Schedule and iterate

x

+

-

<

x

nop

1 3 3

2

1

nop

-x

nop time 0

time 1

time 2

time 3

time 4

time 5

24Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

x

+

-

<

x

nop

1 3 3

2

1

nop

-x

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 1: Determine candidates U

25Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

x

+

-

<

x

nop

1 3 3

2

1

nop

-x

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 2: Determine running operations T

26Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

x

+

-

<

x

nop

1 3 3

2

1

nop

-x

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 3: Choose S Ì U with max P and |S|+|T| £ a

27Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

x

+

-

<

x

nop

1 3 3

2

1

nop

-x

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 4: Schedule and iterate

28Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling Step 1: Determine candidates U

x

+

-

<

x

nop

1 3 3

2

1

nop

-x

nop time 0

time 1

time 2

time 3

time 4

time 5

29Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List SchedulingStep 2: Determine running

operations T

x

+

-

<

x

nop

1 3 3

2

1

nop

-x

nop time 0

time 1

time 2

time 3

time 4

time 5

30Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

x

+

-

<

x

nop

1 3 3

2

1

nop

-x

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 3: Choose S Ì U with max P and |S|+|T| £ a

31Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-x

x

+

-

<

x

nop

1 3 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 4: Schedule and iterate

32Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-x

x

+

-

<

x

nop

1 3 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 1: Determine candidates U

33Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-x

x

+

-

<

x

nop

1 3 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 2: Determine running operations T

34Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-x

x

+

-

<

x

nop

1 3 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 3: Choose S Ì U with max P and |S|+|T| £ a

35Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-

<

xx

+

-

<

x

nop

1 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 4: Schedule and iterate

36Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-

<

xx

+

-

<

x

nop

1 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 1: Determine candidates U

37Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-

<

xx

+

-

<

x

nop

1 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 2: Determine running operations T

38Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-

<

xx

+

-

<

x

nop

1 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 3: Choose S Ì U with max P and |S|+|T| £ a

39Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

List Scheduling

nop

x+

-

<

x

nop

x

+

-

<

x

nop

1 3

2

1

nop time 0

time 1

time 2

time 3

time 4

time 5

Step 4: Schedule and iterate

40Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Exercise 7 – Solution

41Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 1 (1)

42Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 1 (1)

43Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task1 (1)

44Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 1 (2,3)

45Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 2

• No of resources =1• Latency =11

46Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 2

• No of resources =2• Latency =6

47Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 2

• No of resources =3• Latency =4

48Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 2

• No of resources =4• Latency =4

49Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 2

50Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 3 (I)

51Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Question 3 (II)

52Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 4

53Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 4 - Solution

1a) & 1b)

L = 8 - 0 = 8L = 8 - 0 = 8

54Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Task 4 - Solution

1c) Critical path is delayed by a multiplier → A multiplier should be added

1d) New latency = 71e) L = 7

Critical Path