Modeled Example Written in VHDL, Verilog and C. Douglas J

Modeled Example Written in VHDL, Verilog and C. Douglas J

VHDL & Verilog Compared & Contrasted - Plus Modeled Example Written in VHDL, Verilog and C. Douglas J. Smith VeriBest Incorporated One Madison Industrial Estate, Huntsville, AL 35894-0001, USA e-mail: [email protected] Abstract and Verilog. When modeling abstract hardware, the capability of VHDL can sometimes only be achieved in Verilog when using the This tutorial is in two parts. The first part takes an unbiased view of PLI. The choice of which to use is not therefore based solely on VHDL and Verilog by comparing their similarities and contrasting technical capability but on: their diffrences. The second part contains a worked example of a model that computes the Greatest Common Divisor (GCD) of two • personal preferences numbers. The GCD is modeled at the algorithmic level in VHDL, • EDA tool availability Verilog and for comparison purposes, C. It is then shown modeled • commercial, business and marketing issues at the RTL in VHDL and Verilog. The modeling constructs of VHDL and Verilog cover a slightly different spectrum across the levels of behavioral abstraction; see 1. Introduction Figure 1. There are now two industry standard hardware description languages, VHDL and Verilog. The complexity of ASIC and FPGA designs has VHDL meant an increase in the number of specialist design consultants System with specific tools and with their own libraries of macro and mega Verilog cells written in either VHDL or Verilog. As a result, it is important Algorithm that designers know both VHDL and Verilog and that EDA tools Behavioral level of vendors provide tools that provide an environment allowing both abstraction RTL languages to be used in unison. For example, a designer might have a model of a PCI bus interface written in VHDL, but wants to use it Logic in a design with macros written in Verilog. VITAL 2. Background Gate VHDL (Very high speed intgrated circuit Hardware Description HDL modeling capability Language) became IEEE standard 1076 in 1987. It was updated in 1993 and is known today as “IEEE standard 1076 1993”. The Verilog Figure 1. HDL modeling capability hardware description language has been used far longer than VHDL and has been used extensively since it was lauched by Gateway in Compilation 1983. Cadence bought Gateway in 1989 and opened Verilog to the VHDL. Multiple design-units (entity/architecture pairs), that reside public domain in 1990. It became IEEE standard 1364 in December in the same system file, may be separately compiled if so desired. 1995. However, it is good design practice to keep each design unit in it’s own system file in which case separate compilation should not be There are two aspects to modeling hardware that any hardware an issue. description language facilitates; true abstract behavior and hardware Verilog. The Verilog language is still rooted in it's native interpretative structure. This means modeled hardware behavior is not prejudiced mode. Compilation is a means of speeding up simulation, but has by structural or design aspects of hardware intent and that hardware not changed the original nature of the language. As a result care structure is capable of being modeled irrespective of the design's must be taken with both the compilation order of code written in a behavior. single file and the compilation order of multiple files. Simulation results can change by simply changing the order of compilation. 3. VHDL/Verilog compared & contrasted Data types This section compares and contrasts individual aspects of the two languages; they are listed in alphabetical order. VHDL. A multitude of language or user defined data types can be used. This may mean dedicated conversion functions are needed to Capability convert objects from one type to another. The choice of which data Hardware structure can be modeled equally effectively in both VHDL types to use should be considered wisely, especially enumerated (abstract) data types. This will make models easier to write, clearer to read and avoid unnecessary conversion functions that can clutter the code. VHDL may be preferred because it allows a multitude of language or user defined data types to be used. Verilog. Compared to VHDL, Verilog data types are very simple, easy to use and very much geared towards modeling hardware structure as opposed to abstract hardware modeling. Unlike VHDL, 33rd Design Automation Conference Permission to make digital/hard copy of all or part of this work for personal or class-room use is granted without fee provided that copies are not made or distributed for profit or commercial advantage, the copyright notice, the title of the publication and its date appear, and notice is given that copying is by permission of ACM, Inc. To copy otherwise, or to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. DAC 96 - 06/96 Las Vegas, NV, USA 1996 ACM, Inc. 0-89791-833-9/96/0006.. $3.50 all data types used in a Verilog model are defined by the Verilog example, a designer, or more likely, a Verilog tool vendor, can specify language and not by the user. There are net data types, for example user defined tasks or functions in the C programming language, and wire, and a register data type called reg. A model with a signal whose then call them from the Verilog source description. Use of such tasks type is one of the net data types has a corresponding electrical wire or functions make a Verilog model nonstandard and so may not be in the implied modeled circuit. Objects, that is signals, of type reg usable by other Verilog tools. Their use is not recommended. hold their value over simulation delta cycles and should not be confused with the modeling of a hardware register. Verilog may be Libraries preferred because of it’s simplicity. VHDL. A library is a store for compiled entities, architectures, packages and configurations. Useful for managing multiple design Design reusability projects. VHDL. Procedures and functions may be placed in a package so Verilog. There is no concept of a library in Verilog. This is due to it's that they are available to any design-unit that wishes to use them. origins as an interpretive language. Verilog. There is no concept of packages in Verilog. Functions and procedures used within a model must be defined in the module. To Low Level Constructs make functions and procedures generally accessible from different VHDL. Simple two input logical operators are built into the language, module statements the functions and procedures must be placed in they are: NOT, AND, OR, NAND, NOR, XOR and XNOR. Any a separate system file and included using ‘include compiler directive. timing must be separately specified using the after clause. Separate constructs defined under the VITAL language must be used to define Easiest to Learn the cell primitives of ASIC and FPGA libraries. Starting with zero knowledge of either language, Verilog is probably Verilog. The Verilog language was originally developed with gate the easiest to grasp and understand. This assumes the Verilog level modeling in mind, and so has very good constructs for modeling compiler directive language for simulation and the PLI language is at this level and for modeling the cell primitives of ASIC and FPGA not included. If these languages are included they can be looked libraries. Examples include User Defined Primitives (UDP), truth upon as two additional languages that need to be learned. tables and the specify block for specifying timing delays across a VHDL may seem less intuitive at first for two primary reasons. First, module. it is very strongly typed; a feature that makes it robust and powerful for the advanced user after a longer learning phase. Second, there Managing large designs are many ways to model the same circuit, specially those with large VHDL. Configuration, generate, generic and package statements all hierarchical structures. help manage large design structures. Forward and back annotation Verilog. There are no statements in Verilog that help manage large designs. A spin-off from Verilog is the Standard Delay Format (SDF). This is a general purpose format used to define the timing delays in a Operators circuit. The format provides a bidirectional link between, chip layout The majority of operators are the same between the two languages. tools, and either synthesis or simulation tools, in order to provide Verilog does have very useful unary reduction operators that are not more accurate timing representations. The SDF format is now an in VHDL. A loop statement can be used in VHDL to perform the industry standard in it’s own right. same operation as a Verilog unary reduction operator. VHDL has High level constructs the mod operator that is not found in Verilog. VHDL. There are more constructs and features for high-level Parameterizable models modeling in VHDL than there are in Verilog. Abstract data types VHDL. A specific bit width model can be instantiated from a generic can be used along with the following statements: n-bit model using the generic statement. The generic model will not • package statements for model reuse, synthesize until it is instantiated and the value of the generic given. • configuration statements for configuring design structure, Verilog. A specific width model can be instantiated from a generic • generate statements for replicating structure, n-bit model using overloaded parameter values. The generic model • generic statements for generic models that can be must have a default parameter value defined. This means two things. individually characterized, for example, bit width. In the absence of an overloaded value being specified, it will still synthesize, but will use the specified default parameter value. Also, All these language statements are useful in synthesizable models. it does not need to be instantiated with an overloaded parameter Verilog.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us