Comparison of VHDL Verilog and SystemVerilog
Comparison of VHDL Verilog and SystemVerilog
Stephen Bailey
Technical Marketing Engineer
Model Technology
w w w. m o d e l . c o m
Introduction
As the number of enhancements to various
Hardware Description Languages (HDLs) has
increased over the past year, so too has the complexity of determining which language is best for
a particular design. Many designers and organizations are contemplating whether they should
switch from one HDL to another.
This paper compares the technical characteristics
of three, general-purpose HDLs:
VHDL
VHDL is a strongly and richly typed language.
Derived from the Ada programming language, its
language requirements make it more verbose
than Verilog. The additional verbosity is intended to make designs self-documenting. Also, the
strong typing requires additional coding to
Verilog
Verilog is a weakly and limited typed language.
Its heritage can be traced to the C programming
language and an older HDL called Hilo.
All data types in Verilog are predefined in the
language. Verilog recognizes that all data types
have a bit-level representation. The supported
data representations (excluding strings) can be
mixed freely in Verilog.
SystemVerilog
Though the parent of SystemVerilog is clearly
Verilog, the language also benefits from a proprietary Verilog extension known as Superlog and
tenants of C and C++ programming languages.
SystemVerilog extends Verilog by adding a rich,
user-defined type system. It also adds strong-typing capabilities, specifically in the area of userdefined types. However, the strength of the type
checking in VHDL still exceeds that in
SystemVerilog. And, to retain backward compatibility, SystemVerilog retains weak-typing for the
built-in Verilog types.
VHDL
Strong typing
Yes
Verilog (2001)
SystemVerilog
No
Bit
bit-vector
wire
reg)
unsigned
signed
integer
real
String in certain contexts only
Partial
Not strongly typed in areas backward compatible with Verilog
Yes
Enhanced type system is strongly
typed (but not as strong as VHDL)
User-defined types
Yes
No
Yes
Yes
No
Partial
Class objects can be dynamically
created/destroyed, but via handles
(safe pointers)
Physical types
Yes
No
No
Named events
No
Yes
Yes
Enumerated types
(FSM modeling)
Yes
No
Yes
Records/structs
Yes
No
Yes
Variant/unions
No
No
Yes
Associative/sparse arrays
Partial
(But can be modeled using
access types)
No
Yes
Class/inheritance
No
No
Yes
(single inheritance)
Data packing
No
No
Yes
Partial
Not built-in but standard
package supports
Yes
Yes
Yes
No
No
Subprograms (procedural)
Yes
Function & procedure
always automatic
Yes
Static and automatic functions
and tasks
Yes
Same as Verilog plus void
functions (procedures)
Subprograms (concurrent)
aka tasks
Yes
Concurrent procedure calls
Yes
Static tasks
Yes
Static tasks
Methods
No
No
Yes
(goes hand-in-hand with classes)
Separate packaging
Yes
Packages
Yes
Include files
Yes
Include files
continues on pg 4
continued from pg 3
VHDL
Verilog (2001)
SystemVerilog
Other hierarchy
Yes
Separate entity / architecture
(Interface / implementation)
No
Yes
Programs, Clocking domains,
Interfaces
All-read sensitivity
No
Yes
@(*)
Yes
Postponed processes
No
Yes
Same as Verilog.
Plus: always_comb
Yes
Programs, Clocking domains,
Final blocks
Dynamic process
creation/deletion
No
Yes
Fork/join. Block/task disable.
Yes
Same as Verilog.
Conditional statements
Yes
If-then-else/elsif (priority)
Case (mux)
Selected assign (mux)
Conditional assign (priority)
No dont care matching capability
Yes
if-else (priority)
case (mux)
casex (mux)
?: (conditional used in
concurrent assignments)
Yes
Same as Verilog.
Adds priority and unique keywords
to infer priority encoding/mux
implementation
Iteration
Yes
Loop
while-loop
for-loop
exit
next
Can name the loop to exit or
continue with next
Yes
repeat
for
while
Yes
Same as Verilog, Plus:
do-while
break
continue
Only closest enclosing loop can
be break or continue
Yes
All expected:
arithmetic
logical
bit-wise
shift
concatenation
Overloadable (polymorphism).
No unary reduction.
No logical scalar/vector.
Yes
All expected:
arithmetic
logical
bit-wise
shift
concatenation
unary reduction
logical scalar/vector
case (in)equality.
conditional (?:)
No rotate left/right
Yes
Same as Verilog.
Plus:
wild (in)equality
increment
decrement
assignment (+=, -=, |=, etc.)
No rotate left/right
Yes
VITAL.
Very good FPGA library support.
Yes
Builtin primitives.
UDPs.
Better availability of ASIC library
support
Yes
Same as Verilog.
Except, library support yet to be
qualified as vendors wont assume
Verilog sign-off = SystemVerilog
sign-off
Interface abstraction
Partial
No
Component abstracts interface
from specific module.
Two layer binding allows flexibility
in generic/port mapping.
Yes
Interfaces are a separate
construct in language.
Supports multiple abstraction
level and eases interface reuse.
Can reduce coding.
continues on pg 5
continued from pg 4
VHDL
Verilog (2001)
SystemVerilog
Yes
Control of instance or component
binding to entity.
Incremental (re)binding of
generics and ports.
Partial
Control of module to instance
binding.
Partial
Same as Verilog.
Yes
If (conditional)
For (iterative)
Yes
If
if-else (mutually exclusive)
case
for
Yes
Same as Verilog.
Attributes
Yes
Attributes are typed.
Attribute values can be specified.
Attribute values can be referenced.
Anything labeled with a name can
be attributed.
Partial
Not-typed.
Can be placed virtually
anywhere.
What is attributed is determined
by lexical proximity.
Attribute values cannot be
referenced.
Partial
Same as Verilog.
Partial
Access types
Recursive subprograms
Extensive File I/O
Postponed processes
Standard package for random
number generation
Limited
File I/O
Random number generation
Recursive subprograms
Fork/join
Yes
Same as Verilog.
Plus:
Random and constrained
random value generation
Programs
Clocking domains
Associative arrays
Semaphores
Mailboxes
Classes
Assertions
Partial
Combinatorial (Boolean)
assertions
User-defined severity and
message control
No
Yes
Combinatorial and sequential
(concurrent) assertions.
Sequence (temporal) expression.
Sequence-local variables.
User-defined severity and
message control.
API extensions for assertions
and coverage information for
assertions
Foreign interfaces
Limited
Standard Foreign attribute
VhPI defined, but not yet
standardized
Yes
Standard C API (tf, acc, vpi)
Yes
Same as Verilog.
Plus:
Extensions to API for assertions
and coverage
Direct C language interface
Summary
With all of the recent publicity surrounding languages and standards, many people are wondering where to go next. The answer to this question
will vary greatly by designer and organization. In
addition to the language feature comparison
above, here are some final points to consider:
Corporate Headquarters
Model Technology
8005 S.W. Boeckman Road
Wilsonville, Oregon 97070 USA
Phone: 503-685-0824
Corporate Headquarters
Mentor Graphics Corporation
8005 S.W. Boeckman Road
Wilsonville, Oregon 97070 USA
Phone: 503-685-7000