Wiley verilog coding for logic synthesis 2003

334 171 0
Wiley verilog coding for logic synthesis 2003

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Verilog Coding for Logic Synthesis Verilog Coding for Logic Synthesis WENG FOOK LEE A JOHN WILEY & SONS, INC., PUBLICATION Copyright © 2003 by John Wiley & Sons, Inc All rights reserved Published by John Wiley & Sons, Inc., Hoboken, New Jersey Published simultaneously in Canada 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, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400, fax 978-750-4470, or on the web at www.copyright.com Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, e-mail: permreq@wiley.com Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose No warranty may be created or extended by sales representatives or written sales materials The advice and strategies contained herein may not be suitable for your situation You should consult with a professional where appropriate Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages For general information on our other products and services please contact our Customer Care Department within the U.S at 877-762-2974, outside the U.S at 317-572-3993 or fax 317-572-4002 Wiley also publishes its books in a variety of electronic formats Some content that appears in print, however, may not be available in electronic format Library of Congress Cataloging-in-Publication Data: Printed in the United States of America 10 Dedicated to my mother for all her sacrifices Contents Table of Figures xi Table of Examples xvii List of Tables xxi Preface xxiii Acknowledgments xxv Trademarks xxvi Introduction Asic Design Flow 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 Specification RTL Coding 2.2.1 Types of Verilog Code: RTL, Behavioral, and Structural Test Bench and Simulation Synthesis Prelayout Timing Analysis APR Back Annotation Post layout Timing Analysis Logic Verification Verilog Coding 3.1 Introduction to Basic Verilog Concepts 3.1.1 Verilog Syntax 6 10 11 12 13 14 16 16 16 vii viii CONTENTS 3.2 3.3 3.4 3.1.2 Comments 3.1.3 Numbers 3.1.4 Verilog Data Type 3.1.5 Signal Strength Verilog Gate-Level Primitives User-Defined Primitives 3.3.1 Combinational UDP 3.3.2 Sequential UDP Concurrent and Sequential Statements Coding Style: Best-Known Method for Synthesis 4.1 4.2 4.3 Naming Convention Design Partitioning Clock 4.3.1 Internally Generated Clock 4.3.2 Gated Clock 4.4 Reset 4.4.1 Asynchronous Reset 4.4.2 Synchronous Reset 4.5 Timing Loop 4.6 Blocking and Nonblocking Statement 4.7 Sensitivity List 4.8 Verilog Operators 4.8.1 Conditional Operators 4.8.2 Bus Concatenation Operator 4.8.3 Shift Operator 4.8.4 Arithmetic Operator 4.8.5 Division Operator 4.8.6 Modulus Operator 4.8.7 Logical Operator 4.8.8 Bitwise Operator 4.8.9 Equality Operator 4.8.10 Reduction Operator 4.8.11 Relational Operator 4.9 Latch Inference 4.10 Memory Array 4.11 State Machine Design 4.11.1 Intelligent Traffic Control System Design Example of Programmable Timer 5.1 5.2 Programmable Timer Design Specification Microarchitecture Definition for Programmable Timer 17 17 19 25 27 34 35 37 40 41 41 43 44 46 47 51 51 52 53 54 66 68 68 69 71 78 85 92 100 105 112 115 117 121 127 132 133 151 151 153 CONTENTS 5.3 5.4 5.5 Flow Diagram Definition for Programmable Timer Verilog Code for Programmable Timer Synthesizable Verilog Code for Programmable Timer Design Example of Programmable Logic Block for Peripheral Interface 6.1 6.2 6.3 6.4 6.5 6.6 Programmable Logic Block for Peripheral Interface Design Specification Mode of Operation for Programmable Logic Block for Peripheral Interface 6.2.1 Mode Operation 6.2.2 Mode Operation 6.2.3 Mode Operation Microarchitecture Definition for Programmable Peripheral Interface Flow Diagram Definition for Programmable Peripheral Interface Synthesizable Verilog Code for Programmable Peripheral Interface Simulation for Programmable Peripheral Interface Design 6.6.1 6.6.2 6.6.3 6.6.4 6.6.5 6.6.6 6.6.7 6.6.8 6.6.9 6.6.10 6.6.11 Simulation for Mode Operation with PortA, PortB, and PortC as input and Output Simulation for Mode Operation with PortA, PortB, and PortC Lower as Input and PortC Upper as Output Simulation for Mode Operation with PortA, PortB, and PortC Upper as Input and PortC Lower as Output Simulation for Writing and Reading Data from STATUS and CWR Register Simulation for Mode Operation with PortA and PortB as Strobed Input Simulation for Mode Operation with PortA as Strobed Input and PortB as Strobed Output Simulation for Mode Operation with PortA as Strobed Output and PortB as Strobed Input Simulation for Mode Operation with PortA and PortB as Strobed Output Simulation for Mode Operation with PortA as Strobed I/O and PortB as Input Simulation for Mode Operation with PortA as Strobed I/O and PortB as Output Simulation for Mode Operation with PortA and PortB as Strobed Input and STATUS Register Disabled ix 155 161 175 181 182 185 185 187 188 189 191 213 234 235 240 245 249 253 257 262 267 272 277 282 x CONTENTS 6.6.12 Simulation for Mode Operation with PortA as Strobed I/O and PortB as Output and STATUS Register Disabled Appendix Appendix A.1 two-bit by two-bit adder Appendix A.2 two-bit by two-bit subtractor Appendix A.3 four-bit by four-bit multiplier 287 293 293 295 297 Glossary 305 Bibliography 307 Index 308 Table of Figures Figure 2.1 Figure 2.2 Diagram Showing an ASIC Design Flow Diagram Indicating Step of an ASIC Design Flow: Specification Figure 2.3 Diagram Showing the Definition of Architecture and Micro Architecture Figure 2.4 Diagram Indicating Step of an ASIC Design Flow: RTL Coding Figure 2.5 Diagram Indicating Step of an ASIC Design Flow: Testbench and Simulation Figure 2.6 Diagram Indicating Step of an ASIC Design Flow: Synthesis Figure 2.7 Diagram Indicating Step of an ASIC Design Flow: Pre Layout Timing Analysis Figure 2.8 Diagram Indicating Step of an ASIC Design Flow: Auto Place & Route (APR) Figure 2.9 Diagram Indicating Step of an ASIC Design Flow: Back Annotation Figure 2.10 Diagram Indicating Step of an ASIC Design Flow: Post Layout Timing Analysis Figure 2.11 Diagram Indicating Step of an ASIC Design Flow: Logic Verification Figure 4.1 Diagram Showing Two Sub-modules Connected on a Fullchip Level Figure 4.2 Diagram Showing a Fullchip Level of Global Clock Interconnect Figure 4.3 Diagram Showing Ideal Connectivity of Clock Signal in a Design Figure 4.4 Diagram Showing an Output Flip-flop Driving Another Flip-flop 4 11 12 13 14 15 42 44 45 46 xi APPENDIX inputA inputA inputA inputA inputA inputA inputA inputA inputA inputA inputA inputA inputA inputA inputA inputA 00 00 00 00 01 01 01 01 10 10 10 10 11 11 11 11 inputB inputB inputB inputB inputB inputB inputB inputB inputB inputB inputB inputB inputB inputB inputB inputB APPENDIX A.2 00 01 10 11 00 01 10 11 00 01 10 11 00 01 10 11 outputA outputA outputA outputA outputA outputA outputA outputA outputA outputA outputA outputA outputA outputA outputA outputA 000 001 010 011 001 010 011 100 010 011 100 101 011 100 101 110 TWO-BIT BY TWO-BIT SUBTRACTOR Verilog code for a two-bit by two-bit subtractor: module subtraction_2bit (inputA, inputB, outputA); input [1:0] inputA, inputB; output [2:0] outputA; wire [2:0] outputA; assign outputA = inputA - inputB; endmodule Verilog test bench to simulate the two-bit by two-bit subtractor: module subtraction_2bit_tb (); reg [1:0] reg_inputA, reg_inputB; wire [2:0] wire_outputA; integer i,j; initial begin for (i=0; i

Ngày đăng: 21/04/2017, 22:59

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan