Model-Based Engineering for Complex Electronic Systems Model-Based Engineering for Complex Electronic Systems Peter Wilson H. Alan Mantooth AMSTERDAM(cid:129)BOSTON(cid:129)HEIDELBERG(cid:129)LONDON NEWYORK(cid:129)OXFORD(cid:129)PARIS(cid:129)SANDIEGO SANFRANCISCO(cid:129)SINGAPORE(cid:129)SYDNEY(cid:129)TOKYO NewnesisanimprintofElsevier I would like to thank my wife, Caroline, and my daughter, Heather, who between them have provided me with so much love and support during the period of writing this book. While the time I spend on research and engineering is rewarding, my time with Caroline and Heather is priceless. I would therefore like to dedicate my efforts on this book to Caroline and Heather. Peter Wilson I would like to thank my wife, Mary Lynn, and our three wonderful daughters, Deanna Lynn, Laura Kathryn, and Maureen Elaine, for their love, support, and patience as I spent the time working on this project along with the other dozen or so I typically have on the go. I would like to dedicate my efforts on this book to the memory of my brother, Opie Louis Mantooth, Jr (1953(cid:1)1999) and his daughter, Stephanie Ann (1981(cid:1)2000). Alan Mantooth Newnes isanimprintofElsevier TheBoulevard, Langford Lane, Kidlington, Oxford OX51GB,UK 225 WymanStreet, Waltham, MA 02451, USA Firstpublished2013 Copyright r 2013 ElsevierInc. All rights reserved No partof this publication may be reproduced ortransmitted inany form orby any means, electronic ormechanical, includingphotocopying,recording, orany informationstorage and retrieval system, withoutpermission inwriting fromthe publisher. Details on how toseek permission, further information about the Publisher’s permissionspoliciesand ourarrangement with organizationssuch asthe Copyright Clearance Centerand the CopyrightLicensing Agency,can be found at our website: http://elsevier.com/permissions Thisbook andthe individual contributions contained init are protectedunder copyright by the Publisher (other than asmay be noted herein). Notice Knowledge andbest practice inthis field are constantly changing. As new researchand experience broaden ourunderstanding, changes inresearch methods,professional practices, or medical treatmentmay become necessary. Practitionersand researchers mustalways rely ontheir own experience and knowledge in evaluating and using any information,methods, compounds, orexperiments describedherein. In using such information ormethods they should be mindfuloftheir own safety andthe safetyofothers,includingpartiesfor whomthey have a professionalresponsibility. To the fullest extent ofthe law, neither the Publisher northe authors, contributors, oreditors, assume any liability for anyinjury and/or damage topersons orproperty as amatterof productsliability, negligence or otherwise,or fromany use oroperationof anymethods, products, instructions, or ideas containedinthe material herein. British Library Cataloguing-in-Publication Data A catalogue record for this bookis available from the BritishLibrary Library ofCongress Cataloging-in-Publication Data A catalog record for this book isavailable from the Library ofCongress ISBN:978-0-12-385085-0 Forinformationon all Newnespublications visit ourwebsite at store.elsevier.com Printed and boundin the United States 13 14 15 16 10 9 8 7 6 5 4 3 2 1 Foreword Models scare engineers. They expose, for all the world to see, any lack of understanding of the device being used or the design itself that they may have. This is why “I don’t do modeling” is a common refrain among electronics engineers. Yet they do, indeed, do modeling. Without a model, you cannot analyze a design (either on the computer or by hand) to determine if it will work cor- rectly. Models are (and always have been) essential to the design process. Show me a designer and I’ll show you a modeler. To make matters worse, rarely, if ever, will a design fail from the aspects the engineer has considered. It more likely fails from what the engineer has ignored or didn’t know about. And, to top it off, systems have become so complex that engineershave touse computers (which need models) tocreate the designs. This is precisely why Peter Wilson and Alan Mantooth have written this book (cid:1) to helpanalog andmixed-signal (AMS)engineers throughthisconundrum. The “rule of thumb” that surprisingly assists is that second- and third-order effects rarely help. If a design won’t work with simple, first-order effects, it probably won’t work when second- and third-order effects are included. This “saves the day”. Model-based engineering starts with the simple, first-order models with which most engineers are comfortable (commonly referred to as “behavioral models” with the mistaken implication that all behavioral models are inaccurate). Only when the design works with these first-order models does the engineer proceed to using more complex models. Starting with the simple first-order models helps the engineer gain confidence (cid:1) in the design and the use of models. Topologies and approaches can be quickly and easily analyzed, rejected, and accepted. xiii xiv Foreword This book debunks some of the myths associated with modeling, how it has been perceived as a peripheral activity, and, instead, positions it firmly at the heart of the design process. The second contribution of this book covers the new generation of modeling tools that help with the creation of those dreaded second- and third-order mod- els. These new tools make modeling more natural to the engineer by using a language all AMS engineers understand: circuits, diagrams, equations and blocks. This is, indeed, “AMS engineer friendly”. By bringing all these concepts together in one place, the authors make a major contribution to “model-based engineering” (cid:1) where modeling is placed com- fortably as a natural part of the design process and the AMS engineer receives the benefit of the additional insight and confidence into the system being designed. It’s really not so scary, after all. Ian Getreu Preface The phrase model-based engineering (MBE) has been used by many people and organizations to indicate the importance of models as part of the engineering design process. Our use of the phrase for the title of this book is no different. It is not difficult to find people who will advocate for modeling to be used as a precursor to design and implementation. Conversely, it is also not too difficult to find hardware- centric designers that want as little to do with computers and modeling as they can. Fortunately, this is a bygone era and not a formula for success in modern complex designs. In point of fact, nearly all modern engineering design is performed with the aid of models, whether it be for civil, industrial, mechanical, or electrical and electronics engineering projects. Some of these engineering disciplines have substantially advanced their techniques for creating models in recent decades. This is typically reflected in the complexity of systems being designed, as, once again, necessity becomes the mother of these inventions. With all due respect to the simulation algorithm developers of the world, the single most effective way to manage growing design complexity is through modeling. Yes, when a simulation algorithm breakthrough is realized, it can have a profound effect, but these are few and far between, and, in fact, it could be argued that this has not taken place for several decades. In the scope of a given complex system design, such a breakthrough certainly cannot be relied upon. The design team must, in general, be smarter and manage that design through modeling in the context of existing solution algorithms. The concepts in this book were conceived more than 15 years ago by the authors, but it is only recently that we can say that modeling technology has reached a point where the concepts can be taught effectively and succinctly. This book is not intended to convince engineers of a new way of thinking or profoundly new design approach. Rather, it is intended to acknowledge the model-based activity designers already engage in and provide a procedural formalism that will hopefully make them more productive. Further, it should reveal to the designer that, with investment in “sharpening this saw”, many more valuable analyses are possible than are typically done today. Thisbookisdesignedtobeadesk-topreferenceforengineers,studentsandresearchers whointendtocarryoutMBE.Itisalsowritteninthestyleofabookthatupper-level xv xvi Preface undergraduatesorentry-levelgraduatestudentshavingtakentheirintroductory engineeringcoursescanutilize. The book is organized into three sections: Fundamentals, Modeling Approaches, and Design Methods. The first section consists of three chapters that cover the basic tenets of MBE. In order to perform MBE, you have to know how to write models and how to compose them for reuse. Understanding where these models fit into the simulation flow and how they are used in design activity is important. However, many articles and texts have been written on the simulation algorithms, so we will not duplicate this information other than to summarize it for our needs. In this way, we can stay focused on the primary picture (cid:1) modeling as a means for design. The second section goes more deeply into modeling techniques to ensure the reader understands the various way behaviors can be represented. Most of these techniques are illustrated through the use of modeling tools rather than by hand coding in various languages. This keeps the modeling activity focused on the conceptual level of what is required and out of the details of any specific language syntax or semantic. This book is designed specifically to avoid the need to have to teach hardware description languages, C, or any other language in which models can be represented. Therefore, no modeling language primers are included as part of this book. However, the reader can use the included modeling tools to view what would be generated. Again, the focus is on model creation at a conceptual level using tools that will have the utility to generate these languages. In this way, the designer focuses on the utility of the model, its usefulness and requirements at a given point in the design, and in capturing that functionality efficiently. Without question, models can be written by hand and successfully employ a MBE design approach. However, the learning curve for the uninitiated is much larger, so we have chosen the simplest route to effective model based design productivity. Section 2 is predicated on the fact that even with huge libraries of models, there will remain the need to capture more models for each design. It is meant to arm the designer with these techniques while also demonstrating reuse in each chapter because “the easiest model to build is the one you don’t have to”. The final chapter of the book represents a case study that was performed on a complex integrated circuit between the University of Southampton and the University of Arkansas. This chip includes analog, radio frequency, and digital all on the same chip and was designed using the MBE design methods prescribed in this book. Preface xvii For the practicing engineer, we hope that the book will serve as a method of self- teaching oneself the basics of MBE and, together with the online material available, give them get a quick start on checking out the methodology on a design of their own. The case studies and examples will be indispensable for the deepest learning and illustration of the MBE approach. In the accompanying online materials, available on the companion website: http:// www.modelbasedengineering.org, all of the examples given in the book are captured for ease of execution in a simulator. The modeling tools used to create the models are provided for free, so that the models can be read into the tool and a hardware description language suitable for simulation can then be generated with the push of a button. Acknowledgments It seems like most of my adult life has been concerned with attempting to become a good engineer. As a proud Scot, with an engineer father, it is a matter of national pride to be part of the engineering fraternity. From those first rough prototypes of electronic circuits, through to production equipment, every step of the way has been a passionate drive to make things work and make them better. For all of my professional life, my passion has been to design, innovate, and invent, and more than 20 years ago this was enhanced with the introduction to advanced modeling and simulation techniques. I can trace the moment where the “burners were really lit” to attempting to figure out a problem with a transformer, with testing providing only a limited insight. Having to understand the transformer’s complex behavior, model it, simulate it, and then use that to trace the source of the problem was an epiphany that demonstrated the power of a model-based approach to engineering. For that moment I must thank John Murray at Ferranti, in Edinburgh, for the words “can you take a look at this...?”. As a junior engineer at Ferranti, working with John Murray, Frank Fisher, and Alan Abernethy, in particular, was an education, inspiration, and genuine pleasure, which I will always treasure and never forget. Moving to Analogy Inc. was a pivotal moment in my life as it was where I met my wife, Caroline, and, above everything else, this is what I am most grateful for. Professionally, it was also a formative period, working with many smart, funny, and talented individuals, including my co-author Alan Mantooth. More recently, since moving back to academia to first pursue the long-held dream of a PhD and then becoming an academic at Southampton, I have had the good fortune to work with another group of diverse, talented people, including my PhD supervisor Dr. Neil Ross, and Dr. Reuben Wilcock, in particular. The journey of this book has deep roots, and the friendship with my co-author Alan Mantooth goes back more than 20 years. We talked for many years about why it seemed to be so difficult for engineers to be able to do what seemed to come naturally to them, and so the obvious step was to try and write down what we did to capture those techniques. The original work on the book started back in 2008, when I spent a sabbatical semester at the University of Arkansas to begin the process, and I must mention the hospitality of Alan, Mary Lynn, Deanna, Laura, and Maureen Mantooth, who invited me into their home to become “part of the family”: I am sincerely xix