• No results found

Approximation Techniques for Timing Analysis of Complex Real-Time Embedded Systems

N/A
N/A
Protected

Academic year: 2021

Share "Approximation Techniques for Timing Analysis of Complex Real-Time Embedded Systems"

Copied!
111
0
0

Loading.... (view fulltext now)

Full text

(1)

Mälardalen University Press Licentiate Theses No. 122

APPROXIMATION TECHNIQUES FOR TIMING ANALYSIS

OF COMPLEX REAL-TIME EMBEDDED SYSTEMS

Yue Lu

2010

School of Innovation, Design and Engineering Mälardalen University Press Licentiate Theses

No. 122

APPROXIMATION TECHNIQUES FOR TIMING ANALYSIS

OF COMPLEX REAL-TIME EMBEDDED SYSTEMS

Yue Lu

2010

(2)

Copyright © Yue Lu,2010 ISBN 978-91-86135-83-6 ISSN 1651-9256

Printed by Mälardalen University, Västerås, Sweden

Abstract

To date, many industrial embedded systems are very large, flexible, and highly configurable software systems, containing millions of lines of code and con-sisting of hundreds of tasks, many with real-time constraints, being triggered in complex, nested patterns. Furthermore, the temporal dependencies between tasks in such systems are difficult to determine analytically, and they vary the execution time and response time of tasks greatly. We refer to such systems as Complex Real-Time Embedded Systems (CRTES).

To maintain, analyze and reuse such CRTES is very difficult and expensive, which, nevertheless, offers high business value in response to great concern in industry. Moreover, in such context, not only the functional behavior of sys-tems has to be assured, but also non-functional properties such as the temporal behavior, i.e., the Worst-Case Response Time (WCRT) of the adhering tasks in systems has to be known. However, due to high complexity of such systems and the nature of the problem, the exact WCRT of tasks is impossible to find in practice, but may only be bounded. In addition, the existing relatively well-developed theories for modeling and analysis of real-time systems are having problems, which limit their application in the context. In this thesis, we ad-dress this challenge, and present a framework for approximate timing analysis of CRTES that provides a tight interval of WCRT estimates of tasks by the usage of three novel contributions.

The first contribution is a statistical approach to WCRT analysis of CRTES. The proposed algorithm combines Extreme Value Theory with other statistical methods in order to produce a probabilistic WCRT estimate, using response time data from either Monte Carlo simulations of a detailed model of the sys-tem, or time-stamped traces of the real system execution. The focus of the method is to give a WCRT prediction with a given probability of being ex-ceeded, which potentially could be considered as an upper bound on the WCRT estimate, especially in the case where conventional timing analysis methods

(3)

Abstract

To date, many industrial embedded systems are very large, flexible, and highly configurable software systems, containing millions of lines of code and con-sisting of hundreds of tasks, many with real-time constraints, being triggered in complex, nested patterns. Furthermore, the temporal dependencies between tasks in such systems are difficult to determine analytically, and they vary the execution time and response time of tasks greatly. We refer to such systems as Complex Real-Time Embedded Systems (CRTES).

To maintain, analyze and reuse such CRTES is very difficult and expensive, which, nevertheless, offers high business value in response to great concern in industry. Moreover, in such context, not only the functional behavior of sys-tems has to be assured, but also non-functional properties such as the temporal behavior, i.e., the Worst-Case Response Time (WCRT) of the adhering tasks in systems has to be known. However, due to high complexity of such systems and the nature of the problem, the exact WCRT of tasks is impossible to find in practice, but may only be bounded. In addition, the existing relatively well-developed theories for modeling and analysis of real-time systems are having problems, which limit their application in the context. In this thesis, we ad-dress this challenge, and present a framework for approximate timing analysis of CRTES that provides a tight interval of WCRT estimates of tasks by the usage of three novel contributions.

The first contribution is a statistical approach to WCRT analysis of CRTES. The proposed algorithm combines Extreme Value Theory with other statistical methods in order to produce a probabilistic WCRT estimate, using response time data from either Monte Carlo simulations of a detailed model of the sys-tem, or time-stamped traces of the real system execution. The focus of the method is to give a WCRT prediction with a given probability of being ex-ceeded, which potentially could be considered as an upper bound on the WCRT estimate, especially in the case where conventional timing analysis methods

(4)

ii

cannot be applied.

The second contribution is a concrete process of formally obtaining the ex-act value of both Worst-Case Execution Time (WCET) and WCRT of tasks by using upper-part binary search algorithms together with a timed model checker, after a semantic-preserving model transformation. The underline premise is that the size and complexity of CRTES have to be reduced such that they can be manageable by the model checking tool.

The third contribution is the application of an optimization algorithm, in this case a meta-heuristic search algorithm, on top of the traditional Monte Carlo simulation. Combining optimization and simulation has shown to yield substantially better results with respect to tight lower bounds on WCRT esti-mates of tasks in CRTES.

In addition, a number of tools have been implemented and used for the evaluation of the research results. These evaluations, using four simulation models depicting two fictive but representative industrial control applications, give clear indication that the proposed methods have the potential to be both applicable and useful in practice.

Swedish Summary

Många av dagens industriella inbyggda system ¨ar stora och komplicerade. De ¨ar programvarusystem som innehåller miljontals rader programkod och de består av hundratals k¨orbara programdelar (tasks). Programdelarna aktiveras i komplicerade m¨onster och de har realtidskrav – tidsm¨assigt korrekta beteen-den och beroenbeteen-den måste vara analyserbara, verifierbara och uppfyllda. Det ¨ar mycket svårt att analysera alla realtidskrav eftersom exekveringstid och svårf¨oruts¨agbara exekveringsberoenden mellan tasks kan variera kraftigt. I denna avhandling kallar vi dessa industriella inbyggda komplicerade program-varusystemen f¨or (eng.) Complex Real-Time Embedded Systems, eller CRTES. Det ¨ar mycket svårt att underhålla, utveckla och återanv¨anda dessa CRTES idag, då de ¨ar så komplicerade. Samtidigt så kan industrin inte kasta bort ex-isterande CRTES och utveckla nya CRTES från b¨orjan, då de representerar stora ekonomiska investeringar. F¨or att underl¨atta underhåll, utveckling och återanv¨andning av industriella inbyggda programvarusystem beh¨over industrin hj¨alp med nya metoder som kan s¨akerst¨alla systemens funktionella och icke-funktionella beteenden. Exempel på icke-icke-funktionella beteenden inkluderar dess tidsm¨assiga beteenden. Den l¨angsta m¨ojliga responstiden (eng. Worst-Case Response Time, eller WCRT) av ett programvausystems tasks måste s¨aker-st¨allas analytiskt, men på grund systemens h¨oga komplexitet kan det vara om¨oj-ligt att hitta exakta WCRT uppgifter i praktiken; de kan bara uppskattas. Yt-terligare ett problem ¨ar att de relativt v¨alutvecklade teorierna f¨or analys och modellering av realtidssytem ¨ar vanligtvis f¨or begr¨ansade f¨or att kunna till¨amp-as på CRTES.

I denna avhandling f¨oreslår vi ett ramverk f¨or analys av CRTES som h¨arled-er ett inth¨arled-ervall av WCRT-uppskattningar f¨or tasks. Detta ramvh¨arled-erk innehållh¨arled-er tre vetenskapliga bidrag.

Det f¨orsta bidraget ¨ar en ny statistisk metod f¨or WCRT analys av CRTES. Den f¨oreslagna algoritmen kombinerar extremv¨ardesteori med andra statistiska

(5)

ii

cannot be applied.

The second contribution is a concrete process of formally obtaining the ex-act value of both Worst-Case Execution Time (WCET) and WCRT of tasks by using upper-part binary search algorithms together with a timed model checker, after a semantic-preserving model transformation. The underline premise is that the size and complexity of CRTES have to be reduced such that they can be manageable by the model checking tool.

The third contribution is the application of an optimization algorithm, in this case a meta-heuristic search algorithm, on top of the traditional Monte Carlo simulation. Combining optimization and simulation has shown to yield substantially better results with respect to tight lower bounds on WCRT esti-mates of tasks in CRTES.

In addition, a number of tools have been implemented and used for the evaluation of the research results. These evaluations, using four simulation models depicting two fictive but representative industrial control applications, give clear indication that the proposed methods have the potential to be both applicable and useful in practice.

Swedish Summary

Många av dagens industriella inbyggda system ¨ar stora och komplicerade. De ¨ar programvarusystem som innehåller miljontals rader programkod och de består av hundratals k¨orbara programdelar (tasks). Programdelarna aktiveras i komplicerade m¨onster och de har realtidskrav – tidsm¨assigt korrekta beteen-den och beroenbeteen-den måste vara analyserbara, verifierbara och uppfyllda. Det ¨ar mycket svårt att analysera alla realtidskrav eftersom exekveringstid och svårf¨oruts¨agbara exekveringsberoenden mellan tasks kan variera kraftigt. I denna avhandling kallar vi dessa industriella inbyggda komplicerade program-varusystemen f¨or (eng.) Complex Real-Time Embedded Systems, eller CRTES. Det ¨ar mycket svårt att underhålla, utveckla och återanv¨anda dessa CRTES idag, då de ¨ar så komplicerade. Samtidigt så kan industrin inte kasta bort ex-isterande CRTES och utveckla nya CRTES från b¨orjan, då de representerar stora ekonomiska investeringar. F¨or att underl¨atta underhåll, utveckling och återanv¨andning av industriella inbyggda programvarusystem beh¨over industrin hj¨alp med nya metoder som kan s¨akerst¨alla systemens funktionella och icke-funktionella beteenden. Exempel på icke-icke-funktionella beteenden inkluderar dess tidsm¨assiga beteenden. Den l¨angsta m¨ojliga responstiden (eng. Worst-Case Response Time, eller WCRT) av ett programvausystems tasks måste s¨aker-st¨allas analytiskt, men på grund systemens h¨oga komplexitet kan det vara om¨oj-ligt att hitta exakta WCRT uppgifter i praktiken; de kan bara uppskattas. Yt-terligare ett problem ¨ar att de relativt v¨alutvecklade teorierna f¨or analys och modellering av realtidssytem ¨ar vanligtvis f¨or begr¨ansade f¨or att kunna till¨amp-as på CRTES.

I denna avhandling f¨oreslår vi ett ramverk f¨or analys av CRTES som h¨arled-er ett inth¨arled-ervall av WCRT-uppskattningar f¨or tasks. Detta ramvh¨arled-erk innehållh¨arled-er tre vetenskapliga bidrag.

Det f¨orsta bidraget ¨ar en ny statistisk metod f¨or WCRT analys av CRTES. Den f¨oreslagna algoritmen kombinerar extremv¨ardesteori med andra statistiska

(6)

iv

metoder f¨or att leverera en WCRT f¨or tasks. Metoden ger en WCRT uppskat-tning som kan betraktas som en ¨ovre gr¨ans av WCRT f¨or system d¨ar konven-tionell realtidsanalys inte kan till¨ampas.

Det andra bidraget ¨ar en konkret process f¨or att erhålla exakta v¨arden av v¨arsta m¨ojliga exekveringstider (eng. Worst-Case Execution Time, eller WCE-T) och WCRT av tasks genom att till¨ampa s¨okalgoritmer och formella metoder. Det tredje bidraget ¨ar kombinationen av optimeringsalgoritmer och tradi-tionell Monte Carlo-simulering vilket visar sig ge bra resultat f¨or l¨agre gr¨anser på WCRT av tasks i CRTES.

Alla bidrag har utv¨arderats på modeller av komplexa inbyggda program-varusystem och resultaten ger en tydlig indikation på att de f¨oreslagna metoder-na ¨ar praktiskt anv¨andbara.

One day, you might look up and see me playing the

game at 50. Don’t laugh. Never say never because

lim-its, like fears, are often just an illusion.

–Michael Jordan A Former American Professional Basketball Player and Active Businessman At Naismith Memorial Basketball Hall of Fame 2009

(7)

iv

metoder f¨or att leverera en WCRT f¨or tasks. Metoden ger en WCRT uppskat-tning som kan betraktas som en ¨ovre gr¨ans av WCRT f¨or system d¨ar konven-tionell realtidsanalys inte kan till¨ampas.

Det andra bidraget ¨ar en konkret process f¨or att erhålla exakta v¨arden av v¨arsta m¨ojliga exekveringstider (eng. Worst-Case Execution Time, eller WCE-T) och WCRT av tasks genom att till¨ampa s¨okalgoritmer och formella metoder. Det tredje bidraget ¨ar kombinationen av optimeringsalgoritmer och tradi-tionell Monte Carlo-simulering vilket visar sig ge bra resultat f¨or l¨agre gr¨anser på WCRT av tasks i CRTES.

Alla bidrag har utv¨arderats på modeller av komplexa inbyggda program-varusystem och resultaten ger en tydlig indikation på att de f¨oreslagna metoder-na ¨ar praktiskt anv¨andbara.

One day, you might look up and see me playing the

game at 50. Don’t laugh. Never say never because

lim-its, like fears, are often just an illusion.

–Michael Jordan A Former American Professional Basketball Player and Active Businessman At Naismith Memorial Basketball Hall of Fame 2009

(8)

To the Maomao World

Where there are only Maomaos, Xiao gougou, and the

Chocolate Factory.

(9)

To the Maomao World

Where there are only Maomaos, Xiao gougou, and the

Chocolate Factory.

(10)

Preface and

Acknowledgments

Now, we are going in the thanksgiving chapter, which is the hardest part for me to write, even to start, but might be the most interesting chapter (out of all the chapters in this whole thesis) for you to read. So let us drop the less “tasty” main course of the thesis for now, belt up and start this thanksgiving journey!

The journey started on a lovely summer day in Sønderborg, Denmark, back in the year 2005. I was graduated from the University of Southern Denmark by ending with a Master’s degree in Mechatronics, and I made up my mind to further my study to become a doctor1. After sending out countless

num-ber of application emails to different universities, I was luckily enough to be accepted by M¨alardalen Real-Time Research Centre (MRTC) in M¨alardalen University. Honestly speaking, I was really expecting this unexpected. Since I never, ever thought about starting my new dating with a caring, beautiful and elegant blonde! Thank you Hans Hansson, Christer Norstr¨om and Bj¨orn Lisper, for giving me this opportunity!

To me, this thesis is neither the end of the beginning of the journey, nor the beginning of the end of the journey. Instead, it takes me somewhere out there. Along with this rewarding journey, I have my pleasure to enjoy the scenery and experience life. Throughout these past years, I met different people around the world, with whom I had lots of fun, from whom I knew more about my weaknesses, and whom I would love to parrot. In the following context, I will categorize those people, who have played different roles in my short life. Supervisors Without yours encouragement, guidance and patience, I would never ever proceeded to the place where I am now.

1The doctor but not the kind that helps people.

(11)

Preface and

Acknowledgments

Now, we are going in the thanksgiving chapter, which is the hardest part for me to write, even to start, but might be the most interesting chapter (out of all the chapters in this whole thesis) for you to read. So let us drop the less “tasty” main course of the thesis for now, belt up and start this thanksgiving journey!

The journey started on a lovely summer day in Sønderborg, Denmark, back in the year 2005. I was graduated from the University of Southern Denmark by ending with a Master’s degree in Mechatronics, and I made up my mind to further my study to become a doctor1. After sending out countless

num-ber of application emails to different universities, I was luckily enough to be accepted by M¨alardalen Real-Time Research Centre (MRTC) in M¨alardalen University. Honestly speaking, I was really expecting this unexpected. Since I never, ever thought about starting my new dating with a caring, beautiful and elegant blonde! Thank you Hans Hansson, Christer Norstr¨om and Bj¨orn Lisper, for giving me this opportunity!

To me, this thesis is neither the end of the beginning of the journey, nor the beginning of the end of the journey. Instead, it takes me somewhere out there. Along with this rewarding journey, I have my pleasure to enjoy the scenery and experience life. Throughout these past years, I met different people around the world, with whom I had lots of fun, from whom I knew more about my weaknesses, and whom I would love to parrot. In the following context, I will categorize those people, who have played different roles in my short life. Supervisors Without yours encouragement, guidance and patience, I would never ever proceeded to the place where I am now.

1The doctor but not the kind that helps people.

(12)

x

• Christer Norstr¨om, who is my main supervisor. Thank you for deciding to employ me as a doctoral student in M¨alardalen University, guiding me as a big brother, helping me and believing in me when I was cracking those “nuts” on my research little by little. Though you have already changed your career to a more challenging position, I do hope we can retain this relationship, as I always treasure your experience in both work and life.

• Thomas Nolte, who is my assistant supervisor. Thank you for giving me timely help in time of need, constantly encouraging and helping me when I want to give up, teaching me the art of weighing my written words on a silver scale, being as a nice company at many conference trips that I really enjoyed, and appreciating me for what my research is. Now, I am more than ready to complete more challenging tasks together with you, and we are going to show people that chocolate jam and salami is actually a great combo!

• Johan Kraft, who is not officially one of my supervisors, but always im-presses me by his great insight, the positive and realistic attitude. In particular, I really appreciate your timely help on dragging me back to the reality, no matter how much I got myself overheated!

• Anders Wall, who is my assistant supervisor. Thank you for having the zestful discussions with me, which guided me to the right direction! • Iain Bate, who is not officially one of my supervisors, but helped me

quite a lot in terms of having countless fruitful discussions, authoring a few papers together, and giving me another chance to know more about my hometown. Iain, you deserve my thanks in this Section as well. • Ivica Crnkovic, who is also not officially one of my supervisors, but

showed me his optimism and desire to share his goals with others, hard work and perseverance with a positive attitude2. Till today, I still

re-membered the time when we shared the hotel room together, at the first PROGRESS trip to Santander, Spain, where a fledgling boy met a well-known professor.

2I would not be surprised if he won the best paper award, at the most prestigious software

engineering conference ICSE, at 70!

xi

Thesis reviewers Thank you Thomas Nolte and Christer Norstr¨om for re-viewing my thesis for many times, and helping me make the thesis in a better shape. I am also going to thank Ola Redell and Andreas Ermedahl, who accept to review the thesis as my opponent and examiner. In addition, many thanks go to my wife Shasha, Stefan Bygde and Thomas Nolte, for yours help on the Swedish version of my thesis summary!

Co-authors I have authored and co-authored 16 different papers. I would never ever have made that without my co-authors’ professional, persuasive and zestful discussions, perseverance, hard working and competitive nature. Thank you very much, Thomas Nolte, Johan Kraft, Christer Norstr¨om, Iain Bate, Stefan Bygde, Anders Wall, Markus Bohlin, Per Kreuger, Mikael Sj¨odin, Jukka M¨aki-Turja and Antonio Cicchetti. In addition, I am very grateful to Di-ane Pecorari, Linh Thi Xuan Phan, Emma Nehrenheim, Monica Odlare, Hans Hansson, Jan Carlsson, and Bj¨on Lisper for their constructive comments and improvement suggestions that we desperately needed. Thank you all!

Friends and colleagues I want to express my heartfelt thanks and immense appreciation to Cristina Seceleanu, Aida Causevic3, S´everine Sentilles, Aneta

Vulgarakis, Hongyu Pei-Breivold, Stefan Bygde4, Dag Nystr¨om, Farhang

Ne-mati5, Moris Behnam, Adnan Causevic, Leo Hatvani, H¨useyin Aysan, Mikael

Åsberg, Insik Shin, Juraj Feljan, Rikard Land, Fredrik Ekstrand, Tiberiu Se-celeanu, Radu Dobrin, Pasqualina Potena, Rui Santos, Veronica Bohlin, Jo-han Fredriksson, Hogler Kienle, J¨orgen Lidholm, Adam Betts, Frank L¨uders, Helena Jerregård, Marcelo Santos, Sara Dersten, Nikola Petrovic, Andreas Gustavsson, Kathrin Dannmann, Batu Akan, Rafia Inam, Saad Mubeen, Eti-enne Borde, Thomas Leveque, Antonio Cicchetti, Federico Ciccozzi, Mehrdad Saadatmand, Ana Petricic, Jospi Maras, Luka Lednicki, Eun-Young Kang, Ja-gadish Suryadevara, Andreas Hjertstr¨om and Andreas Johnsen. Thanks for your appreciating and accepting me for who I am, giving me motivations that I desperately needed, and changing me without letting me knowing. So I must say thank you all!

Next, I would love to thank Åsa Lundkvist, Malin Rosqvist, Harriet Ek-wall, Monica Wasell, Carola Ryttersson, Hans Hansson, Thomas Nolte, Damir Isovic, Jan Gustafsson, Lars Asplund, Paul Pettersson, Gunnar Widforss, and

32 in 1.

4Dear Xiaobai, thanks for your never giving me up when I was screwing up, and your constantly

correcting me in terms of “beating” me hands down, even when I was not completely wrong.

(13)

x

• Christer Norstr¨om, who is my main supervisor. Thank you for deciding to employ me as a doctoral student in M¨alardalen University, guiding me as a big brother, helping me and believing in me when I was cracking those “nuts” on my research little by little. Though you have already changed your career to a more challenging position, I do hope we can retain this relationship, as I always treasure your experience in both work and life.

• Thomas Nolte, who is my assistant supervisor. Thank you for giving me timely help in time of need, constantly encouraging and helping me when I want to give up, teaching me the art of weighing my written words on a silver scale, being as a nice company at many conference trips that I really enjoyed, and appreciating me for what my research is. Now, I am more than ready to complete more challenging tasks together with you, and we are going to show people that chocolate jam and salami is actually a great combo!

• Johan Kraft, who is not officially one of my supervisors, but always im-presses me by his great insight, the positive and realistic attitude. In particular, I really appreciate your timely help on dragging me back to the reality, no matter how much I got myself overheated!

• Anders Wall, who is my assistant supervisor. Thank you for having the zestful discussions with me, which guided me to the right direction! • Iain Bate, who is not officially one of my supervisors, but helped me

quite a lot in terms of having countless fruitful discussions, authoring a few papers together, and giving me another chance to know more about my hometown. Iain, you deserve my thanks in this Section as well. • Ivica Crnkovic, who is also not officially one of my supervisors, but

showed me his optimism and desire to share his goals with others, hard work and perseverance with a positive attitude2. Till today, I still

re-membered the time when we shared the hotel room together, at the first PROGRESS trip to Santander, Spain, where a fledgling boy met a well-known professor.

2I would not be surprised if he won the best paper award, at the most prestigious software

engineering conference ICSE, at 70!

xi

Thesis reviewers Thank you Thomas Nolte and Christer Norstr¨om for re-viewing my thesis for many times, and helping me make the thesis in a better shape. I am also going to thank Ola Redell and Andreas Ermedahl, who accept to review the thesis as my opponent and examiner. In addition, many thanks go to my wife Shasha, Stefan Bygde and Thomas Nolte, for yours help on the Swedish version of my thesis summary!

Co-authors I have authored and co-authored 16 different papers. I would never ever have made that without my co-authors’ professional, persuasive and zestful discussions, perseverance, hard working and competitive nature. Thank you very much, Thomas Nolte, Johan Kraft, Christer Norstr¨om, Iain Bate, Stefan Bygde, Anders Wall, Markus Bohlin, Per Kreuger, Mikael Sj¨odin, Jukka M¨aki-Turja and Antonio Cicchetti. In addition, I am very grateful to Di-ane Pecorari, Linh Thi Xuan Phan, Emma Nehrenheim, Monica Odlare, Hans Hansson, Jan Carlsson, and Bj¨on Lisper for their constructive comments and improvement suggestions that we desperately needed. Thank you all!

Friends and colleagues I want to express my heartfelt thanks and immense appreciation to Cristina Seceleanu, Aida Causevic3, S´everine Sentilles, Aneta

Vulgarakis, Hongyu Pei-Breivold, Stefan Bygde4, Dag Nystr¨om, Farhang

Ne-mati5, Moris Behnam, Adnan Causevic, Leo Hatvani, H¨useyin Aysan, Mikael

Åsberg, Insik Shin, Juraj Feljan, Rikard Land, Fredrik Ekstrand, Tiberiu Se-celeanu, Radu Dobrin, Pasqualina Potena, Rui Santos, Veronica Bohlin, Jo-han Fredriksson, Hogler Kienle, J¨orgen Lidholm, Adam Betts, Frank L¨uders, Helena Jerregård, Marcelo Santos, Sara Dersten, Nikola Petrovic, Andreas Gustavsson, Kathrin Dannmann, Batu Akan, Rafia Inam, Saad Mubeen, Eti-enne Borde, Thomas Leveque, Antonio Cicchetti, Federico Ciccozzi, Mehrdad Saadatmand, Ana Petricic, Jospi Maras, Luka Lednicki, Eun-Young Kang, Ja-gadish Suryadevara, Andreas Hjertstr¨om and Andreas Johnsen. Thanks for your appreciating and accepting me for who I am, giving me motivations that I desperately needed, and changing me without letting me knowing. So I must say thank you all!

Next, I would love to thank Åsa Lundkvist, Malin Rosqvist, Harriet Ek-wall, Monica Wasell, Carola Ryttersson, Hans Hansson, Thomas Nolte, Damir Isovic, Jan Gustafsson, Lars Asplund, Paul Pettersson, Gunnar Widforss, and

32 in 1.

4Dear Xiaobai, thanks for your never giving me up when I was screwing up, and your constantly

correcting me in terms of “beating” me hands down, even when I was not completely wrong.

(14)

xii

those who persevere with a positive attitude of creating a more comfortable, friendly and international working environment at the IDT department. So thank you all! One day you will get karmic paybacks!

By the chance, I also want to thank my another lovely friend basketball. I really appreciate your more than 10 years accompany and your always-be-there-for-me, especially at the moment when I needed comfort and peace, a place of refuge. Maybe someday I am too old to play with you physically, but we will still carry on the dream till that day comes. Our most spectacular play is the next one!

The important people In the end, if there was something matters more than others. I want to thank my mother Tianrong Liu and my father Yingcai Lu, who are there for me many years of grace, for your love, for your bearing my bad temper, for your teaching and showing me the value of knowledge and life, and for your parenting me till today (though I am quite approaching to my thirtieth year!). I love everything you two have done for me to death, without a doubt!6

Last but not least, my thanksgiving messages are delivered to my dear wife Shasha7: Without your love, support, perseverance, tolerance and patience,

endless effort on making me a better person (though I am still working on it now), and your sweet accompanying me for 7 years8, I would never, ever have

come this far. So thank you, and I love you all!

The liabilities The work leading up to this thesis was supported by the Swedi-sh Foundation for Strategic Research via the strategic research centre Progress. Thank you Kristina Lundqvist, Cristina Seceleanu, Thomas Nolte, Hans Hans-son, Ivica Crnkovic, Christer Norstr¨om, Bj¨orn Lisper, Paul PettersHans-son, Sasiku-mar Punnekkat, Andreas Ermedahl, Jan Carlson and Gunnar Widforss. With-out you, Progress will never ever proceeded to the place where it is now. Thank you for providing me this excellent opportunity, and let’s make it better!

Till next time!

Yue (Luis) Lu V¨asterås, September 23rd, 2010

6Though, sometimes, you might think that I may think you were “nagging me” too much, I

would love to take the chance to dispel this misconception. As your son, I am happy to be the one, whom you can always turn to, and share something with!

7Otherwise, I will get a bunch of complaints without a doubt. 8I think it is correct, since I did some math based on my bad memory.

Nothing Rhymed I

Life is just one seven-day after another seven-day.

A day passes in terms of closing your eyes at night and

opening them in morning; a life passes after you close

your eyes but without being aware that you cannot open

them again. Then what is left? Only blanks...

However, just because of these blanks that are between

black keys on a piano, an “Unfinished Symphony” does

sound perfect. Dear, listen and gaze for awhile, who is

playing it now? Mr. Schubert, or Gaga? Or just you

and me...

Writing the thanksgiving chapter is a very lovely thing.

Receiving the thanks is a very happy thing. Every time,

when we deliver those thanksgiving messages to each

other, we are luckily enough to be reconnected, and we

are seized by fate again...

–Yue (Luis) Lu

A nerd in lonely ballet, September, 2010

(15)

xii

those who persevere with a positive attitude of creating a more comfortable, friendly and international working environment at the IDT department. So thank you all! One day you will get karmic paybacks!

By the chance, I also want to thank my another lovely friend basketball. I really appreciate your more than 10 years accompany and your always-be-there-for-me, especially at the moment when I needed comfort and peace, a place of refuge. Maybe someday I am too old to play with you physically, but we will still carry on the dream till that day comes. Our most spectacular play is the next one!

The important people In the end, if there was something matters more than others. I want to thank my mother Tianrong Liu and my father Yingcai Lu, who are there for me many years of grace, for your love, for your bearing my bad temper, for your teaching and showing me the value of knowledge and life, and for your parenting me till today (though I am quite approaching to my thirtieth year!). I love everything you two have done for me to death, without a doubt!6

Last but not least, my thanksgiving messages are delivered to my dear wife Shasha7: Without your love, support, perseverance, tolerance and patience,

endless effort on making me a better person (though I am still working on it now), and your sweet accompanying me for 7 years8, I would never, ever have

come this far. So thank you, and I love you all!

The liabilities The work leading up to this thesis was supported by the Swedi-sh Foundation for Strategic Research via the strategic research centre Progress. Thank you Kristina Lundqvist, Cristina Seceleanu, Thomas Nolte, Hans Hans-son, Ivica Crnkovic, Christer Norstr¨om, Bj¨orn Lisper, Paul PettersHans-son, Sasiku-mar Punnekkat, Andreas Ermedahl, Jan Carlson and Gunnar Widforss. With-out you, Progress will never ever proceeded to the place where it is now. Thank you for providing me this excellent opportunity, and let’s make it better!

Till next time!

Yue (Luis) Lu V¨asterås, September 23rd, 2010

6Though, sometimes, you might think that I may think you were “nagging me” too much, I

would love to take the chance to dispel this misconception. As your son, I am happy to be the one, whom you can always turn to, and share something with!

7Otherwise, I will get a bunch of complaints without a doubt. 8I think it is correct, since I did some math based on my bad memory.

Nothing Rhymed I

Life is just one seven-day after another seven-day.

A day passes in terms of closing your eyes at night and

opening them in morning; a life passes after you close

your eyes but without being aware that you cannot open

them again. Then what is left? Only blanks...

However, just because of these blanks that are between

black keys on a piano, an “Unfinished Symphony” does

sound perfect. Dear, listen and gaze for awhile, who is

playing it now? Mr. Schubert, or Gaga? Or just you

and me...

Writing the thanksgiving chapter is a very lovely thing.

Receiving the thanks is a very happy thing. Every time,

when we deliver those thanksgiving messages to each

other, we are luckily enough to be reconnected, and we

are seized by fate again...

–Yue (Luis) Lu

A nerd in lonely ballet, September, 2010

(16)

Notes for Readers

This thesis deals with timing analysis of Complex Real-Time Embedded Sys-tems (CRTES) by using a collection of three novel approximation techniques. In Chapter 3 we position our proposed framework for approximate timing anal-ysis of CRTES, i.e., AESIR-CORES (Advanced and Enterprising Solutions for Innovative Research on COmplex Real-time Embedded Systems). Chapter 4 introduces the prototype tools implementing our proposed methods in AESIR-CORES, and then demonstrates how to use those tools in the evaluation of WCRT analysis of four simulation models depicting two fictive but represen-tative industrial CRTES. These two chapters present the research contributions of this thesis.

To get an introduction and a summary of the thesis; the research prob-lems we deal with, and the contributions, the reader is referred to Chapter 1. Chapter 2 presents a formal definition of an embedded real-time system, basic background on real-time scheduling, and defines important terms in the area of temporal analysis. Chapter 5 summarizes and concludes the thesis, and dis-cusses possible future research directions. In Chapters 6, 7, 8, 9 and 10 we include five published papers A, B, C, D and E which are related to the thesis contributions.

(17)

Notes for Readers

This thesis deals with timing analysis of Complex Real-Time Embedded Sys-tems (CRTES) by using a collection of three novel approximation techniques. In Chapter 3 we position our proposed framework for approximate timing anal-ysis of CRTES, i.e., AESIR-CORES (Advanced and Enterprising Solutions for Innovative Research on COmplex Real-time Embedded Systems). Chapter 4 introduces the prototype tools implementing our proposed methods in AESIR-CORES, and then demonstrates how to use those tools in the evaluation of WCRT analysis of four simulation models depicting two fictive but represen-tative industrial CRTES. These two chapters present the research contributions of this thesis.

To get an introduction and a summary of the thesis; the research prob-lems we deal with, and the contributions, the reader is referred to Chapter 1. Chapter 2 presents a formal definition of an embedded real-time system, basic background on real-time scheduling, and defines important terms in the area of temporal analysis. Chapter 5 summarizes and concludes the thesis, and dis-cusses possible future research directions. In Chapters 6, 7, 8, 9 and 10 we include five published papers A, B, C, D and E which are related to the thesis contributions.

(18)

List of Publications

Publications included in this thesis:

• Paper A Yue Lu, Thomas Nolte, Johan Kraft and Christer Norstr¨om. Statistical-Based Response-Time Analysis of Systems with Execution De-pendencies between Tasks. In proceedings of the 15th IEEE International Conference on Engineering of Complex Computer Systems (ICECCS 2010), pages 169-179, St. Anne’s College, University of Oxford, United Kingdom, March, 2010.

• Paper B Yue Lu, Thomas Nolte, Johan Kraft and Christer Norstr¨om. A Statistical Approach to Response-Time Analysis of Complex Real-Time Embedded Systems. In proceedings of the 16th IEEE International Con-ference on Embedded and Real-Time Computing Systems and Appli-cations (RTCSA 2010), pages 153–160, Macau, SAR, China, August, 2010.

• Paper C Yue Lu, Thomas Nolte, Iain Bate and Christer Norstr¨om. Timing Analyzing for Systems with Task Execution Dependencies. In proceedings of the 34th Annual IEEE Computer Software and Applica-tions Conference (COMPSAC 2010), pages 515-524, Seoul, South Ko-rea, July, 2010.

• Paper D Johan Kraft, Yue Lu, Christer Norstr¨om and Anders Wall. A Meta-heuristic Approach for Best Effort Timing Analysis targeting Com-plex Legacy Time Systems. In proceedings of the 14th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS 2008), pages 258–269, St. Louis, MO, United States, April, 2008.

(19)

List of Publications

Publications included in this thesis:

• Paper A Yue Lu, Thomas Nolte, Johan Kraft and Christer Norstr¨om. Statistical-Based Response-Time Analysis of Systems with Execution De-pendencies between Tasks. In proceedings of the 15th IEEE International Conference on Engineering of Complex Computer Systems (ICECCS 2010), pages 169-179, St. Anne’s College, University of Oxford, United Kingdom, March, 2010.

• Paper B Yue Lu, Thomas Nolte, Johan Kraft and Christer Norstr¨om. A Statistical Approach to Response-Time Analysis of Complex Real-Time Embedded Systems. In proceedings of the 16th IEEE International Con-ference on Embedded and Real-Time Computing Systems and Appli-cations (RTCSA 2010), pages 153–160, Macau, SAR, China, August, 2010.

• Paper C Yue Lu, Thomas Nolte, Iain Bate and Christer Norstr¨om. Timing Analyzing for Systems with Task Execution Dependencies. In proceedings of the 34th Annual IEEE Computer Software and Applica-tions Conference (COMPSAC 2010), pages 515-524, Seoul, South Ko-rea, July, 2010.

• Paper D Johan Kraft, Yue Lu, Christer Norstr¨om and Anders Wall. A Meta-heuristic Approach for Best Effort Timing Analysis targeting Com-plex Legacy Time Systems. In proceedings of the 14th IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS 2008), pages 258–269, St. Louis, MO, United States, April, 2008.

(20)

xviii

• Paper E Markus Bohlin, Yue Lu, Johan Kraft, Per Kreuger and Thomas Nolte. Simulation-Based Timing Analysis of Complex Real-Time Sys-tems. In proceedings of the 15th IEEE International Conference on Em-bedded and Real-Time Computing Systems and Applications (RTCSA 2009), pages 321–328, Beijing, China, August, 2009.

Publications not included in this thesis:

To introduce a full picture of achievements, during my study in the area of real-time systems and software engineering, I also list the publications that are not included in this thesis, as well as one MRTC report.

Conferences and workshops

• Yue Lu, Thomas Nolte and Johan Kraft. An Approximate Timing Anal-ysis Framework for Complex Real-Time Embedded Systems. In submis-sion.

• Yue Lu, Johan Kraft, Iain Bate and Thomas Nolte. A Statistical Ap-proach to Simulation Model Validation in Response-Time Analysis of Complex Real-Time Embedded Systems. In submission.

• Yue Lu, Johan Kraft, Thomas Nolte and Christer Norstr¨om. On Valida-tion of SimulaValida-tion Models in Timing Analysis of Complex Real-Time Em-bedded Systems. In proceedings of the 15th IEEE International Confer-ence on Emerging Technologies and Factory Automation (EFTA 2010), Work-In-Progress (WIP) session, pages 56–59, Bilbao, Spain, Septem-ber, 2010.

• Yue Lu, Johan Kraft, Thomas Nolte and Christer Norstr¨om. A Statistical Approach to Simulation Model Validation in Timing Analysis of Com-plex Real-Time Embedded Systems. In proceedings of the 1st Interna-tional Workshop on Analysis Tools and Methodologies for Embedded and Real-time Systems (WATERS 2010) in conjunction with the 22nd Euromicro Conference on Real-Time Systems (ECRTS 2010), pages 12– 17, Brussels, Belgium, July, 2010.

• Yue Lu, Johan Kraft, Thomas Nolte, Christer Norstr¨om. A Statistical Ap-proach for Validation of Task Simulation Models with Intricate Temporal Execution Dependencies. In proceedings of the 16th IEEE Real-Time

xix

and Embedded Technology and Applications Symposium (RTAS 2010), Work-In-Progress (WIP) session, pages 5–8, Stockholm, Sweden, April, 2010

• Yue Lu, Thomas Nolte, Iain Bate and Christer Norstr¨om. Timing Ana-lyzing for Systems with Execution Dependencies between Tasks. In pro-ceedings of the 25th ACM Symposium on Applied Computing (SAC 2010), pages 357–358, ACM, Sierre, Switzerland, March, 2010. • Yue Lu, Thomas Nolte, Johan Kraft and Christer Norstr¨om.

Statistical-based Response-Time Analysis of Systems with Execution Dependencies between Tasks. In proceedings of the 30th IEEE Real-Time Systems Symposium (RTSS 2009), Work-In-Progress (WIP) session, pages 73– 76, Washington, DC, United States, December, 2009.

• Yue Lu, Antonio Cicchetti, Stefan Bygde, Johan Kraft, Thomas Nolte and Christer Norstr¨om. Transformational Specification of Complex Legacy Real-Time Systems via Semantic Anchoring. In proceedings of the 2nd IEEE International Workshop on Component-Based Design of Resource-Constrained Systems (CORCS 2009) in conjunction with the 34th An-nual IEEE Computer Software and Applications Conference (COMP-SAC 2009), pages 510–515, Seattle, Washington, United States, July, 2009.

• Yue Lu, Antonio Cicchetti, Mikael Sj¨odin, Jukka M¨aki-Turja, Stefan Bygde and Christer Norstr¨om. Towards Response-Time Analysis of Com-plex Real-Time Systems by using Parametric Worst-Case Execution-Time Estimate on Tasks – A Case Study for Robotic Control System. In pro-ceedings of the 21st Euromicro Conference on Real-Time Systems (ECR-TS 2009), Work-In-Progress (WIP) session, pages 5–8, Dublin, Ireland, July, 2009.

• Yue Lu, Markus Bohlin, Johan Kraft, Per Kreuger, Thomas Nolte and Christer Norstr¨om. Approximate Timing Analysis of Complex Legacy Real-Time Systems using Simulation Optimization. In proceedings of the 29th IEEE Real-Time Systems Symposium (RTSS 2008), Work-In-Progress (WIP) session, pages 29–32, Barcelona, Spain, December, 2008.

(21)

xviii

• Paper E Markus Bohlin, Yue Lu, Johan Kraft, Per Kreuger and Thomas Nolte. Simulation-Based Timing Analysis of Complex Real-Time Sys-tems. In proceedings of the 15th IEEE International Conference on Em-bedded and Real-Time Computing Systems and Applications (RTCSA 2009), pages 321–328, Beijing, China, August, 2009.

Publications not included in this thesis:

To introduce a full picture of achievements, during my study in the area of real-time systems and software engineering, I also list the publications that are not included in this thesis, as well as one MRTC report.

Conferences and workshops

• Yue Lu, Thomas Nolte and Johan Kraft. An Approximate Timing Anal-ysis Framework for Complex Real-Time Embedded Systems. In submis-sion.

• Yue Lu, Johan Kraft, Iain Bate and Thomas Nolte. A Statistical Ap-proach to Simulation Model Validation in Response-Time Analysis of Complex Real-Time Embedded Systems. In submission.

• Yue Lu, Johan Kraft, Thomas Nolte and Christer Norstr¨om. On Valida-tion of SimulaValida-tion Models in Timing Analysis of Complex Real-Time Em-bedded Systems. In proceedings of the 15th IEEE International Confer-ence on Emerging Technologies and Factory Automation (EFTA 2010), Work-In-Progress (WIP) session, pages 56–59, Bilbao, Spain, Septem-ber, 2010.

• Yue Lu, Johan Kraft, Thomas Nolte and Christer Norstr¨om. A Statistical Approach to Simulation Model Validation in Timing Analysis of Com-plex Real-Time Embedded Systems. In proceedings of the 1st Interna-tional Workshop on Analysis Tools and Methodologies for Embedded and Real-time Systems (WATERS 2010) in conjunction with the 22nd Euromicro Conference on Real-Time Systems (ECRTS 2010), pages 12– 17, Brussels, Belgium, July, 2010.

• Yue Lu, Johan Kraft, Thomas Nolte, Christer Norstr¨om. A Statistical Ap-proach for Validation of Task Simulation Models with Intricate Temporal Execution Dependencies. In proceedings of the 16th IEEE Real-Time

xix

and Embedded Technology and Applications Symposium (RTAS 2010), Work-In-Progress (WIP) session, pages 5–8, Stockholm, Sweden, April, 2010

• Yue Lu, Thomas Nolte, Iain Bate and Christer Norstr¨om. Timing Ana-lyzing for Systems with Execution Dependencies between Tasks. In pro-ceedings of the 25th ACM Symposium on Applied Computing (SAC 2010), pages 357–358, ACM, Sierre, Switzerland, March, 2010. • Yue Lu, Thomas Nolte, Johan Kraft and Christer Norstr¨om.

Statistical-based Response-Time Analysis of Systems with Execution Dependencies between Tasks. In proceedings of the 30th IEEE Real-Time Systems Symposium (RTSS 2009), Work-In-Progress (WIP) session, pages 73– 76, Washington, DC, United States, December, 2009.

• Yue Lu, Antonio Cicchetti, Stefan Bygde, Johan Kraft, Thomas Nolte and Christer Norstr¨om. Transformational Specification of Complex Legacy Real-Time Systems via Semantic Anchoring. In proceedings of the 2nd IEEE International Workshop on Component-Based Design of Resource-Constrained Systems (CORCS 2009) in conjunction with the 34th An-nual IEEE Computer Software and Applications Conference (COMP-SAC 2009), pages 510–515, Seattle, Washington, United States, July, 2009.

• Yue Lu, Antonio Cicchetti, Mikael Sj¨odin, Jukka M¨aki-Turja, Stefan Bygde and Christer Norstr¨om. Towards Response-Time Analysis of Com-plex Real-Time Systems by using Parametric Worst-Case Execution-Time Estimate on Tasks – A Case Study for Robotic Control System. In pro-ceedings of the 21st Euromicro Conference on Real-Time Systems (ECR-TS 2009), Work-In-Progress (WIP) session, pages 5–8, Dublin, Ireland, July, 2009.

• Yue Lu, Markus Bohlin, Johan Kraft, Per Kreuger, Thomas Nolte and Christer Norstr¨om. Approximate Timing Analysis of Complex Legacy Real-Time Systems using Simulation Optimization. In proceedings of the 29th IEEE Real-Time Systems Symposium (RTSS 2008), Work-In-Progress (WIP) session, pages 29–32, Barcelona, Spain, December, 2008.

(22)

xx

MRTC reports

• Markus Bohlin, Yue Lu, Johan Kraft, Per Kreuger and Thomas Nolte. Best-Effort Simulation-Based Timing Analysis using Hill-Climbing with Random Restarts, MRTC report ISSN 1404-3041 ISRN MDH-MRTC-236/2009-1-SE, M¨alardalen Real-Time Research Centre (MRTC),

M¨alar-dalen University, June, 2009

Contents

I

Thesis

1

1 Introduction 3

1.1 Motive for the Research . . . 3 1.2 Problem Formulation . . . 5 1.2.1 The System Model in RTA and CRTES . . . 6 1.2.2 The Conventional RTA of CRTES . . . 7 1.3 Overview of Our Solutions . . . 8 1.3.1 A New Type of Timing Analysis Models for CRTES . 9 1.3.2 The Statistical RTA of CRTES . . . 11 1.3.3 Formal Timing Analysis of CRTES . . . 12 1.3.4 Simulation Optimization-Based RTA of CRTES . . . . 14 1.4 Contributions . . . 15 1.5 Publications . . . 17 1.6 Thesis Outline . . . 19

2 Embedded Real-Time Systems 23

2.1 Embedded Real-Time Systems . . . 23 2.2 Real-Time Scheduling . . . 25 2.2.1 Task Model . . . 25 2.2.2 Resource Model . . . 26 2.2.3 Scheduling Algorithms . . . 26 2.2.4 Schedulability Analysis . . . 28 2.2.5 Utilization-Based Analysis . . . 28 2.3 Response-Time Analysis . . . 29 2.3.1 The Basic RTA . . . 29 2.4 Worst-Case Execution Time Analysis . . . 31 2.5 Summary . . . 33

(23)

xx

MRTC reports

• Markus Bohlin, Yue Lu, Johan Kraft, Per Kreuger and Thomas Nolte. Best-Effort Simulation-Based Timing Analysis using Hill-Climbing with Random Restarts, MRTC report ISSN 1404-3041 ISRN MDH-MRTC-236/2009-1-SE, M¨alardalen Real-Time Research Centre (MRTC),

M¨alar-dalen University, June, 2009

Contents

I

Thesis

1

1 Introduction 3

1.1 Motive for the Research . . . 3 1.2 Problem Formulation . . . 5 1.2.1 The System Model in RTA and CRTES . . . 6 1.2.2 The Conventional RTA of CRTES . . . 7 1.3 Overview of Our Solutions . . . 8 1.3.1 A New Type of Timing Analysis Models for CRTES . 9 1.3.2 The Statistical RTA of CRTES . . . 11 1.3.3 Formal Timing Analysis of CRTES . . . 12 1.3.4 Simulation Optimization-Based RTA of CRTES . . . . 14 1.4 Contributions . . . 15 1.5 Publications . . . 17 1.6 Thesis Outline . . . 19

2 Embedded Real-Time Systems 23

2.1 Embedded Real-Time Systems . . . 23 2.2 Real-Time Scheduling . . . 25 2.2.1 Task Model . . . 25 2.2.2 Resource Model . . . 26 2.2.3 Scheduling Algorithms . . . 26 2.2.4 Schedulability Analysis . . . 28 2.2.5 Utilization-Based Analysis . . . 28 2.3 Response-Time Analysis . . . 29 2.3.1 The Basic RTA . . . 29 2.4 Worst-Case Execution Time Analysis . . . 31 2.5 Summary . . . 33

(24)

xxii Contents

3 Approximation Techniques for Timing Analysis of Complex

Real-Time Embedded Systems 35

3.1 The System Model in RTA of CRTES . . . 36 3.1.1 WCET Expression of Data-Driven Tasks with

Execu-tion Dependencies . . . 37 3.1.2 Simulation of CRTES . . . 39 3.2 The Statistical RTA of CRTES . . . 40 3.2.1 Construction of the Reference Data Sets . . . 42 3.2.2 WCRT Estimation of the Reference Data Sets . . . 42 3.2.3 The WCRT Estimation Given by RapidRT . . . 44 3.3 Simulation Optimization-Based Methods . . . 44 3.3.1 MABERA . . . 45 3.3.2 HCRR . . . 46 3.4 Formal Timing Analysis . . . 49 3.4.1 Semantic-Preserving Model Transformation . . . 49 3.4.2 Derivation of WCET and WCRT of Tasks . . . 49 3.5 Validity of the WCRT Interval Given by AESIR-CORES . . . 51 3.6 Evaluation Models . . . 52 3.6.1 Model 1 (M1) . . . 53 3.6.2 Model 2 (M2) . . . 54 3.6.3 Validation Model (MV) . . . 55 3.6.4 Model 3 (M3) . . . 56 3.7 Summary . . . 57 4 Empirical Results 59

4.1 Prototype Tool AESIR-CORES . . . 59 4.1.1 Tool Overview . . . 59 4.1.2 ThinkStati . . . 61 4.2 Evaluation . . . 62 4.2.1 AESIR-CORES . . . 63 4.2.2 Formal Timing Analysis Method . . . 64 4.3 Summary . . . 67

5 Summary and Future Work 69

5.1 Summary . . . 69 5.1.1 Contributions . . . 70 5.2 Future Research Directions . . . 71 5.2.1 Trace-Driven Statistical RTA of CRTES . . . 72 5.2.2 Simulation Model Validation . . . 72

Contents xxiii

5.2.3 Model Checking with Abstraction / Deduction Tech-niques . . . 73 Bibliography . . . 75

II

Included Papers

85

6 Paper A:

Statistical-Based Response-Time Analysis of Systems with

Execu-tion Dependencies between Tasks 87

6.1 Introduction . . . 89 6.2 System Model . . . 91 6.2.1 Execution-Time Modeling . . . 92 6.2.2 System Modeling . . . 93 6.3 Worst-Case Response-Time Analysis . . . 94 6.3.1 Problem Complexity . . . 94 6.3.2 Problem Formulation . . . 95 6.4 WCRT Estimation Based on EVT . . . 95 6.4.1 The Reference Data Sets . . . 96 6.4.2 WCRT Estimation of the Reference Data Sets . . . 97 6.5 Implementation . . . 100 6.5.1 Testbed . . . 100 6.5.2 Toolchain . . . 101 6.6 Empirical Results . . . 102 6.6.1 Evaluation Models . . . 102 6.6.2 Results Comparison . . . 104 6.7 Scalability of the Method . . . 107 6.8 Related Work . . . 107 6.9 Conclusions and Future Work . . . 108 Bibliography . . . 111 7 Paper B:

A Statistical Approach to Response-Time Analysis of Complex

Em-bedded Real-Time Systems 115

7.1 Introduction . . . 117 7.2 Modeling of CERTS . . . 119 7.3 RapidRT . . . 121 7.3.1 Algorithm Outlined . . . 122 7.3.2 Construction of the Reference Data Sets . . . 122

(25)

xxii Contents

3 Approximation Techniques for Timing Analysis of Complex

Real-Time Embedded Systems 35

3.1 The System Model in RTA of CRTES . . . 36 3.1.1 WCET Expression of Data-Driven Tasks with

Execu-tion Dependencies . . . 37 3.1.2 Simulation of CRTES . . . 39 3.2 The Statistical RTA of CRTES . . . 40 3.2.1 Construction of the Reference Data Sets . . . 42 3.2.2 WCRT Estimation of the Reference Data Sets . . . 42 3.2.3 The WCRT Estimation Given by RapidRT . . . 44 3.3 Simulation Optimization-Based Methods . . . 44 3.3.1 MABERA . . . 45 3.3.2 HCRR . . . 46 3.4 Formal Timing Analysis . . . 49 3.4.1 Semantic-Preserving Model Transformation . . . 49 3.4.2 Derivation of WCET and WCRT of Tasks . . . 49 3.5 Validity of the WCRT Interval Given by AESIR-CORES . . . 51 3.6 Evaluation Models . . . 52 3.6.1 Model 1 (M1) . . . 53 3.6.2 Model 2 (M2) . . . 54 3.6.3 Validation Model (MV) . . . 55 3.6.4 Model 3 (M3) . . . 56 3.7 Summary . . . 57 4 Empirical Results 59

4.1 Prototype Tool AESIR-CORES . . . 59 4.1.1 Tool Overview . . . 59 4.1.2 ThinkStati . . . 61 4.2 Evaluation . . . 62 4.2.1 AESIR-CORES . . . 63 4.2.2 Formal Timing Analysis Method . . . 64 4.3 Summary . . . 67

5 Summary and Future Work 69

5.1 Summary . . . 69 5.1.1 Contributions . . . 70 5.2 Future Research Directions . . . 71 5.2.1 Trace-Driven Statistical RTA of CRTES . . . 72 5.2.2 Simulation Model Validation . . . 72

Contents xxiii

5.2.3 Model Checking with Abstraction / Deduction Tech-niques . . . 73 Bibliography . . . 75

II

Included Papers

85

6 Paper A:

Statistical-Based Response-Time Analysis of Systems with

Execu-tion Dependencies between Tasks 87

6.1 Introduction . . . 89 6.2 System Model . . . 91 6.2.1 Execution-Time Modeling . . . 92 6.2.2 System Modeling . . . 93 6.3 Worst-Case Response-Time Analysis . . . 94 6.3.1 Problem Complexity . . . 94 6.3.2 Problem Formulation . . . 95 6.4 WCRT Estimation Based on EVT . . . 95 6.4.1 The Reference Data Sets . . . 96 6.4.2 WCRT Estimation of the Reference Data Sets . . . 97 6.5 Implementation . . . 100 6.5.1 Testbed . . . 100 6.5.2 Toolchain . . . 101 6.6 Empirical Results . . . 102 6.6.1 Evaluation Models . . . 102 6.6.2 Results Comparison . . . 104 6.7 Scalability of the Method . . . 107 6.8 Related Work . . . 107 6.9 Conclusions and Future Work . . . 108 Bibliography . . . 111 7 Paper B:

A Statistical Approach to Response-Time Analysis of Complex

Em-bedded Real-Time Systems 115

7.1 Introduction . . . 117 7.2 Modeling of CERTS . . . 119 7.3 RapidRT . . . 121 7.3.1 Algorithm Outlined . . . 122 7.3.2 Construction of the Reference Data Sets . . . 122

(26)

xxiv Contents

7.3.3 WCRT Estimation of the Reference Data Sets . . . 123 7.4 Implementation . . . 127 7.5 Empirical Results . . . 128 7.5.1 Evaluation Models . . . 128 7.5.2 Results Comparison . . . 129 7.6 Conclusions and Future Work . . . 131 Bibliography . . . 133 8 Paper C:

Timing Analyzing for Systems with Task Execution Dependencies 137 8.1 Introduction . . . 139 8.2 System Model . . . 141

8.2.1 WCET Expression of Data-Driven Tasks with Execu-tion Dependencies . . . 144 8.2.2 Model Extraction . . . 145 8.3 Formal Analysis in TIMES . . . 146 8.3.1 Problem Formulation . . . 146 8.3.2 Semantic-Preserving Model Transformation . . . 146 8.3.3 Timing Analysis by Using TIMES . . . 147 8.4 Experimental Evaluation . . . 150 8.4.1 Testbed and Toolchain . . . 151 8.4.2 Model Description . . . 151 8.4.3 The Task WCET Expression . . . 152 8.4.4 The Basic RTA . . . 153 8.4.5 Results Comparison . . . 154 8.5 Scalability of the Method . . . 154 8.6 Related Work . . . 156 8.7 Conclusions and Future Work . . . 156 Bibliography . . . 161 9 Paper D:

A Metaheuristic Approach for Best Effort Timing Analysis

target-ing Complex Legacy Real-Time Systems 165

9.1 Introduction . . . 167 9.2 The Algorithm . . . 169 9.2.1 Definitions . . . 171 9.2.2 Pseudo-Code for MABERA . . . 172 9.2.3 Function SIM . . . 172 9.2.4 Function SEL . . . 174 Contents xxv 9.2.5 Function GEN . . . 175 9.3 Parameters of MABERA . . . 177 9.3.1 Parameter l . . . 178 9.3.2 Parameter p . . . 178 9.3.3 Parameter tt . . . 178 9.3.4 Parameter s . . . 179 9.4 Selecting Parameter Values . . . 179 9.4.1 Selecting a Value for l . . . 180 9.4.2 Selecting p/s Quota and tt Value . . . 180 9.4.3 Selecting a Value for s . . . 184 9.5 Implementation . . . 185 9.6 Evaluation . . . 186 9.6.1 The Simulation Model . . . 186 9.6.2 Results . . . 188 9.7 Related Work . . . 189 9.8 Conclusions and Future Work . . . 191 Bibliography . . . 192 10 Paper E:

Simulation-Based Timing Analysis of Complex Real-Time Systems195 10.1 Introduction . . . 197 10.2 Best-Effort Response-Time Analysis . . . 199 10.2.1 Simulation of Complex Real-Time Systems . . . 199 10.3 The Optimization Algorithm . . . 200 10.3.1 Random Restart Hill Climbing . . . 201 10.4 Case Studies . . . 203 10.4.1 Model 1 . . . 203 10.4.2 Model 2 . . . 204 10.4.3 Validation . . . 204 10.5 Experimental Evaluation . . . 205 10.5.1 Results . . . 206 10.5.2 Average Convergence . . . 211 10.6 Conclusions . . . 212 Bibliography . . . 215

(27)

xxiv Contents

7.3.3 WCRT Estimation of the Reference Data Sets . . . 123 7.4 Implementation . . . 127 7.5 Empirical Results . . . 128 7.5.1 Evaluation Models . . . 128 7.5.2 Results Comparison . . . 129 7.6 Conclusions and Future Work . . . 131 Bibliography . . . 133 8 Paper C:

Timing Analyzing for Systems with Task Execution Dependencies 137 8.1 Introduction . . . 139 8.2 System Model . . . 141

8.2.1 WCET Expression of Data-Driven Tasks with Execu-tion Dependencies . . . 144 8.2.2 Model Extraction . . . 145 8.3 Formal Analysis in TIMES . . . 146 8.3.1 Problem Formulation . . . 146 8.3.2 Semantic-Preserving Model Transformation . . . 146 8.3.3 Timing Analysis by Using TIMES . . . 147 8.4 Experimental Evaluation . . . 150 8.4.1 Testbed and Toolchain . . . 151 8.4.2 Model Description . . . 151 8.4.3 The Task WCET Expression . . . 152 8.4.4 The Basic RTA . . . 153 8.4.5 Results Comparison . . . 154 8.5 Scalability of the Method . . . 154 8.6 Related Work . . . 156 8.7 Conclusions and Future Work . . . 156 Bibliography . . . 161 9 Paper D:

A Metaheuristic Approach for Best Effort Timing Analysis

target-ing Complex Legacy Real-Time Systems 165

9.1 Introduction . . . 167 9.2 The Algorithm . . . 169 9.2.1 Definitions . . . 171 9.2.2 Pseudo-Code for MABERA . . . 172 9.2.3 Function SIM . . . 172 9.2.4 Function SEL . . . 174 Contents xxv 9.2.5 Function GEN . . . 175 9.3 Parameters of MABERA . . . 177 9.3.1 Parameter l . . . 178 9.3.2 Parameter p . . . 178 9.3.3 Parameter tt . . . 178 9.3.4 Parameter s . . . 179 9.4 Selecting Parameter Values . . . 179 9.4.1 Selecting a Value for l . . . 180 9.4.2 Selecting p/s Quota and tt Value . . . 180 9.4.3 Selecting a Value for s . . . 184 9.5 Implementation . . . 185 9.6 Evaluation . . . 186 9.6.1 The Simulation Model . . . 186 9.6.2 Results . . . 188 9.7 Related Work . . . 189 9.8 Conclusions and Future Work . . . 191 Bibliography . . . 192 10 Paper E:

Simulation-Based Timing Analysis of Complex Real-Time Systems195 10.1 Introduction . . . 197 10.2 Best-Effort Response-Time Analysis . . . 199 10.2.1 Simulation of Complex Real-Time Systems . . . 199 10.3 The Optimization Algorithm . . . 200 10.3.1 Random Restart Hill Climbing . . . 201 10.4 Case Studies . . . 203 10.4.1 Model 1 . . . 203 10.4.2 Model 2 . . . 204 10.4.3 Validation . . . 204 10.5 Experimental Evaluation . . . 205 10.5.1 Results . . . 206 10.5.2 Average Convergence . . . 211 10.6 Conclusions . . . 212 Bibliography . . . 215

(28)

I

Thesis

(29)

I

Thesis

(30)

Chapter 1

Introduction

In this thesis we explore approximation techniques for timing analysis of Com-plex Real-Time Embedded Systems (CRTES). Such systems are typically found in embedded applications such as industrial robotic control systems and teleco-mmunication systems. Furthermore, we have proposed and developed a set of analysis methods including i) a statistical Response-Time Analysis (RTA), ii) a formal timing analysis by using model checking, and iii) two simulation optimization-based methods. In this chapter, we give an introduction to our research by starting with a motive for research, and then introduce research challenges and overview of our solutions and contributions. Finally, we con-clude this chapter with an overview of the rest of the thesis.

1.1 Motive for the Research

To date, our daily life is getting more and more dependent on embedded sys-tems, as they are becoming more powerful, highly flexible, and less expensive. Embedded systems consist of electronics and software operating to adapt to, or control, its environment. They are different from desktop computers in the sense of interacting with environment via inputs for analog and digital sensors, and different types of communication buses and other devices, rather than a screen or keyboard. Embedded systems constitute more than 99% of all com-puters in the world [1, 2], and they are commonly used in a wide range of application domains, such as telecommunication, manufacturing, avionics and aerospace, automotive, automation, power control, medical care and so on.

(31)

Chapter 1

Introduction

In this thesis we explore approximation techniques for timing analysis of Com-plex Real-Time Embedded Systems (CRTES). Such systems are typically found in embedded applications such as industrial robotic control systems and teleco-mmunication systems. Furthermore, we have proposed and developed a set of analysis methods including i) a statistical Response-Time Analysis (RTA), ii) a formal timing analysis by using model checking, and iii) two simulation optimization-based methods. In this chapter, we give an introduction to our research by starting with a motive for research, and then introduce research challenges and overview of our solutions and contributions. Finally, we con-clude this chapter with an overview of the rest of the thesis.

1.1 Motive for the Research

To date, our daily life is getting more and more dependent on embedded sys-tems, as they are becoming more powerful, highly flexible, and less expensive. Embedded systems consist of electronics and software operating to adapt to, or control, its environment. They are different from desktop computers in the sense of interacting with environment via inputs for analog and digital sensors, and different types of communication buses and other devices, rather than a screen or keyboard. Embedded systems constitute more than 99% of all com-puters in the world [1, 2], and they are commonly used in a wide range of application domains, such as telecommunication, manufacturing, avionics and aerospace, automotive, automation, power control, medical care and so on.

(32)

4 Chapter 1. Introduction

Many industrial embedded systems are very large, flexible, and highly con-figurable software systems, containing many event-triggered tasks being trig-gered by other tasks in complex, nested patterns. Consequently, they have a very complicated runtime behavior. Such systems may consist of millions of lines of code, and contain hundreds of tasks, many with real-time constraints. Examples of such systems include the robotic control system IRC 5, developed by ABB [3], as well as several telecom systems. In such systems, many tasks have intricate dependencies in their temporal behavior, such as 1) asynchronous message-passing and globally shared state variables, which may decide impor-tant control-flow conditions with major impact on task execution time as well as task response time, 2) task offsets, and 3) runtime changeability of priorities and periods of tasks. We refer to systems with such characteristics as Complex Real-Time Embedded Systems (CRTES).

To maintain, analyze and reuse CRTES is very important, difficult and ex-pensive, which, nonetheless, offers high business value responding to great concern in industry. For instance, one specific problem in maintenance, i.e., modifying the system after delivery to correct faults, improve performance or other attributes, or to adapt the product to a changed environment, is the risk for introducing timing-related errors. In particular, for the CRTES in safety-critical applications, both functional and non-functional correctness are often equally important. Thus, temporal behavior, e.g., Worst-Case Response Time (WCRT) of the adhering tasks in systems has to be known. For instance, a fail-ing industrial robot could halt an entire production line in a factory for hours, causing a huge financial loss. Software bugs that lead to slow response time in Anti-lock Brake System (ABS) in cars could cause loss of human lives, and recall of several hundreds of thousands of vehicles. In this thesis, we focus on Response-Time Analysis (RTA) of CRTES in safety-critical applications.

However, due to high complexity of such CRTES, the existing relatively well-developed theories for modeling and analysis of real-time systems are having problems which limit their application in the context. For example, timing analysis methods such as RTA [4], are often not applicable, as their as-sumptions of independent tasks in the analysis do not hold in such CRTES. The results of such analyses thereby become overly pessimistic; often too pes-simistic to be useful. Moreover, methods like RTA rely on the existence of a Worst-Case Execution Time (WCET) of each task. Correspondingly, the qual-ity of the analysis is directly correlated to the qualqual-ity of WCET estimates. In order to perform a safe analysis covering system worst-case scenarios, static WCET analysis [5] has to be adopted in the context, of which assumption is that tasks are isolated in the analysis. Nevertheless, such assumptions make

1.2 Problem Formulation 5

the option to use static WCET analysis to obtain task-level WCET estimates not proper, due to the fact that task intricate temporal dependencies cannot be well handled. Furthermore, today’s WCET tools cannot analyze the complex high-performance CPUs used by many industrial systems.

The state of practice in industry is that many companies developing CRTES have no means for timing analysis, and are forced to rely on testing to find timing-related problems. Nonetheless, all timing errors can in most cases not be detected in unit testing as they only occur in the integrated system, when concurrent activities are interacting or interfering, under a very specific condi-tion. Moreover, if errors related to timing and concurrency effects are discov-ered in testing of the entire system, they are typically hard to reproduce. Worse yet, it is not only extremely difficult and expensive to test all scenarios in the system, but also hard to predict how a product will be used. Enabling RTA of CRTES is a problem of high industrial relevance thereof.

1.2 Problem Formulation

From the perspective of model-based analysis, RTA of such CRTES requires analysis methods that use a more detailed system model, which depicts the original software program focusing on behavior of significance for task schedul-ing, communication and allocation of logical resources. Due to high complex-ity of CRTES, such models typically need to be at a certain level of abstrac-tion in order to avoid that the model becomes as complex as the real system. For many systems, manual modeling would be far too time-consuming and error-prone. Two methods for automated model extraction are proposed in [6]. A tool for automated model extraction is in development, namely MXTC -Model eXtraction Tool for C. The MXTC tool targets large implementations in C, consisting of millions of lines of code, and is based on program slicing [7].

The main focus of this thesis investigates to use such models describing in-tricate task temporal dependencies, to perform meaningful RTA of the CRTES in safety-critical applications. It is worth noting that in this thesis, the issue model validation is not discussed. Instead we assume that the model (extracted from the target system) is a sufficiently accurate approximation of the modeled system from the perspective of interesting timing properties, such as the execu-tion time and response time of the adhering tasks. However, we have presented some interesting results in the context of validating temporal simulation mod-els in timing analysis of CRTES in [8, 9], to which the interested readers can refer for details. Moreover, the problems about RTA of CRTES are introduced

Figure

Figure 1.1: Overview of our research and the cross-domain analysis methods used in the thesis, and the corresponding conference papers are highlighted.
Figure 2.1: Relation between execution times and results obtained through different WCET analysis methods, as shown in [5].
Figure 3.1: Using one clock and one bounded integer to calculate the WCRT of the task on focus in the TIMES model.
Table 3.1: The feasibility of using different proposed analysis methods in dif- dif-ferent evaluation models.
+7

References

Related documents

ρ d can be seen as the downlink SNR , defined as follows: If all downlink power were radiated from just one of the base station antennas, ρ d would be the average (over the

Upptag av vatten och en del joner i födan Upptag av saltjoner via gälarna Upptag av vatten genom osmos, via gälar och kroppsytan. Utsöndring av stora mängder av utspädd

blodkroppar, förmak, kammare, kapillärer, artärer, vener, lilla kretsloppet, stora kretsloppet, hålven, lungartär, lungven, aorta, segelklaff, fickklaff,

publicerat arbete betitlat Parliarnentar:IJ Representation. Mer än hälften av under- husets medlemmar rekryterades ur den industriella överklassen och ur kategorierna

Att vilja inbilla oss, att detta icke skulle gå, att det ena eller andra vore lönlöst, då ju det segerrika Tyskland så sent som i går demonstrerade för oss ad

The annual report should be a summa:ry, with analysis and interpretations, for presentation to the people of the county, the State, and the Nation of the extension activities

Vi kan nu erbjuda energimätning på enskilda maskin- grupper eller hela linjer under förutbestämda 8dsin- tervaller, för a7 kunna analysera poten8alen a7 spara energi i

Interface I: Concept development phase and pilot and demonstration phase Interface II: Pilot and demonstration phase and market formation phase Interface III: Market formation phase