Download presentation
Presentation is loading. Please wait.
Published byJaelyn Whitcraft Modified over 10 years ago
1
courseware Abstract RTOS Modelling for Multi-Processor SoC using SystemC Prof. Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens Plads, Building 321 DK2800 Lyngby, Denmark
2
SoC-MOBINET coursewareJan Madsen2 Motivation 1 3 4 2 abc 1 2 os 3 4 mapping abc
3
SoC-MOBINET coursewareJan Madsen3 Principles of mapping 1 2 3 Partitioning/clustering Break processes to increase parallelism Cluster processes to reduce communication Allocation a b Mapping Scheduling Communication 1 32 a b 1 2 & 3 deadline
4
SoC-MOBINET coursewareJan Madsen4 Motivation rtos a b c d network
5
SoC-MOBINET coursewareJan Madsen5 Uni-processor... rtos a b c d network
6
SoC-MOBINET coursewareJan Madsen6 Uni-processor... rtos a Framework to experiment with different RTOS strategies Focus on analysis of timing and resource sharing Abstract software model, i.e. no behavior/functionality Easy to create tasks and implement RTOS models Based on SystemC
7
SoC-MOBINET coursewareJan Madsen7 System model rtos a
8
SoC-MOBINET coursewareJan Madsen8 System model rtos
9
SoC-MOBINET coursewareJan Madsen9 System model rtos
10
SoC-MOBINET coursewareJan Madsen10 System model Task messages: ready finished RTOS commands: run preemept Resume rtos task scheduler links
11
SoC-MOBINET coursewareJan Madsen11 System model - SystemC pa = new task("task_a",1,50,3,12,0,ready); registerTask(pa); pb = new task("task_b",2,40,2,10,0,ready); registerTask(pb); pc = new task("task_c",3,30,1,10,0,ready); registerTask(pc); rtos identifier period priority offset WCET
12
SoC-MOBINET coursewareJan Madsen12 Link model Aim: Adding tasks without having to create seperate communication links Uses the SystemC master- slave library If two tasks send a message at the same time – they are executed in sequence, but in undefined order Global ”clock” is used to keep track of time rtos clock
13
SoC-MOBINET coursewareJan Madsen13 Task model r1r1 r 1 = time at which task becomes released (or active) e1e1 e 1 = worst case execution time (WCET) d 1 = deadline, task should complete before this! d1d1 s1s1 s 1 = time at which task starts its execution T1T1 T 1 = period, minimum time between task releases 1 o 1 = offset (or phase) for first released o1o1
14
SoC-MOBINET coursewareJan Madsen14 Task model idle runningpreempt ready C p >0 !run !resume run C p ==0ready preempt resume C r ==0 finish & C r >0 !preempt
15
SoC-MOBINET coursewareJan Madsen15 SC_MODULE(perTask){ sc_outmaster out_message; sc_inslave in_command; sc_in_clk clock; sc_event newStateEvent; void next_state(); void update_state(); void get_comm_from_scheduler(); SC_HAS_PROCESS(perTask); perTask(sc_module_name name_, int id_,...) : sc_module(name_),id(id_),...) { SC_METHOD(next_state); sensitive << newStateEvent; SC_METHOD(update_state); sensitive << clock; SC_SLAVE(get_comm_from_scheduler,in_command); } private: t_state state, new_state; Task model - SystemC new_state state
16
SoC-MOBINET coursewareJan Madsen16 Scheduling model Aim: Simple way to describe the scheduling algorithm Scheduler should only handle one message at a time Rate-monotonic scheduling preemptive WCET d=T Fixed priority rtos scheduler
17
SoC-MOBINET coursewareJan Madsen17 void RM_scheduler::doSchedule() { ti = in_message; if (ti.comm==ready) { Q.push(ti); } else { tk.id = 0; } tj = Q.top(); if (tj.id != 0) { if (tk.id != 0) { if (tk < tj) { out_command = *(preemptTask(&tk, &Q)); tk = tj; out_command = *(runTask(&tj, &Q)); } else { } } else { tk = tj; out_command = *(runTask(&tj, &Q)); } } else { } Scheduling model - SystemC ti: message received from from task i tj: message from task j with highest priority from ready list tk: message of the currently running task Rate monotonic scheduling
18
SoC-MOBINET coursewareJan Madsen18 An example p3p3 p2p2 p1p1 50 40 30 0203040506010 1 3 2 1 2 3 priorityeiei TiTi 1030 1040 12 50 2 3 1
19
SoC-MOBINET coursewareJan Madsen19 An example p3p3 p2p2 p1p1 50 40 30 0203040506010 1 3 2
20
SoC-MOBINET coursewareJan Madsen20 Extending the task model Varying execution times [e min :e max ] r1r1 e min d1d1 s1s1 T1T1 1 e max
21
SoC-MOBINET coursewareJan Madsen21 Extending the task model Varying execution times [e min :e max ] Context switching Data dependencies r1r1 d1d1 s1s1 T1T1 1
22
SoC-MOBINET coursewareJan Madsen22 Data dependencies synchronizer scheduler
23
SoC-MOBINET coursewareJan Madsen23 Resource sharing synchronizer scheduler allocator
24
SoC-MOBINET coursewareJan Madsen24 Multi-processors rtos a b c d network
25
SoC-MOBINET coursewareJan Madsen25 Multi-processors rtos b c a d network
26
SoC-MOBINET coursewareJan Madsen26 Multi-processors rtos b c
27
SoC-MOBINET coursewareJan Madsen27 Multi-processors synchronizer scheduler
28
SoC-MOBINET coursewareJan Madsen28 Example 1 3 4 2 oioi TiTi eiei 042 062+2 463 1 2 4 3 b os 4 a 1 2 3
29
SoC-MOBINET coursewareJan Madsen29 Dynamic scheduling b os 4 a 1 2 3 0468102141612 1 2 a 0468102141612 3 4 b RM
30
SoC-MOBINET coursewareJan Madsen30 Changing synchronization protocol 0468102 0468 2 141612 141612 b os 4 a 1 2 3 1 3 2 4 a b RMEDF
31
SoC-MOBINET coursewareJan Madsen31 Multi-processing anomalies Assume a set of tasks optimally scheduled on a multiprocessor system with: fixed number of processors fixed execution times (e i ) precedence constraints Then changing the priority list increasing the number of processor reducing execution times weakening the precedence constraints May increase the scheduling length!
32
SoC-MOBINET coursewareJan Madsen32 Example of anomalies 1 3 2 45 1 3 2 45 Reduce e 1 of task 1 a b a b Task 2 and 4 are sharing a resource, i.e. mutually exclusion 13 42 5
33
SoC-MOBINET coursewareJan Madsen33 Consequences of anomalies Tasks may complete before their WCETs So most on-line scheduling algorithms are subject to experience anomalies Simple but inefficient solution: Have tasks completing early idle
34
SoC-MOBINET coursewareJan Madsen34 Network-on-Chip extension b os a c L1L1 L2L2 L3L3 S1S1 S2S2 S3S3 1 3 4 2 3 25 4 1 5 mxmx mzmz mymy m x : S 1,L 3,S 3,L 2,S 2
35
SoC-MOBINET coursewareJan Madsen35 Network-on-Chip model
36
SoC-MOBINET coursewareJan Madsen36 Design space exploration bus 4,5 c 3b3b 1,2 a b a c bus 1 4 3 2 5 x y z b a c 1 4 3 2 5 x y z L1 L2 b a c L3 2 4 3 1 5 x y z z L1 L2 b a c L3 1 4 5 3 2 x x z y QoS Aware Any traffic from a has higher priority 1,2 a 3b3b 4,5 c L1 L2 L3 L1 L2 b a c L3 2 4 5 3 1 x x z y Timing Aware L3 L4 y x z b a c bus 1 4 3 2 5 z y x L1 L2 b a c 1 4 3 2 5 z L1 L3 b a c 1 4 3 2 5 z x x xy Allocation Aware Swap task on PEs to: 2,3 | 4,5 | 1 3b3b 4,5 c L1L2 L3 L4 L1 L2 b a c L3 2 4 3 1 5 x y z z 1,2 a
37
SoC-MOBINET coursewareJan Madsen37 Summary Simple SystemC based framework to study the dynamic behavior of a task set running under the supervision of an abstract RTOS Synchronizer to handle data dependencies Extension to multi-processor/RTOS systems Network-on-Chip extension (new) Not covered, Allocator to handle resource sharing Power estimation/profile Multi-processing anomalies (in your slides)
38
SoC-MOBINET coursewareJan Madsen38 References Scheduling in Real-Time Systems F. Cottet, J. Delacriox, C. Kaiser, Z. Mammeri John Wiley & Sons, 2002 Real-Time Systems J. W. S. Liu Printice Hall, 2000 Real-Time Systems and Programming Languages A. Burns, A. Wellings Addison-Wesley, 2001 (third edition) System Design with SystemC T. Grotker, S. Liao, G. Martin, S. Swan Kluwer, 2002
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.