Valpont.Com, a Technology Content Platform Valpont.Com, a Technology Content Platform
Total Page:16
File Type:pdf, Size:1020Kb
Valpont.com, a Technology Content Platform Valpont.com, a Technology Content Platform Software Development for Embedded Multi-core Systems Valpont.com, a Technology Content Platform This page intentionally left blank Valpont.com, a Technology Content Platform Software Development for Embedded Multi-core Systems A Practical Guide Using Embedded Intel ® Architecture Max Domeika AMSTERDAM • BOSTON • HEIDELBERG • LONDON NEW YORK • OXFORD • PARIS • SAN DIEGO SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO Newnes is an imprint of Elsevier Valpont.com, a Technology Content Platform Cover image by iStockphoto Newnes is an imprint of Elsevier 30 Corporate Drive, Suite 400, Burlington, MA 01803, USA Linacre House, Jordan Hill, Oxford OX2 8DP, UK Copyright © 2008, Elsevier Inc. All rights reserved. Intel® and Pentium® are registered trademarks of Intel Corporation. *Other names and brands may be the property of others. The author is not speaking for Intel Corporation. This book represents the opinions of author. Performance tests and ratings are measured using specifi c computer systems and/or components and refl ect the approximate performance of Intel products as measured by those tests. Any difference in system hardware or software design or confi guration may affect actual performance. Buyers should consult other sources of information to evaluate the performance of systems or components they are considering purchasing. For more information on performance tests and on the performance of Intel products, visit Intel Performance Benchmark Limitations. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Permissions may be sought directly from Elsevier ’ s Science & Technology Rights Department in Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, E-mail: http://[email protected] . You may also complete your request online via the Elsevier homepage ( http://elsevier.com ), by selecting “ Support & Contact ” then “ Copyright and Permission ” and then “ Obtaining Permissions. ” Library of Congress Cataloging-in-Publication Data Domeika, Max. Software development for embedded multi-core systems : a practical guide using embedded Intel architecture / Max Domeika. p. cm. ISBN 978-0-7506-8539-9 1. Multiprocessors. 2. Embedded computer systems. 3. Electronic data processing— Distributed processing. 4. Computer software—Development. I. Title. QA76.5.D638 2008 004 .35—dc22 2008006618 British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library. For information on all Newnes publications visit our Web site at www.books.elsevier.com ISBN: 978-0-7506-8539-9 Typeset by Charon Tec Ltd (A Macmillan Company), Chennai, India www.charontec.com Printed in the United States of America 08 09 10 11 10 9 8 7 6 5 4 3 2 1 Valpont.com, a Technology Content Platform Contents Preface .............................................................................................................................. ix Acknowledgments ........................................................................................................... xiii Chapter 1: Introduction .....................................................................................................1 1.1 Motivation ....................................................................................................................3 1.2 The Advent of Multi-core Processors ...........................................................................4 1.3 Multiprocessor Systems Are Not New .........................................................................4 1.4 Applications Will Need to be Multi-threaded ..............................................................6 1.5 Software Burden or Opportunity ..................................................................................8 1.6 What is Embedded? ....................................................................................................10 1.7 What is Unique About Embedded? ............................................................................13 Chapter Summary ..............................................................................................................14 Chapter 2: Basic System and Processor Architecture .....................................................17 Key Points ..........................................................................................................................17 2.1 Performance ................................................................................................................19 2.2 Brief History of Embedded Intel ® Architecture Processors .......................................20 2.3 Embedded Trends and Near Term Processor Impact .................................................37 2.4 Tutorial on x86 Assembly Language ..........................................................................39 Chapter Summary ..............................................................................................................53 Related Reading ................................................................................................................54 Chapter 3: Multi-core Processors and Embedded ..........................................................55 Key Points ..........................................................................................................................55 3.1 Motivation for Multi-core Processors .........................................................................56 3.2 Multi-core Processor Architecture .............................................................................57 3.3 Benefi ts of Multi-core Processors in Embedded ........................................................62 3.4 Embedded Market Segments and Multi-core Processors ........................................... 63 www.newnespress.com Valpont.com, a Technology Content Platform vi Contents 3.5 Evaluating Performance of Multi-core Processors .....................................................69 Chapter Summary ..............................................................................................................87 Related Reading ................................................................................................................88 Chapter 4: Moving to Multi-core Intel Architecture .......................................................89 Key Points ..........................................................................................................................89 4.1 Migrating to Intel Architecture ...................................................................................91 4.2 Enabling an SMP OS ................................................................................................111 4.3 Tools for Multi-Core Processor Development ..........................................................117 Chapter Summary ............................................................................................................136 Related Reading ..............................................................................................................137 Chapter 5: Scalar Optimization and Usability ..............................................................139 Key Points ........................................................................................................................139 5.1 Compiler Optimizations ...........................................................................................143 5.2 Optimization Process ................................................................................................153 5.3 Usability ...................................................................................................................161 Chapter Summary ............................................................................................................170 Related Reading ..............................................................................................................170 Chapter 6: Parallel Optimization Using Threads ..........................................................173 Key Points ........................................................................................................................173 6.1 Parallelism Primer ....................................................................................................175 6.2 Threading Development Cycle .................................................................................184 Chapter Summary ............................................................................................................206 Related Reading ..............................................................................................................207 Chapter 7: Case Study: Data Decomposition ................................................................209 Key Points ........................................................................................................................209 7.1 A Medical Imaging Data Examiner ..........................................................................209 Chapter Summary ............................................................................................................245 Chapter 8: Case Study: Functional Decomposition ......................................................247 Key Points ........................................................................................................................247