Docsity

book for hardware software co-design, Study notes of Software Engineering

Partial preview of the text

Download book for hardware software co-design and more Study notes Software Engineering in PDF only on Docsity!

Embedded System Design

Embedded System Design

Modeling, Synthesis and Verification

Daniel D. Gajski • Samar Abdi

Andreas Gerstlauer • Gunar Schirner

Preface

RATIONALE

In the last twenty five years, design technology, and the EDA industry in partic- ular, have been very successful, enjoying an exceptional growth that has been paralleled only by advances in semiconductor fabrication. Since the design problems at the lower levels of abstraction became humanly intractable and time consuming earlier then those at higher abstraction levels, researchers and the industry alike were forced to devote their attention first to problems such as circuit simulation, placement, routing and floorplanning. As these prob- lems become more manageable, CAD tools for logic simulation and synthesis were developed successfully and introduced into the design process. As de- sign complexities have grown and time-to-market have shrunk drastically, both industry and academia have begun to focus on levels of design that are even higher then layout and logic. Since higher levels of abstraction reduce by an order of magnitude the number of objects that a designer needs to consider, they have allowed industry to design and manufacture complex application-oriented integrated circuits in shorter periods of time. Following in the footsteps of logic synthesis, register-transfer and high-level synthesis have contributed to raising abstraction levels in the design method- ology to the processor level. However, they are used for the design of a sin- gle custom processor, an application-specific or communication component or an interface component. These components, along with standard processors and memories, are used as components in systems whose design methodol- ogy requires even higher levels of abstraction: system level. A system-level design focuses on the specification of the systems in terms of some models of computations using some abstract data types, as well as the transformation or refinement of that specification into a system platform consisting of a set of processor-level components, including generation of custom software and hardware components. To this point, however, in spite of the fact that sys-

vi EMBEDDED SYSTEM DESIGN: tems have been manufactured for years, industry and academia have not been sufficiently focused on developing and formalizing a system-level design tech- nology and methodology, even though there was a clear need for it. This need has been magnified by appearance of embedded systems, which can be used anywhere and everywhere, in plains, trains, houses, humans, environment, and manufacturing and in any possible infrastructure. They are application specific and tightly constrained by different requirements emanating from the environ- ment they operate in. Together with ever increasing complexities and market pressures, this makes their design a tremendous challenge and the development of a clear and well-defined system-level design technology unavoidable. There are two reasons for emphasizing more abstract, system-level method- ologies. The first is the fact that high-level abstractions are closer to a designer’s usual way of reasoning. It would be difficult to imagine, for example, how a designer could specify, model and communicate a system design by means of a schematic or hundred thousand lines of VHDL or Verilog code. The more complex the design, the more difficult it is for the designer to comprehend its functionality when it is specified on register-transfer level of abstraction. On the other hand, when a system is described with an application-oriented model of computation as a set of processes that operate on abstract data types and communicate results through abstract channels, the designer will find it much easier to specify and verify proper functionality and to evaluate various imple- mentations using different technologies. The second reason is that embedded system are usually defined by the experts in application domain who understand application very well, but have only basic knowledge of design technology and practice. System-level design technology allows them to specify, explore and verify their embedded system products without expert knowledge of system engineering and manufacturing. It must be acknowledged that research on system design did start many years ago; at the time, however, it remained rather focused to specific domains and communities. For example, the computer architecture community has consid- ered ways of partitioning and mapping computations to different architectures, such as hypercubes, multiprocessors, massively parallel or heterogeneous pro- cessors. The software engineering community has been developing methods for specifying and generating software code. The CAD community has focused on system issues such as specification capture, languages, and modeling. How- ever, simulation languages and models are not synthesizable or verifiable for lack of proper design meaning and formalism. That resulted in proliferation of models and modeling styles that are not useful beyond the modeler’s team. By introduction of well-defined model semantics, and corresponding model transformations for different design decision, it is possible to generate models automatically. Such models are also synthesizable and verifiable. Furthermore, model automation relieves designers from error-prone model coding and even

viii EMBEDDED SYSTEM DESIGN: programs that want to teach software and hardware concepts together instead of in non-related courses. That is particularly needed in today’s embedded systems where software and hardware are interchangeable. From this point, the book would also be valuable for an advanced undergraduate or graduate course targeting students who want to specialize in embedded system, design automation and system design and engineering. Since the book covers multi- ple aspects of system design, it would be very useful reference for any senior project course in which students design a real prototype or for graduate project for system-level tool development.

ORGANIZATION

This book has been organized into eight chapters that can be divided into four parts. Chapter 1 and 2 present the basic issues in embedded system design and discuss various system-design methodologies that can be used in capturing system behavior and refining it into system implementation. Chapter 3 and 4 deal with different models of computations and system modeling at different levels of abstraction as well as system synthesis from those models. Chapter 5, 6, and 7 deal with issues and possible solutions in synthesis and verification of software and hardware component needed in a embedded system platform. Finally, Chapter 8 reviews the key developments and selected current academic and commercial tools in the field of system design, system software and system hardware as well as case study of embedded system environments. Given an understanding of the basic concepts defined in Chapter 1 and 2, each chapter should be self-contained and can be read independently. We have used the same writing style and organization in each chapter of the book. A typical chapter includes an introductory example, defines the basic concepts, it describes the main problems to be solved. It contains a description of several possible solutions, methods or algorithms to the problems that have been posed, and explains the advantages and disadvantages of each approach. Each chapter also includes relationship to previously published work in the field and discusses some open problems in each topic. This book could be used in several different courses. One course would be for application experts with only a basic knowledge of computers engineering. It would emphasize application issues, system specification in application ori- ented models of computation, system modeling and exploration as presented in Chapter 1 - 4. The second course for embedded system designers would emphasize system languages, specification capture, system synthesis and veri- fication with emphasis on Chapter 3, Chapter 4, and Chapter 7. The third course may emphasize system development with component synthesis and tools as de- scribed in Chapter 5 - Chapter 8. In which ever it is used, though, we feel that

PREFACE ix this book will help to fill the vacuum in computer science and engineering cur- riculum where there is need and demand for emphasis on teaching embedded system design techniques in addition to supporting lower levels of abstraction dealing with circuit, logic and architecture design. We hope that the material selection and the writing style will approach your expectations; we welcome your suggestions and comments. Daniel Gajski, Andreas Gerstlauer, Samar Abdi, Gunar Schirner

Contents

Preface v Acknowledgments xi List of Figures xix

    1. INTRODUCTION List of Tables xxv
    • 1.1 System-Design Challenges
    • 1.2 Abstraction Levels
      • 1.2.1 Y-Chart
      • 1.2.2 Processor-Level Behavioral Model
      • 1.2.3 Processor-level structural model
      • 1.2.4 Processor-level synthesis
      • 1.2.5 System-Level Behavioral Model
      • 1.2.6 System Structural Model
      • 1.2.7 System Synthesis
    • 1.3 System Design Methodology
      • 1.3.1 Missing semantics
      • 1.3.2 Model Algebra
    • 1.4 System-Level Models
    • 1.5 Platform Design
    • 1.6 System Design Tools
    • 1.7 Summary
    1. SYSTEM DESIGN METHODOLOGIES
    • 2.1 Bottom-up Methodology
    • 2.2 Top-down Methodology
    • 2.3 Meet-in-the-middle Methodology
    • 2.4 Platform Methodology xiv EMBEDDED SYSTEM DESIGN:
    • 2.5 FPGA Methodology
    • 2.6 System-level Synthesis
    • 2.7 Processor Synthesis
    • 2.8 Summary
    1. MODELING
    • 3.1 Models of Computation
      • 3.1.1 Process-Based Models
      • 3.1.2 State-Based Models
    • 3.2 System Design Languages
      • 3.2.1 Netlists and Schematics
      • 3.2.2 Hardware-Description Languages
      • 3.2.3 System-Level Design Languages
    • 3.3 System Modeling
      • 3.3.1 Design Process
      • 3.3.2 Abstraction Levels
    • 3.4 Processor Modeling
      • 3.4.1 Application Layer
      • 3.4.2 Operating System Layer
      • 3.4.3 Hardware Abstraction Layer
      • 3.4.4 Hardware Layer
    • 3.5 Communication Modeling
      • 3.5.1 Application Layer
      • 3.5.2 Presentation Layer
      • 3.5.3 Session Layer
      • 3.5.4 Network Layer
      • 3.5.5 Transport Layer
      • 3.5.6 Link Layer
      • 3.5.7 Stream Layer
      • 3.5.8 Media Access Layer
      • 3.5.9 Protocol and Physical Layers
    • 3.6 System Models
      • 3.6.1 Specification Model
      • 3.6.2 Network TLM
      • 3.6.3 Protocol TLM
      • 3.6.4 Bus Cycle-Accurate Model (BCAM)
      • 3.6.5 Cycle-Accurate Model (CAM)
    • 3.7 Summary Contents xv
    1. SYSTEM SYNTHESIS
    • 4.1 System Design Trends
    • 4.2 TLM Based Design
    • 4.3 Automatic TLM Generation
      • 4.3.1 Application Modeling
      • 4.3.2 Platform Definition
      • 4.3.3 Application to Platform Mapping
      • 4.3.4 TLM Based Performance Estimation
      • 4.3.5 TLM Semantics
    • 4.4 Automatic Mapping
      • 4.4.1 GSM Encoder Application
      • 4.4.2 Application Profiling
      • 4.4.3 Load Balancing Algorithm
      • 4.4.4 Longest Processing Time Algorithm
    • 4.5 Platform Synthesis
      • 4.5.1 Component data models
      • 4.5.2 Platform Generation Algorithm
      • 4.5.3 Cycle Accurate Model Generation
      • 4.5.4 Summary
    1. SOFTWARE SYNTHESIS
    • 5.1 Preliminaries
      • 5.1.1 Target Languages for Embedded Systems
      • 5.1.2 RTOS
    • 5.2 Software Synthesis Overview
      • 5.2.1 Example Input TLM
      • 5.2.2 Target Architecture
    • 5.3 Code Generation
    • 5.4 Multi-Task Synthesis
      • 5.4.1 RTOS-based Multi-Tasking
      • 5.4.2 Interrupt-based Multi-Tasking
    • 5.5 Internal Communication
    • 5.6 External Communication
      • 5.6.1 Data Formatting
      • 5.6.2 Packetization
      • 5.6.3 Synchronization
      • 5.6.4 Media Access Control
    • 5.7 Startup Code xvi EMBEDDED SYSTEM DESIGN:
    • 5.8 Binary Image Generation
    • 5.9 Execution
    • 5.10Summary
    1. HARDWARE SYNTHESIS
    • 6.1 RTL Architecture
    • 6.2 Input Models
      • 6.2.1 C-code specification
      • 6.2.2 Control-Data Flow Graph specification
      • 6.2.3 Finite State Machine with Data specification
      • 6.2.4 RTL specification
      • 6.2.5 HDL specification
    • 6.3 Estimation and Optimization
    • 6.4 Register Sharing
    • 6.5 Functional Unit Sharing
    • 6.6 Connection Sharing
    • 6.7 Register Merging
    • 6.8 Chaining and Multi-Cycling
    • 6.9 Functional-Unit Pipelining
    • 6.10Datapath Pipelining
    • 6.11Control and Datapath Pipelining
    • 6.12Scheduling
      • 6.12.1RC scheduling
      • 6.12.2TC scheduling
    • 6.13Interface Synthesis
    • 6.14Summary
    1. VERIFICATION
    • 7.1 Simulation Based Methods
      • 7.1.1 Stimulus Optimization
      • 7.1.2 Monitor Optimization
      • 7.1.3 SpeedUp Techniques
      • 7.1.4 Modeling Techniques
    • 7.2 Formal Verification Methods
      • 7.2.1 Logic Equivalence Checking
      • 7.2.2 FSM Equivalence Checking
      • 7.2.3 Model Checking Contents xvii
      • 7.2.4 Theorem Proving
      • 7.2.5 Drawbacks of Formal Verification
      • 7.2.6 Improvements to Formal Verification Methods
      • 7.2.7 Semi-formal Methods: Symbolic Simulation
    • 7.3 Comparative Analysis of Verification Methods
    • 7.4 System Level Verification
      • 7.4.1 Formal Modeling
      • 7.4.2 Model Algebra
      • 7.4.3 Verification by Correct Refinement
    • 7.5 Summary
    1. EMBEDDED DESIGN PRACTICE
    • 8.1 System Level Design Tools
      • 8.1.1 Academic Tools
      • 8.1.2 Commercial Tools
      • 8.1.3 Outlook
    • 8.2 Embedded Software Design Tools
      • 8.2.1 Academic Tools
      • 8.2.2 Commercial Tools
      • 8.2.3 Outlook
    • 8.3 Hardware Design Tools
      • 8.3.1 Academic Tools
      • 8.3.2 Commercial Tools
      • 8.3.3 Outlook
    • 8.4 Case Study
      • 8.4.1 Embedded System Environment
      • 8.4.2 Design Driver: MP3 Decoder
      • 8.4.3 Results
    • 8.5 Summary
  • References
  • Index
  • 1.1 Y-Chart List of Figures
  • 1.2 FSMD model
  • 1.3 CDFG model
  • 1.4 Instruction-set flow chart
  • 1.5 Processor structural model
  • 1.6 Processor synthesis
  • 1.7 System behavioral model
  • 1.8 System structural model
  • 1.9 System synthesis
  • 1.10 Evolution of design flow over the past 50 years
  • 1.11 Missing semantics
  • 1.12 Model equivalence
  • 1.13 SER Methodology
  • 1.14 System TLM
  • 1.15 System CAM
  • 1.16 Platform architecture
  • 1.17 General system environment
  • 1.18 System tools
  • 2.1 Bottom-up methodology
  • 2.2 Top-down methodology
  • 2.3 Meet-in-the-middle methodology (option 1)
  • 2.4 Meet-in-the-middle methodology (option 2)
  • 2.5 Platform methodology
  • 2.6 System methodology
  • 2.7 FPGA methodology
  • 2.8 System-level synthesis xx List of Figures
  • 2.9 Processor synthesis
  • 3.1 Kahn Process Network (KPN) example
  • 3.2 Synchronous Data Flow (SDF) example
  • 3.3 Finite State Machine with Data (FSMD) example
  • 3.4 Hierarchical, Concurrent Finite State Machine (HCFSM) example
  • 3.5 Process State Machine (PSM) example
  • 3.6 System design and modeling flow
  • 3.7 Model granularities
  • 3.8 Processor modeling layers
  • 3.9 Application layer
  • 3.10 Operating system layer
  • 3.11 Operating system modeling
  • 3.12 Task scheduling
  • 3.13 Hardware abstraction layer
  • 3.14 Interrupt scheduling
  • 3.15 Hardware layer
  • 3.16 Application layer synchronization
  • 3.17 Application layer storage
  • 3.18 Application layer channels
  • 3.19 Presentation layer
  • 3.20 Session layer
  • 3.21 Network layer
  • 3.22 Communication elements
  • 3.23 Link layer
  • 3.24 Link layer synchronization
  • 3.24 Link layer synchronization (con’t)
  • 3.25 Media access layer
  • 3.26 Protocol layer
  • 3.27 Physical layer
  • 3.28 System models
  • 3.29 Specification model
  • 3.30 Network TLM
  • 3.31 Protocol TLM
  • 3.32 Bus Cycle-Accurate Model (BCAM)
  • 3.33 Cycle-Accurate Model (CAM)
  • 3.34 Modeling results List of Figures xxi
  • 4.1 A traditional board-based system design process.
  • 4.2 A virtual platform based development environment.
  • 4.3 A model based development flow of the future.
  • 4.4 TLM based design flow.
  • 4.5 Modeling layers for TLM.
  • 4.6 System synthesis flow with given platform and mapping.
  • 4.7 A simple application expressed in PSM model of computation.
  • 4.8 A multicore platform specification.
  • 4.9 Mapping from application model to platform.
  • 4.10 Computation timing estimation.
  • 4.11 Communication timing estimation.
  • 4.12 Synchronization Modeling with Flags and Events.
  • 4.13 Automatically Generated TLM from system specification.
  • 4.14 System synthesis with fixed platform.
  • 4.15 Application example: GSM Encoder
  • 4.16 Application profiling steps.
  • 4.17 Profiled statistics of GSM encoder.
  • 4.18 Abstraction of profiled statistics into an application graph.
  • 4.19 Creation of platform graph.
  • 4.20 Flowchart of load balancing algorithm for mapping generation.
  • 4.21 Platform graph with communication costs.
  • 4.22 LPT cost function computation.
  • 4.23 Flowchart of LPT algorithm for mapping generation.
  • 4.24 System synthesis from application and constraints.
  • 4.25 Flowchart of a greedy algorithm for platform generation.
  • 4.26 Illustration of platform generation on a GSM Encoder example.
  • 4.27 Cycle accurate model generation from TLM.
  • 5.1 Synthesis overview
  • 5.2 Software synthesis flow
  • 5.3 Input system TLM example
  • 5.4 Generic target architecture
  • 5.5 Task specification
  • 5.6 Software execution stack for RTOS-based multi-tasking
  • 5.7 Multi-task example model
  • 5.8 Software execution stack for interrupt-based multi-tasking
  • 5.9 Interrupt-based multi-tasking example xxii List of Figures
  • 5.10 Internal communication
  • 5.11 External communication
  • 5.12 Marshalling example
  • 5.13 Packetization
  • 5.14 Chain for interrupt-based synchronization
  • 5.15 Events in interrupt-based synchronization
  • 5.16 Polling-based synchronization
  • 5.17 Events in polling-based synchronization
  • 5.18 Transferring a packet using bus primitives
  • 5.19 Binary image generation
  • 5.20 ISS-based Virtual platform
  • 6.1 HW synthesis design flow
  • 6.2 High-level block diagram
  • 6.3 RTL diagram with FSM controller
  • 6.4 RTL diagram with programmable controller
  • 6.5 CDFG for Ones counter
  • 6.6 FSMD specification
  • 6.7 RTL Specification
  • 6.8 Square-root algorithm (SRA)
  • 6.9 Gain in register sharing
  • 6.10 General partitioning algorithm
  • 6.11 Variable merging for SRA example
  • 6.12 SRA datapath with register sharing
  • 6.13 Gain in functional unit sharing
  • 6.14 Functional unit merging for SRA
  • 6.15 SRA design after register and unit merging
  • 6.16 SRA Datapath with labeled connections
  • 6.17 Connection merging for SRA
  • 6.18 SRA Datapath after connection merging
  • 6.19 Register merging
  • 6.20 Datapath schematic after register merging
  • 6.21 Modified FSMD models for SRA algorithm
  • 6.22 Datapath with chained functional units
  • 6.23 SRA datapath with chained and multi-cycle functional units
  • 6.24 Functional unit pipelining
  • 6.25 Datapath pipelining List of Figures xxiii
  • 6.26 Control and datapath pipelining
  • 6.27 C and CDFG
  • 6.28 ASAP, ALAP, and RC schedules for SRA
  • 6.29 RC algorithm
  • 6.30 TC algorithm
  • 6.31 ASAP, ALAP, and RC schedules for SRA
  • 6.32 Distribution graphs for TC scheduling of the SRA example
  • 6.33 HW Synthesis timing constraints
  • 6.34 FSMD for MAC driver
  • 6.35 Custom HW component with bus interface
  • 6.36 A typical bus protocol
  • 6.37 Transducer structure
  • 7.1 A typical simulation environment
  • 7.2 A test case that covers only part of the design.
  • 7.3 Coverage analysis results in a more useful test case.
  • 7.4 Graphical visualization of the design helps debugging.
  • 7.5 A typical emulation setup.
  • 7.6 Logic equivalence checking by matching of cones.
  • 7.7 DeMorgan’s law illustrated by ROBDD equivalence.
  • 7.8 Equivalence checking of sequential design using product FSMs.
  • 7.9 Product FSM for with a reachable error state.
  • 7.10 A typical model checking scenario.
  • 7.11 A computation tree derived from a state transition diagram.
  • 7.12 Various temporal properties shown on the computation tree.
  • 7.13 Proof generation process using a theorem prover.
  • 7.14 Associativity of parallel behavior composition.
  • 7.15 Basic laws for a theory of system models.
  • 7.16 Symbolic simulation of Boolean circuits.
  • 7.17 System level models.
  • 7.18 A simple hierarchical specification model.
  • 7.19 Behavior partitioning and the equivalence of models.
  • 7.20 Equivalence of models resulting from channel mapping.
  • 7.21 Model refinement using functionality preserving transformations.
  • 8.1 Metropolis framework
  • 8.2 SystemCoDesigner tool flow
  • 8.3 Daedalus tool flow xxiv List of Figures
  • 8.4 PeaCE tool flow
  • 8.5 SCE tool flow
  • 8.6 NISC technology tools
  • 8.7 The SPARK Synthesis Methodology
  • 8.8 xPilot Synthesis System
  • 8.9 ESE tool flow
  • 8.10 System level design with ESE front end
  • 8.11 SW-HW synthesis with ESE back end
  • 8.12 MP3 decoder application model
  • 8.13 MP3 decoder platform SW+4
    • tem models 8.14 Execution speed and accuracy trade-offs for embedded sys-
  • 8.15 MP3 manual design quality
  • 8.16 Automatically generated MP3 design quality
  • 8.17 Development productivity gains from model automation
  • 8.18 Validation productivity gain from using TLM vs. CAM