The simple art of SoC design: closing the gap between RTL and ESL 9781441985859, 9781441985866, 1441985859, 1441985867

This book tackles head-on the challenges of digital design in the era of billion-transistor SoCs. It discusses fundament

189 58 4MB

English Pages XVII, 234 Seiten Illustrationen, Diagramme [242] Year 2011

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Guidelines for Datapath Synthesis......Page 3
Mixed Unsigned/Signed Expression......Page 5
Cluster Datapath Portions......Page 7
Complementing an Operand......Page 9
C Version......Page 13
Cover......Page 1
The SimpleArt of SoC Design......Page 4
Disclaimer......Page 6
Preface......Page 10
Raising the Level of Abstraction of RTL......Page 11
Fork and Join......Page 12
Interfaces......Page 2
Foreword......Page 8
Contents......Page 14
Final RTL Version......Page 15
Gates per Line of Code......Page 17
Canonical Design......Page 18
Summary......Page 16
The Problem......Page 19
Divide and Conquer......Page 21
Tightly Coupled vs. Loosely Coupled Systems......Page 25
Proposal – New Data Types......Page 26
Sequential and Combinational Processes......Page 27
The Challenge of Verification......Page 28
The Pursuit of Simplicity......Page 29
Structure of This Book......Page 30
Challenges......Page 32
Syntactic Fluff......Page 33
Concurrency and State Space......Page 34
Reference for Examples......Page 35
Techniques......Page 36
Encapsulating Combinational Code......Page 37
Structuring Sequential Code......Page 38
Interfaces......Page 41
Thinking High-level......Page 42
FIFOs......Page 43
Chapter 3: Reducing Complexity in Control-Dominated Designs......Page 44
Original Code......Page 45
Preprocessing Sequential Code......Page 49
Preprocessing Combinational Code......Page 51
The General Model......Page 22
Rule of Seven......Page 24
Using High Level Data Types......Page 40
State Space in the Original Design......Page 46
Comments......Page 47
Recoding the State Machine......Page 52
Relocating Other Sequential Code......Page 54
Rewriting Combinational Code......Page 55
Analyzing the New Code......Page 57
System Verilog......Page 58
Simplified Block Diagram......Page 60
Summary......Page 61
General Model for HFSMs......Page 63
Converting the BCU to a HFSM......Page 67
Input, Output, and Internal State Space......Page 71
Preliminary Calculations of State Space......Page 72
Shallow vs. Deep State Space......Page 74
The Cross Product of State Spaces......Page 76
Encapsulating Sequential Code......Page 79
State Machines as Sequential Processes......Page 80
Examples......Page 81
Input State Space......Page 84
State Space for Hierarchical State Machines......Page 85
Chapter 6: Verification......Page 86
Some Simple Examples of Verifiable Designs......Page 87
Verification Overview......Page 88
Goals of Complete Verification......Page 89
Verifying State Machines......Page 90
Example: The BCU......Page 92
Structure of the Canonical Design......Page 95
Separating Data from Control......Page 96
Verifying the Control Path: The State Machine......Page 97
Line Coverage......Page 98
Input State Coverage......Page 99
Data Path Uniqueness......Page 100
Verifying the Data Path Algorithm......Page 101
Chapter 7: Reducing Complexity in Data Path Dominated Designs......Page 103
Problems and Limitations in the Original Code......Page 105
Minimizing Lines of Code......Page 106
Other Versions of the Code......Page 110
Task Version......Page 111
More Code Size Reduction......Page 112
Untimed Version......Page 114
Experimental Versions......Page 116
Reference Versions......Page 117
Synthesis Results......Page 119
Canonical Design......Page 120
Summary......Page 121
Command-based Interface......Page 122
Example: CPU Pipeline......Page 124
Example: BCU......Page 126
Example: USB......Page 128
Separating Data and Control......Page 130
General Connectivity......Page 131
Summary......Page 133
Chapter 9: Complexity at the Chip Level......Page 135
From Command to Transaction Interfaces......Page 138
JPEG Example......Page 139
USB Example......Page 140
Virtual Platforms and Software Development......Page 141
Connectivity and Bandwidth......Page 142
Transactions and Complexity......Page 143
Limits to Chip Level Verification......Page 145
Sub-systems and SoC Design......Page 146
Summary......Page 149
The Challenge......Page 150
Current High Level Synthesis Tools......Page 151
Closing the Abstraction Gap......Page 156
SystemC......Page 157
SystemVerilog as a High Level Design Language......Page 158
Raising the Level of Abstraction of RTL......Page 160
SystemVerilog as a Domain Specific Language......Page 161
SystemVerilog Primitives......Page 162
Proposal......Page 163
Basic Extensions......Page 165
smodule......Page 168
bit_comb......Page 169
state_machine......Page 170
Functions and Tasks......Page 171
Iterative State Loops......Page 172
Fork and Join......Page 176
Summary......Page 178
There is No Substitute for Good Code......Page 179
Chapter 12: The Future of Design......Page 181
Function Does Not Scale......Page 182
Small is Beautiful – and Tractable......Page 185
Automation and Scaling......Page 186
Verification......Page 187
Visualization......Page 188
Drivers of the Solution......Page 189
Summary......Page 190
General......Page 191
Interfaces......Page 192
Partitioning......Page 193
Sign-/Zero-extension......Page 194
Mixed Unsigned/Signed Expression......Page 195
Signed part-select / concatenation......Page 196
Cluster Datapath Portions......Page 197
Component Instantiation......Page 198
Complementing an Operand......Page 199
Simple Hierarchical State Machine in synthesizable SystemVerilog......Page 200
C Version......Page 203
Final RTL Version......Page 205
DCT Using Proposed SystemVerilog Extensions......Page 211
Overview......Page 215
Proposal – New Module Type......Page 216
Sequential and Combinational Processes......Page 217
Operators......Page 218
$clock......Page 219
$reset......Page 220
Tasks......Page 222
Functions......Page 223
Limitations:......Page 224
Reference for Examples......Page 225
Example 1 – Extended data types in processes......Page 226
Example 3 - A slightly more complex example......Page 227
Translation Example – Simple State Machine......Page 228
Interfaces......Page 231
Parameters of Type Type......Page 232
FIFOs......Page 233
push_front()......Page 234
push_back()......Page 235
References......Page 239
Index......Page 241
Recommend Papers

The simple art of SoC design: closing the gap between RTL and ESL
 9781441985859, 9781441985866, 1441985859, 1441985867

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Citation preview

The Simple Art of SoC Design

wwwwwwwwwwwwwww

Michael Keating

The Simple Art of SoC Design Closing the Gap between RTL and ESL

Michael Keating Synopsys 1925 Cowper St. Palo Alto, CA 94301 USA [email protected]

ISBN 978-1-4419-8585-9 e-ISBN 978-1-4419-8586-6 DOI 10.1007/978-1-4419-8586-6 Springer New York Dordrecht Heidelberg London Library of Congress Control Number: 2011924222 © Synopsys, Inc. 2011 All rights reserved. This work may not be translated or copied in whole or in part without the written permission of the publisher (Springer Science+Business Media, LLC, 233 Spring Street, New York, NY 10013, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed is forbidden. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. Printed on acid-free paper Springer is part of Springer Science+Business Media (www.springer.com)

Disclaimer

Because of the possibility of human or mechanical error, neither the author, Synopsys, Inc., nor any of its affiliates, including but not limited to Springer Science+Business Media, LLC, guarantees the accuracy, adequacy or completeness of any information contained herein and are not responsible for any errors or omissions, or for the results obtained from the use of such information. THERE ARE NO EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE relating to this book. In no event shall the author, Synopsys, Inc., or its affiliates be liable for any indirect, special or consequential damages in connection with the information provided herein.

v

wwwwwwwwwwwwwww

Foreword

A new graduate may think: “SoC design is exciting; I want to design chips for SmartPhones!” But, experienced RTL designers know that the reality of SoC design is more than exciting. It takes blood, sweat and tears to wrestle up to 20 Million lines of Verilog code into a production-ready product. Chip companies apply manpower, the latest tools and very sophisticated methodologies to find and fix the bugs in an SoC before it goes to silicon – bugs that can run into the thousands. Hardware designers take pride in the fact that, out of necessity, they routinely create higher quality code than software developers. Unlike software that is often fixed after the product is shipped, the hardware must be essentially bug-free before tape-out. As design size and complexity has grown dramatically, it has become much harder for hardware design teams to live up to this promise. The result is often called the “verification crisis.” The design community, along with the EDA industry, has responded to this crisis by making significant improvements in verification technology and methodology. The testbench has become parameterized and object oriented, and the evaluation of simulation results is now automated. This has helped to make verification teams much more productive. But it is obvious that the verification crisis cannot be solved exclusively on the verification side. It has to be addressed on the design side as well. Why fix bugs in your design, if you can avoid them in the first place? Why create more bugs than necessary by writing too many lines of code? There are several approaches to the problem. The current generation of high-level synthesis tools allows for a drastic reduction in code size and thus reduces the number of bugs a designer will introduce. They generate good quality implementations for a wide range of signal processing applications. This is closing the gap from the top. The other approach is to move RTL designers incrementally up to the next level, improving quality while staying within the RTL paradigm that they are comfortable in. In this book, Mike Keating takes on the design part of the problem from the pragmatic view of an RTL designer. As co-author of the Reuse Methodology Manual and the Low Power Methodology Manual, he has established a track record of delivering practical design methodology. In this book, based on his extensive experience and research, Mike proposes some very practical, proven methods for writing better RTL, resulting in fewer lines of code and fewer bugs. He calls writing RTL an art, but he also realizes that every artist deserves the best tools –in this case vii

viii

Foreword

a language that facilitates good design. To this end he suggests how the language (SystemVerilog) could be extended to enable a better, more concise coding style. Whether you are a college student or an experienced RTL designer, I hope you will be open for change in how hardware design is done. We at Synopsys have supported Mike Keating’s work on this book, because we firmly believe that we need to get new concepts in front of RTL designers. We feel that a strong collaboration between designers and the EDA industry is key to designing tomorrow’s most advanced SoCs. VP of Strategic Alliances, Synopsys

Rich Goldman

Preface

On a bleak January night in 1992, I sat hunched over a computer screen and a logic analyzer. It was well past midnight, and I was the only person in the lab – probably the only person in the building. We had just gotten an ASIC back from the ASIC house, and, of course, when we fired it up it didn’t work. The other guys had narrowed the problem down somewhat; now it was my turn to try to find the cause. I had narrowed it down to a particular module which had been written by an engineer we’ll call Jeff. Working my way through Jeff’s code, trying to find the cause of the bug, I realized that he had not indented his if-then-else statements. This made it absolutely impossible for me to figure out what his code was doing. So at 1:00 in the morning, I spent an hour or so carefully indenting his code – and thinking very unkind thoughts about Jeff. Once I had his code carefully laid out, it was trivial to find the problem - it was an else that should have been associated with a different if. Of course, with such poorly structured code, it is unlikely that Jeff knew exactly what his code did. Otherwise he would have spotted the rather obvious problem himself. Instead, the problem made its way into the silicon. Fortunately, we were able to compensate for with a software change. In early 2010, I happened to interview a significant number of candidates for an entry-level design position. Most of these candidates were right out of school, but a few of them had a couple of years of experience. To each of these candidates I gave a very simple problem, to set them at their ease before I started asking the hard ones. I drew this on the whiteboard:

ix

x

Preface

Every single candidate who was right out of school said (pretty much word for word): “Let us label the output of the AND gate D.” Then they wrote: assign D = A && B; always @ (posedge clk) begin C