Weiwei Chen Out-of-order Parallel Discrete Event Simulation for Electronic System-level Design Out-of-order Parallel Discrete Event Simulation for Electronic System-level Design Weiwei Chen Out-of-order Parallel Discrete Event Simulation for Electronic System-level Design Foreword by Rainer Dömer 123 Weiwei Chen Universityof California Irvine,CA USA ISBN 978-3-319-08752-8 ISBN 978-3-319-08753-5 (eBook) DOI 10.1007/978-3-319-08753-5 LibraryofCongressControlNumber:2014946359 SpringerChamHeidelbergNewYorkDordrechtLondon (cid:2)SpringerInternationalPublishingSwitzerland2015 Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpartof the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,andtransmissionor informationstorageandretrieval,electronicadaptation,computersoftware,orbysimilarordissimilar methodology now known or hereafter developed. Exempted from this legal reservation are brief excerpts in connection with reviews or scholarly analysis or material supplied specifically for the purposeofbeingenteredandexecutedonacomputersystem,forexclusiveusebythepurchaserofthe work. Duplication of this publication or parts thereof is permitted only under the provisions of theCopyright Law of the Publisher’s location, in its current version, and permission for use must always be obtained from Springer. Permissions for use may be obtained through RightsLink at the CopyrightClearanceCenter.ViolationsareliabletoprosecutionundertherespectiveCopyrightLaw. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publicationdoesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexempt fromtherelevantprotectivelawsandregulationsandthereforefreeforgeneraluse. While the advice and information in this book are believed to be true and accurate at the date of publication,neithertheauthorsnortheeditorsnorthepublishercanacceptanylegalresponsibilityfor anyerrorsoromissionsthatmaybemade.Thepublishermakesnowarranty,expressorimplied,with respecttothematerialcontainedherein. Printedonacid-freepaper SpringerispartofSpringerScience+BusinessMedia(www.springer.com) To my parents, Xiuhua and Guoyao, for their support and unconditional love. I love you both dearly. Foreword Asweentertheinformationera,cyber-physicalandembeddedcomputingsystems have a profound impact on our everyday life and our entire society. With appli- cations ranging from video-enabled mobile phones to smart buildings, from real-time automotive applications to communication satellites, and from portable multimedia electronics to reliable medical devices, we interact and depend on embedded systems on a daily basis. Overafewdecades,computer-baseddeviceshavegainedatremendousamount offunctionalityandprocessingpowerand,atthesametime,cannowbeintegrated into a single chip implementation called a System-on-Chip (SoC). Multi-core processor SoCs are readily available, and many-core architectures with hundreds or thousands of processors are on the horizon. The work by Dr. Weiwei Chen described in this book addresses several of the many challenges we face when we want to continue this exponential growth in computing technology. • Growing complexity Thedesignofmodernandfutureembeddedsystemsfacesgreatobstaclesdueto the steadily rising complexity of the hardware and software in these devices. Thedesigncomplexitygrowsexponentiallywiththenumberofcomponentsthat have to cooperate properly. • Integration into the cyber-physical world Computing devices and applications need to be integrated into the real world. This implies that embedded system designers have to cope with multiple and conflicting goals and constraints at the same time, including functionality, timing, power, reliability, dependability, maintenance, and production. More- over, customer demands require lower prices and shorter time-to-market and thus put high pressure on developers to reduce the design time for embedded systems. • Higher level of abstraction It is well understood by system engineers that the complexity problem can be generally addressedbyraisingthelevelofabstraction.Modelinganddesigning vii viii Foreword at the so-called system-level using hierarchical block-based representations allows to deal with less components at a time and thus to focus on the actual system needs. At the same time, this simplifies documentation, facilitates effective communication among designers, and allows the systematic use of modern Computer-Aided Design (CAD) techniques. • Design automation Automating the design processes results in higher efficiency as it relieves the system designer from mundane and error-prone tasks, allowing to focus on the actualdesignproblemsathand,efficientlyexplorethedesignspace,andquickly make the right tradeoff decisions. Automated techniques for system design include model analysis, validation, verification, and synthesis. Specifically, Out-of-Order Parallel Discrete Event Simulation for Electronic System-Level Design introduces topics and concepts in embedded system design from the high-level perspective where the system is composed of a hierarchy of connected hardware and software components. Special attention is paid to the description and modeling of such systems which is crucial to enable efficient design automation. A major topic covered in this book is the simulation of embedded system models. Dr. Weiwei Chen reviews the classic Discrete Event Simulation (DES) topic, then covers a synchronous parallel DES approach, and finally introduces a novel out-of-order parallel DES technique that breaks the traditional barriers, enabling maximum simulation speed without any loss of accuracy. At the core of this work is the introduction of the so-called Segment Graph [CHD12], a novel representation of the system design model that, by abstracting away unneeded detail and focusing only on the essential constructs, enables effi- cient algorithms and advanced compile-time analysis of the model. ThevalueoftheproposedSegmentGraphisshownnotonlyintheapplication ofout-of-orderparallelsimulation(Chaps. 3through6),butalsointheapplication area of advanced static analysis in a compiler. Chapter 7 describes a novel tech- nique for May-Happen-in-Parallel (MHP) analysis which allows to efficiently identify and eliminate dangerous race conditions in parallel programs. Notably, this work, [CHD14], received the DATE Best Paper Award 2014. The work published in this book has received the Outstanding Dissertation Award2013inthecategoryof‘‘NewDirectionsinEmbeddedSystemDesignand Embedded Software’’ from the European Design and Automation Association. This clearly is a major contribution and I recommend everyone in the area of Electronic Design Automation (EDA) for hardware and software systems to become familiar with it. I am sure this work will prove of significant value in the years to come. Irvine, CA, May 2014 Rainer Dömer Preface Embedded computer systems are pervasive in our modern society with a wide application domain such as automotive and avionic systems, electronic medical equipment, telecommunication devices, industrial automation, and consumer electronics. At the so-called Electronic System Level (ESL), designers start with a specifi- cation model of the system and follow a systematic top-down design approach to refinethemodeltolowerabstractionlevelsstep-by-stepbyaddingimplementation details. ESL models are usually written in C-based System-Level Description Languages (SLDLs), and contain the essential features such as clear structure and hierarchy, separate computation and communication, and explicit parallelism. Typically, ESL models are validated through simulation. Fast yet accurate simu- lation is highly desirable for designing efficient and effective systems. In this book, we review and study the parallel discrete event simulation for electronicsystem-leveldesignsonsimulationplatformswith multipleCPU cores. Afterasurveyofstate-of-the-artapproaches,wedescribeanewtechnique,namely Out-of-Order Parallel Discrete Event Simulation (OoO PDES), to effectively exploit the available computational resources on multi-core simulation hosts for cycle-accurate simulation. OoO PDES breaks the global simulation-cycle barrier of traditional DE simulation by localizing the simulation time into each thread, carefully delivering notified events, and handling a dynamic management of simulation sets. Potential conflicts caused by parallel accesses to shared variables andout-of-orderthread schedulingarepreventedbyanadvancedpredictivestatic model analyzer in the compiler. As such, OoO PDES allows the simulator to effectively exploit the parallel processing capability of the multi-core system to achieve fast speed simulation without loss of simulation and timing accuracy. Moreover, ESL models must contain explicit and efficient parallelism in order to utilize parallel processing for low power and high performance. Parallelization isaparticularlyimportantbutalsoverydifficulttaskinsystemmodeling.Basedon ourparallelsimulationinfrastructure,wefurtherpresenttheautomaticapproaches thatcan help the designer toquickly narrow down the debuggingtargets infaulty ESL models with parallelism. ix x Preface Overall, our work provides an advanced parallel simulation infrastructure for efficient and effective system-level model validation and development so as to build better products in shorter time. Mountain View, CA, June 2014 Weiwei Chen Acknowledgments It could never be possible for me to write this book without the encouragements and supports from my professors, family, colleagues, and friends during the past 6 years of my Ph.D. study, which is also such a wonderfuland enjoyable journey that makes me a much better person in every possible way. First and foremost, I would like to gratefully and sincerely thank my advisor, Prof.RainerDömer,forhisguidance,understanding,patience,andsupportduring my doctorate study at UC Irvine. His technical insights, organization talents, amiable personality, and witty sense of humor have tremendously inspired and shapedmetobeagoodscholarandperson.Ienjoyourmeetingsandconversations which always bring me the morale, courage, and new ideas to identify and solve researchandteachingproblems.Ialsoappreciateourdiscussionsonphilosophical topicsintermsofresearch,teaching,work,andlivingwhichIbelievewillbenefit me for my whole life. I would like to thank Prof. Daniel D. Gajski for serving on my committee and supporting me to pursue my career goal. His critical and visionary opinions and expertise has provided me a thorough and comprehensive view in the area of embedded computer systems. It is also so pleasant to have Prof. Gajski around in the same working area, who cheers us up everyday. In addition, I would also like tothankProf.BrianDemskyforservingonmydissertationcommitteeandforhis valuable suggestions to improve this work. I would like to thank the members from the Laboratory for Embedded Com- puterSystems(LECS)intheCenterforEmbeddedComputerSystems(CECS).In particular,IwouldliketothankXuHan,Che-WeiChang,andYasamanSameifor thegroupdiscussionsandtheircontributionsontheexperimentalmodelsthathave been used in this work. Many thanks to Tim Schmidt and Steffen Peter for the great research discussions, serving as the critical readers of my writings, and providing many constructive critiques. Also, special thanks to the CECS ‘‘Game Night’’ group, including Tim, Xu, Che-Wei, Steffen, Yasaman, and me, which grants us the opportunity to know each other outside of the normal work setting and undoubtedly improves our nerdy social life. I am so fortunate to have their support and friendship in these years. xi