logo资料库

Verilog:Frequently Asked Questions(英文).pdf

第1页 / 共202页
第2页 / 共202页
第3页 / 共202页
第4页 / 共202页
第5页 / 共202页
第6页 / 共202页
第7页 / 共202页
第8页 / 共202页
资料共202页,剩余部分请下载后查看
front-matter
1Basic Verilog
2RTL Design
4Miscellaneous
5Miscellaneous
6Verilog During Simulation Regressions
back-matter
Verilog: Frequently Asked Questions
Shivakumar Chonnad Needamangalam Balachander Verilog: Frequently Asked Questions Language, Applications and Extensions Springer
eBook ISBN: Print ISBN: 0-387-22899-3 0-387-22834-9 ©2004 Springer Science + Business Media, Inc. Print ©2004 Springer Science + Business Media, Inc. Boston All rights reserved No part of this eBook may be reproduced or transmitted in any form or by any means, electronic, mechanical, recording, or otherwise, without written consent from the Publisher Created in the United States of America Visit Springer's eBookstore at: and the Springer Global Website Online at: http://www.ebooks.kluweronline.com http://www.springeronline.com
To our wives, Manjula Chonnad and jayanthi Balachander To our children, Akshata Chonnad, Puja Balachander, and Manya Balachander
Contents Dedication Contributing Authors Foreword Preface Acknowledgments 1 BASIC VERILOG 1.1 Assignments 1.1.1 1.1.2 1.1.3 1.1.4 What are the differences between continuous and procedural assignments? What are the differences between assignments in initial and always constructs? What are the differences between blocking and nonblocking assignments? How can I model a bi-directional net with assignments influencing both source and destination? v xvii xix xxi xxvii 1 1 1 2 3 4
viii 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 Verilog FAQs : Language, Extensions and Applications Tasks and Functions 5 5 What are the differences between a task and a function? Are tasks and functions re-entrant, and how are they different from static task and function calls? Illustrate with an 6 example 9 How can I override variables in an automatic task? 10 What are the restrictions of using automatic tasks? How can I call a function like a task, that is, not have a return 11 value assigned to a variable? 12 What are the rules governing usage of a Verilog function? 1.3 Parameters 13 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 13 17 How can I override a module’s parameter values during instantiation? What are the rules governing parameter assignments? How do I prevent selected parameters of a module from being overridden during instantiation? What are the differences between using ‘define, and using 19 either parameter or defparam for specifying variables? What are the pros and cons of specifying the parameters using the defparam construct vs. specifying during instantiation? 20 What is the difference between the specparam and parameter 21 constructs? What are derived parameters? When are derived parameters useful, and what are their limitations? 21 18 1.4 Ports 22 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 What are the different approaches of connecting ports in a 22 hierarchical design? What are the pros and cons of each? Can there be full or partial no-connects to a multi-bit port of a module during its instantiation? 28 What happens to the logic after synthesis, that is driving an unconnected output port that is left open (that is, no- connect) during its module instantiation? What value is sampled by the logic from an input port that is left open (that is, no-connect) during its module instantiation? How is the connectivity established in Verilog when connecting wires of different widths? 33 Can I use a Verilog function to define the width of a multi-bit port, wire, or reg type? 33 29 31
2 RTL DESIGN 2.1 Assignments ix 35 35 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 35 36 What logic is inferred when there are multiple assign statements targeting the same wire? What do conditional assignments get inferred into? What is the logic that gets synthesized when conditional operators in a single continuous assignment are nested? 36 What value is inferred when multiple procedural assignments made to the same reg variable in an always block? 37 Why should a nonblocking assignment be used for sequential logic, and what would happen if a blocking assignment were used? Compare it with the same code in a combinatorial block. 39 2.2 Tasks and Functions 42 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 What does the logic in a function get synthesized into? What are the area and timing implications of calling functions in RTL? What are a few important considerations while writing a Verilog function? What does the logic in a task get synthesized into? Explain with an example 48 What are the differences between using a task, and defining a module for implementing reusable logic? 50 Can tasks and functions be declared external to the scope of module-endmodule? 42 44 50 2.3 Storage Elements 51 51 55 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 Summary of RTL templates for different flip-flops types Summary of RTL templates for different Latch types What are the considerations to be taken choosing between flop-flops vs. latches in a design? Which one is better, asynchronous or synchronous reset for the storage elements? 61 What logic gets synthesized when I use an integer instead of a reg variable as a storage element? Is use of integer recommended? 59 62 2.4 Flow-control Constructs 63 2.4.1 2.4.2 How do I choose between a case statement and a multi-way if-else statement? How do I avoid a priority encoder in an if-else tree? 63 64
x Verilog FAQs : Language, Extensions and Applications 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 65 66 What are the differences between if-else and the (“?:”) conditional operator? What is the importance of a default clause in a case construct? What is the difference between full_case and parallel_case synthesis directive? 66 What is the difference in implementation with sequential and combinatorial processes, when the final else clause in a multi- way if-else construct is missing? 67 What is the difference in using (== or !=) vs. (=== or !==) in decision making of a flow control construct in a synthesizable code? 69 Explain the differences and advantages of casex and casez over the case statement? 69 2.5 Finite State Machines 70 2.5.1 2.5.2 2.5.3 2.5.4 What are the differences between synchronous and asynchronous state machines? Illustrate the differences between Mealy and Moore state machines. Illustrate the differences between binary encoding and one- hot encoding mechanisms state machines. 73 Explain a reversed case statement, and how it can be useful to infer a one-hot state machine? 74 71 71 2.6 Memories 2.6.1 2.6.2 2.6.3 Illustrate how a multi-dimensional array is implemented. What are the considerations in instantiating technology- specific memories? What are the factors that dictate the choice between synchronous and asynchronous memories? 75 75 78 79 2.7 General Design Considerations 80 What are some reusable coding practices for RTL Design? . 80 What are “snake” paths, and why should they be avoided? . 81 What are a few considerations while partitioning large designs? 81 2.7.1 2.7.2 2.7.3 2.8 Multiple clock Design Considerations 82 2.8.1 2.8.2 How can I reliably convey control information across clock domains? 82 What is a safe strategy to transfer data of different bus-widths and across different clock domains? 84
分享到:
收藏