Verilog Website Links For
Verilog
 

Information About

Verilog




The designers of Verilog wanted a language with Syntax similar to the C Programming Language so that it would be familiar to engineers and readily accepted. The language has a pre-processor like C, and the major control keywords such as "if", "while", etc are similar. The formatting mechanism in the printing routines and language operators (and their precedence) are also similar.

The language differs in some fundamental ways. Verilog uses Begin/End instead of curly braces to define a block of code. The definition of constants in verilog require a bit width along with their base, consequently these differ. Verilog doesn't have structures, pointers, or recursive subroutines either. Finally, the concept of time —so important to an HDL— won't be found in C.

The language differs from a conventional Programming Language in that the execution of Statements is not strictly linear. A Verilog design consists of a hierarchy of modules. Modules are defined with a set of input, output, and bidirectional ports. Internally, a module contains a list of wires and registers. Concurrent and sequential statements define the behaviour of the module by defining the relationships between the ports, wires, and registers. Sequential statements are placed inside a begin/end block and executed in sequential order within the block. But all concurrent statements and all begin/end blocks in the design are executed in parallel. A module can also contain one or more instances of another module to define sub-behavior.

A subset of statements in the language is Synthesizable . If the modules in a design contain only synthesizable statements, software can be used to transform or synthesize the design into a Netlist that describes the basic components and connections to be implemented in hardware. The netlist may then be transformed into, for example, a form describing the Standard Cells of an Integrated Circuit (e.g. an ASIC ) or a Bitstream for a Programmable Logic Device (e.g. a FPGA ).


HISTORY


Beginning

Verilog was invented by Phil Moorby at Automated Integrated Design Systems (later renamed to Gateway Design Automation ) in 1985 as a hardware modeling language. Gateway Design Automation was later purchased by Cadence Design Systems in 1990 . Cadence now has full proprietary rights to Gateway's Verilog and the Verilog-XL simulator Logic Simulators .


Standard opened

With the increasing success of VHDL , Cadence decided to make the language available for open Standardization . Cadence transferred Verilog
into the public domain under the Open Verilog International (OVI) (now known as Accellera )
organization. Verilog was later submitted to IEEE and became IEEE Standard 1364-1995, commonly referred to as
Verilog-95.


Verilog 2001

Extensions to Verilog-95 were submitted back to IEEE to cover the deficiencies that users had found in the original Verilog standard. These extensions became IEEE Standard 1364-2001 known as Verilog 2001


Superlog/System Verilog

The advent of High Level Verification languages such as OpenVera , and Verisity 's E language encouraged the development of Superlog by Co-Design Automation Inc . Co-Design Automation Inc was later purchased by Synopsys . The foundations of Superlog and Vera have been donated to Accellera . It has been transformed and updated to SystemVerilog which will likely become the next IEEE standard.

The latest versions of the language include support for analog and mixed signal modelling. These are referred to as Verilog-AMS .


EXAMPLE

A simple example of two Flip-flops follows:

module toplevel(clock,reset);
input clock;
input reset;

reg flop1;
reg flop2;

always @ (posedge reset or posedge clock)
if (reset)
begin
flop1 <= 0;
flop2 <= 1;
end
else
begin
flop1 <= flop2;
flop2 <= flop1;
end
endmodule


The "<=" operator in verilog is another aspect of its being a hardware description language as opposed to a normal procedural language. This is known as a "non-blocking" assignment. When the simulation runs, all of the signals assigned with a "<=" operator have their assignment scheduled to occur after all statements occurring during the same point in time have executed. After all the statements have been executed for one event, the scheduled assignments are performed. This makes it easier to code behaviours that happen simultaneously.

In the above example, flop1 is assigned flop2, and flop2 is assigned flop1. These statements are executed during the same time event. Since the assignments are coded with the "<=" non-blocking operator, the assignments are scheduled to occur at the end of the event. Until then, all reads to flop1 and flop2 will use the values they had at the beginning of the time event.

This means that the order of the assignments are irrelevant and will produce the same result. flop1 and flop2 will swap values every clock.

The other choice for assignment is an "=" operator and this is known as a blocking assignment. When the "=" operator is used, things occur in the sequence they occur much like a procedural language.

In the above example, if the statements had used the "=" blocking operator instead, then the order of the statements would affect the behaviour. If the same code were used but changed to "=" operators, the reset would set flop2 to a 1, and flop1 to a 0. A clock event would set flop1 to flop2 (a 1) and this assignment would happen immediately. The next statement would assign flop2 to flop1, which is now a 1. Rather than swap values every clock, flop1 and flop2 would both become 1 and remain that way.

An example Counter circuit follows:

module Div20x (rst, clk, cet, cep, count,tc);
//TITLE 'Divide-by-20 Counter with enables'

//enable CEP is a clock enable only
//enable CET is a clock enable and enables the TC output

//a counter using the Verilog language

parameter size = 5;
parameter length = 20;

input rst; // These inputs/outputs represent connections to
input clk; // the module.
input cet;
input cep;

output {Link without Title} count;
output tc;

reg {Link without Title} count; // Signals assigned within an always (or initial) block
// must be of type reg
wire tc; // Other signals are of type wire

// The always statement below is a parallel execution statement that
// executes any time the signals rst or clk transition from low to high
always @ (posedge rst or posedge clk)

if (rst) // This simulates a reset of the counter
count <= 5'b0;
else
if (cet && cep) // This simulates the enables both being true
begin
if (count == length-1)
count <= 5'b0;
else
count <= count + 5'b1; // 5'b1 is 5 bits wide and
end // equal to the value 1.

// the value of tc is continuously assigned the value of the expression
assign tc = (cet && (count == length-1));

endmodule


An example of delays:

...
reg a, b, c, d;
wire e;
...
always @(b or e)
begin
a = b & e;